mirror of
https://git.zx2c4.com/wireguard-go
synced 2024-11-15 01:05:15 +01:00
tun: windows: open file at startup time
This commit is contained in:
parent
1e39c33ab1
commit
31ff9c02fe
@ -142,6 +142,15 @@ func CreateTUNWithRequestedGUID(ifname string, requestedGUID *windows.GUID) (Dev
|
|||||||
return nil, fmt.Errorf("Error creating event: %v", err)
|
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
|
return tun, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user