diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-05-07 12:00:58 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-05-07 12:01:42 +0200 |
commit | 5781cac8520f3ee9a3e3f1132e36361a1b7ee65f (patch) | |
tree | abe11e11ef7a7da6b03aaa69a01f01560211fa67 /conf/zsyscall_windows.go | |
parent | installer: bump MSI database version to 4.0 (diff) | |
download | wireguard-windows-5781cac8520f3ee9a3e3f1132e36361a1b7ee65f.tar.xz wireguard-windows-5781cac8520f3ee9a3e3f1132e36361a1b7ee65f.zip |
conf: only retry on no internet if system just booted
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to '')
-rw-r--r-- | conf/zsyscall_windows.go | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/conf/zsyscall_windows.go b/conf/zsyscall_windows.go index d8984bef..bfe54931 100644 --- a/conf/zsyscall_windows.go +++ b/conf/zsyscall_windows.go @@ -38,11 +38,12 @@ func errnoErr(e syscall.Errno) error { var ( modwininet = windows.NewLazySystemDLL("wininet.dll") + modkernel32 = windows.NewLazySystemDLL("kernel32.dll") modole32 = windows.NewLazySystemDLL("ole32.dll") modshell32 = windows.NewLazySystemDLL("shell32.dll") - modkernel32 = windows.NewLazySystemDLL("kernel32.dll") procInternetGetConnectedState = modwininet.NewProc("InternetGetConnectedState") + procGetTickCount64 = modkernel32.NewProc("GetTickCount64") procCoTaskMemFree = modole32.NewProc("CoTaskMemFree") procSHGetKnownFolderPath = modshell32.NewProc("SHGetKnownFolderPath") procFindFirstChangeNotificationW = modkernel32.NewProc("FindFirstChangeNotificationW") @@ -55,6 +56,12 @@ func internetGetConnectedState(flags *uint32, reserved uint32) (connected bool) return } +func getTickCount64() (ms uint64) { + r0, _, _ := syscall.Syscall(procGetTickCount64.Addr(), 0, 0, 0, 0) + ms = uint64(r0) + return +} + func coTaskMemFree(pointer uintptr) { syscall.Syscall(procCoTaskMemFree.Addr(), 1, uintptr(pointer), 0, 0) return |