mirror of
https://github.com/rwinkhart/sys.git
synced 2026-08-28 04:46:44 -04:00
windows: do not write LastStatus parameter of TEB when converting errors
The prior function updated the TEB's LastStatus member, which is not what we want to be doing here. It's also not consistent with Microsoft's own Go code for their pipe library, which properly uses the "NoTeb" variant like this commit. For good measure, we add a simple test case to make sure these paths are being exercised. Change-Id: I4080898f704bdc93a6048001b06ffce516fb412d Reviewed-on: https://go-review.googlesource.com/c/sys/+/298169 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:
@@ -494,3 +494,11 @@ func TestNTStatusString(t *testing.T) {
|
||||
t.Errorf("NTStatus.Error did not return an expected error string - want %q; got %q", want, got)
|
||||
}
|
||||
}
|
||||
|
||||
func TestNTStatusConversion(t *testing.T) {
|
||||
want := windows.ERROR_TOO_MANY_NAMES
|
||||
got := windows.STATUS_TOO_MANY_NAMES.Errno()
|
||||
if want != got {
|
||||
t.Errorf("NTStatus.Errno = %q (0x%x); want %q (0x%x)", got.Error(), got, want.Error(), want)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user