windows: correct NT definitions and add more resolution

Alex pointed out that some of these original types were incomplete, so
this commit fills things out a bit more. We also add more to the test
case.

Change-Id: Iff7bd9ea6e0d021ba997c6d7351fe7c4a46187a9
Reviewed-on: https://go-review.googlesource.com/c/sys/+/299189
Trust: Jason A. Donenfeld <Jason@zx2c4.com>
Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Jason A. Donenfeld
2021-03-05 21:54:15 +00:00
parent d6cf4ab887
commit 5cdee2b1b5
4 changed files with 124 additions and 23 deletions
+14 -1
View File
@@ -560,7 +560,20 @@ func TestPEBFilePath(t *testing.T) {
}
pebPath := entry.FullDllName.String()
if osPath != pebPath {
t.Errorf("expected os.Executable() to return same value as peb.Ldr.{entry}.FullDllName - want %#q; got %#q", osPath, pebPath)
t.Errorf("peb.Ldr.{entry}.FullDllName = %#q; want %#q", pebPath, osPath)
}
paramPath := peb.ProcessParameters.ImagePathName.String()
if osPath != paramPath {
t.Errorf("peb.ProcessParameters.ImagePathName.{entry}.ImagePathName = %#q; want %#q", paramPath, osPath)
}
osCwd, err := os.Getwd()
if err != nil {
t.Errorf("unable to get working directory: %v", err)
}
osCwd = filepath.Clean(osCwd)
paramCwd := filepath.Clean(peb.ProcessParameters.CurrentDirectory.DosPath.String())
if paramCwd != osCwd {
t.Errorf("peb.ProcessParameters.CurrentDirectory.DosPath = %#q; want %#q", paramCwd, osCwd)
}
}