diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-04-13 01:58:53 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-04-13 02:02:02 +0200 |
commit | e0a8c22aa64d6a606cb03e3fd09eaa3e62a2f7c9 (patch) | |
tree | 1a1c1d8bd027367ae3efb23f88ef3333e5b5e689 /tun/wintun/wintun_windows.go | |
parent | 0b77bf78cda24582688325cf3197866b60aed69e (diff) | |
download | wireguard-go-e0a8c22aa64d6a606cb03e3fd09eaa3e62a2f7c9.tar.gz wireguard-go-e0a8c22aa64d6a606cb03e3fd09eaa3e62a2f7c9.zip |
windows: use proper constants from updated x/sys
Diffstat (limited to 'tun/wintun/wintun_windows.go')
-rw-r--r-- | tun/wintun/wintun_windows.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tun/wintun/wintun_windows.go b/tun/wintun/wintun_windows.go index 8e09c41..eae283b 100644 --- a/tun/wintun/wintun_windows.go +++ b/tun/wintun/wintun_windows.go @@ -114,7 +114,7 @@ func GetInterface(ifname string, hwndParent uintptr) (*Wintun, error) { // Get the device from the list. Should anything be wrong with this device, continue with next. deviceData, err := devInfoList.EnumDeviceInfo(index) if err != nil { - if errWin, ok := err.(syscall.Errno); ok && errWin == 259 /*ERROR_NO_MORE_ITEMS*/ { + if errWin, ok := err.(syscall.Errno); ok && errWin == windows.ERROR_NO_MORE_ITEMS { break } continue @@ -145,7 +145,7 @@ func GetInterface(ifname string, hwndParent uintptr) (*Wintun, error) { // Get a driver from the list. driverData, err := devInfoList.EnumDriverInfo(deviceData, driverType, index) if err != nil { - if errWin, ok := err.(syscall.Errno); ok && errWin == 259 /*ERROR_NO_MORE_ITEMS*/ { + if errWin, ok := err.(syscall.Errno); ok && errWin == windows.ERROR_NO_MORE_ITEMS { break } // Something is wrong with this driver. Skip it. @@ -236,7 +236,7 @@ func CreateInterface(description string, hwndParent uintptr) (*Wintun, bool, err // Get a driver from the list. driverData, err := devInfoList.EnumDriverInfo(deviceData, driverType, index) if err != nil { - if errWin, ok := err.(syscall.Errno); ok && errWin == 259 /*ERROR_NO_MORE_ITEMS*/ { + if errWin, ok := err.(syscall.Errno); ok && errWin == windows.ERROR_NO_MORE_ITEMS { break } // Something is wrong with this driver. Skip it. @@ -364,7 +364,7 @@ func (wintun *Wintun) DeleteInterface(hwndParent uintptr) (bool, bool, error) { // Get the device from the list. Should anything be wrong with this device, continue with next. deviceData, err := devInfoList.EnumDeviceInfo(index) if err != nil { - if errWin, ok := err.(syscall.Errno); ok && errWin == 259 /*ERROR_NO_MORE_ITEMS*/ { + if errWin, ok := err.(syscall.Errno); ok && errWin == windows.ERROR_NO_MORE_ITEMS { break } continue |