commit | 1d35b9e2eb4edf581781c7f3e2a36fac701f0a24 | [log] [tgz] |
---|---|---|
author | Jason A. Donenfeld <Jason@zx2c4.com> | Thu Dec 16 00:02:24 2021 +0100 |
committer | Jason Donenfeld <Jason@zx2c4.com> | Thu Dec 16 02:10:12 2021 +0000 |
tree | afc863b111683c295c77b19abca28faf30b96ddf | |
parent | 4abf325e0275e4ef0bdd441dcf497570f1419ab9 [diff] |
windows/svc: use NtQuerySystemInformation in IsWindowsService This brings the algorithm more exactly in line with what .NET does for the identically named function. Specifically, instead of using OpenProcess, which requires rights that restricted services might not have, we use NtQuerySystemInformation(SYSTEM_PROCESS_INFORMATION) to find the parent process image name and session ID. Fixes golang/go#44921. Change-Id: Ie2ad7521cf4c530037d086e61dbc2413e4e7777c Reviewed-on: https://go-review.googlesource.com/c/sys/+/372554 Trust: Jason Donenfeld <Jason@zx2c4.com> Run-TryBot: Jason Donenfeld <Jason@zx2c4.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Patrik Nyblom <pnyb@google.com> Trust: Patrik Nyblom <pnyb@google.com> Run-TryBot: Patrik Nyblom <pnyb@google.com>
This repository holds supplemental Go packages for low-level interactions with the operating system.
The easiest way to install is to run go get -u golang.org/x/sys
. You can also manually git clone the repository to $GOPATH/src/golang.org/x/sys
.
This repository uses Gerrit for code changes. To learn how to submit changes to this repository, see https://golang.org/doc/contribute.html.
The main issue tracker for the sys repository is located at https://github.com/golang/go/issues. Prefix your issue with “x/sys:” in the subject line, so it is easy to find.