From: Jason A. Donenfeld Date: Fri, 19 Jul 2019 06:30:19 +0000 (+0200) Subject: tun: windows: use specific IOCTL code X-Git-Tag: 0.0.20190805~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1b550f658325d7525cc4357024352599c6796d32;p=thirdparty%2Fwireguard-go.git tun: windows: use specific IOCTL code --- diff --git a/tun/tun_windows.go b/tun/tun_windows.go index dff51dd..5da5a70 100644 --- a/tun/tun_windows.go +++ b/tun/tun_windows.go @@ -25,7 +25,7 @@ const ( packetCapacity uint32 = 0x800000 // Ring capacity, 8MiB packetTrailingSize uint32 = uint32(unsafe.Sizeof(packetHeader{})) + ((packetSizeMax + (packetAlignment - 1)) &^ (packetAlignment - 1)) - packetAlignment - ioctlRegisterRings uint32 = (0x22 /*FILE_DEVICE_UNKNOWN*/ << 16) | (0x800 << 2) | 0 /*METHOD_BUFFERED*/ | (0x3 /*FILE_READ_DATA | FILE_WRITE_DATA*/ << 14) + ioctlRegisterRings uint32 = (51820 << 16) | (0x970 << 2) | 0 /*METHOD_BUFFERED*/ | (0x3 /*FILE_READ_DATA | FILE_WRITE_DATA*/ << 14) retryRate = 4 // Number of retries per second to reopen device pipe retryTimeout = 30 // Number of seconds to tolerate adapter unavailable