mirror of
https://git.zx2c4.com/wireguard-go
synced 2025-10-05 08:36:57 +08:00
tun: windows: open file at startup time
This commit is contained in:
@@ -142,6 +142,15 @@ func CreateTUNWithRequestedGUID(ifname string, requestedGUID *windows.GUID) (Dev
|
||||
return nil, fmt.Errorf("Error creating event: %v", err)
|
||||
}
|
||||
|
||||
_, err = tun.getTUN()
|
||||
if err != nil {
|
||||
windows.CloseHandle(tun.rings.send.tailMoved)
|
||||
windows.CloseHandle(tun.rings.receive.tailMoved)
|
||||
tun.closeTUN()
|
||||
wt.DeleteInterface()
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return tun, nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user