Douglas Danger Manley 1b2bd6bb49 windows: replace all StringToUTF16 calls with UTF16FromString
`StringToUTF16` is deprecated and will panic if given an "invalid"
string (in particular, one that has a null byte in it).  The replacement
function is `UTF16FromString`, and it returns an error if there was
a problem.

This change replaces all uses of `StringToUTF16` with `UTF16FromString`.
The `service` struct now no longer stores a `string` name but rather
a `*uint16` pointer to the name.

It should not be possible to panic due to UTF16 string conversion
at this point.

Fixes golang/go#73006

Change-Id: Idce9cdbb4651fef8481f0cad19b5df0314fd4277
Reviewed-on: https://go-review.googlesource.com/c/sys/+/659936
Reviewed-by: Carlos Amedee <carlos@golang.org>
Auto-Submit: Carlos Amedee <carlos@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2025-04-02 11:32:38 -07:00
2023-10-11 21:54:30 +00:00
2023-10-11 21:54:30 +00:00
2025-03-26 05:30:21 -07:00
2015-03-18 17:04:21 +00:00
2024-07-16 16:11:15 +00:00
2024-11-02 04:18:59 +00:00

sys

Go Reference

This repository holds supplemental Go packages for low-level interactions with the operating system.

Report Issues / Send Patches

This repository uses Gerrit for code changes. To learn how to submit changes to this repository, see https://go.dev/doc/contribute.

The git repository is https://go.googlesource.com/sys.

The main issue tracker for the sys repository is located at https://go.dev/issues. Prefix your issue with "x/sys:" in the subject line, so it is easy to find.

Description
No description provided
Readme BSD-3-Clause 16 MiB
Languages
Go 85.7%
Assembly 12.3%
Shell 1.8%
C 0.1%