mirror of
https://github.com/golang/sys.git
synced 2026-02-08 11:46:04 +03:00
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>