windows: correct types and error values of internal GUID handling

This corrects the Windows int type to be the more correct int32 Go
analog, as well as not using GetLastError() for the error value of the
GUID string parsing function.

Change-Id: I9716f991ef649f7d299295e3f4e75d3986ec3a74
Reviewed-on: https://go-review.googlesource.com/c/sys/+/181397
Run-TryBot: Jason Donenfeld <Jason@zx2c4.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
This commit is contained in:
Jason A. Donenfeld
2019-06-09 07:43:00 +00:00
committed by Jason Donenfeld
parent 5b15430b70
commit 6df407bc07
3 changed files with 13 additions and 13 deletions
+4
View File
@@ -191,4 +191,8 @@ func TestGUID(t *testing.T) {
if guid2 != guid {
t.Fatalf("Did not parse string back to original GUID = %q; want %q", guid2, guid)
}
_, err = windows.GUIDFromString("not-a-real-guid")
if err != syscall.Errno(windows.CO_E_CLASSSTRING) {
t.Fatalf("Bad GUID string error = %v; want CO_E_CLASSSTRING", err)
}
}