diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-02-07 04:18:27 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-02-07 04:39:59 +0100 |
commit | ea59177f1c6ab9031d5d30771410c9514fa551d9 (patch) | |
tree | cfe5c11f9340d468dfd5f80b76db78584a9ef20a /tun/wintun/setupapi/zsetupapi_windows_test.go | |
parent | 306d08e692bc9b2249078c0b4ab7eb3e42078230 (diff) |
wintun: Introduce new package for obscuring Windows bits
Diffstat (limited to 'tun/wintun/setupapi/zsetupapi_windows_test.go')
-rw-r--r-- | tun/wintun/setupapi/zsetupapi_windows_test.go | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tun/wintun/setupapi/zsetupapi_windows_test.go b/tun/wintun/setupapi/zsetupapi_windows_test.go new file mode 100644 index 0000000..09b9195 --- /dev/null +++ b/tun/wintun/setupapi/zsetupapi_windows_test.go @@ -0,0 +1,20 @@ +/* SPDX-License-Identifier: MIT + * + * Copyright (C) 2019 WireGuard LLC. All Rights Reserved. + */ + +package setupapi + +import ( + "syscall" + "testing" + + "golang.org/x/sys/windows" +) + +func TestSetupDiDestroyDeviceInfoList(t *testing.T) { + err := SetupDiDestroyDeviceInfoList(DevInfo(windows.InvalidHandle)) + if errWin, ok := err.(syscall.Errno); !ok || errWin != 6 /*ERROR_INVALID_HANDLE*/ { + t.Errorf("SetupDiDestroyDeviceInfoList(nil, ...) should fail with ERROR_INVALID_HANDLE") + } +} |