diff options
Diffstat (limited to 'conf/zsyscall_windows.go')
-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 |