summaryrefslogtreecommitdiffhomepage
path: root/tun/wintun/dll_fromfile_windows.go
diff options
context:
space:
mode:
Diffstat (limited to 'tun/wintun/dll_fromfile_windows.go')
-rw-r--r--tun/wintun/dll_fromfile_windows.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/tun/wintun/dll_fromfile_windows.go b/tun/wintun/dll_fromfile_windows.go
index 525812b..f40f8b3 100644
--- a/tun/wintun/dll_fromfile_windows.go
+++ b/tun/wintun/dll_fromfile_windows.go
@@ -20,6 +20,7 @@ type lazyDLL struct {
Name string
mu sync.Mutex
module windows.Handle
+ onLoad func(d *lazyDLL)
}
func (d *lazyDLL) Load() error {
@@ -42,6 +43,9 @@ func (d *lazyDLL) Load() error {
}
atomic.StorePointer((*unsafe.Pointer)(unsafe.Pointer(&d.module)), unsafe.Pointer(module))
+ if d.onLoad != nil {
+ d.onLoad(d)
+ }
return nil
}