summaryrefslogtreecommitdiff
path: root/tun/wintun/dll_windows.go
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2020-12-09 01:46:55 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2021-01-07 14:49:44 +0100
commitca9edf1c6301ed1498a56124d018474a68d04b25 (patch)
treef44f3c7ba5c80c4eb559636fcca66697122ecdb5 /tun/wintun/dll_windows.go
parent347ce76bbcc6d2351dc298a1c8ca5604534bebec (diff)
downloadwireguard-go-ca9edf1c6301ed1498a56124d018474a68d04b25.tar.gz
wireguard-go-ca9edf1c6301ed1498a56124d018474a68d04b25.zip
wintun: do not load dll in init()
This prevents linking to wintun.dll until it's actually needed, which should improve startup time. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'tun/wintun/dll_windows.go')
-rw-r--r--tun/wintun/dll_windows.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/tun/wintun/dll_windows.go b/tun/wintun/dll_windows.go
index 9f04f73..dd97bbc 100644
--- a/tun/wintun/dll_windows.go
+++ b/tun/wintun/dll_windows.go
@@ -12,8 +12,8 @@ import (
"unsafe"
)
-func newLazyDLL(name string) *lazyDLL {
- return &lazyDLL{Name: name}
+func newLazyDLL(name string, onLoad func(d *lazyDLL)) *lazyDLL {
+ return &lazyDLL{Name: name, onLoad: onLoad}
}
func (d *lazyDLL) NewProc(name string) *lazyProc {