diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-07-22 17:01:27 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-07-22 17:01:27 +0200 |
commit | 50cd522cb0d8e384a4f46ec4155d7bed37cd57a6 (patch) | |
tree | 6e4278413cb05f31b65dad36308b088530667f32 /tun/wintun/wintun_windows.go | |
parent | 5ba866a5c8dfedb2efd54ae371090b9a05cedd1a (diff) |
wintun: enable sharing of pnp node
Diffstat (limited to 'tun/wintun/wintun_windows.go')
-rw-r--r-- | tun/wintun/wintun_windows.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tun/wintun/wintun_windows.go b/tun/wintun/wintun_windows.go index 88d565d..9be2b17 100644 --- a/tun/wintun/wintun_windows.go +++ b/tun/wintun/wintun_windows.go @@ -626,7 +626,7 @@ func (wintun *Wintun) AdapterHandle() (windows.Handle, error) { return windows.InvalidHandle, fmt.Errorf("PnPInstanceId registry key read failed: %v", err) } mangledPnpNode := strings.ReplaceAll(fmt.Sprintf("%s\\{cac88484-7515-4c03-82e6-71a87abac361}", pnpInstanceID), "\\", "#") - handle, err := windows.CreateFile(windows.StringToUTF16Ptr(fmt.Sprintf("\\\\.\\Global\\%s", mangledPnpNode)), windows.GENERIC_READ|windows.GENERIC_WRITE, 0, nil, windows.OPEN_EXISTING, 0, 0) + handle, err := windows.CreateFile(windows.StringToUTF16Ptr(fmt.Sprintf("\\\\.\\Global\\%s", mangledPnpNode)), windows.GENERIC_READ|windows.GENERIC_WRITE, windows.FILE_SHARE_READ | windows.FILE_SHARE_WRITE | windows.FILE_SHARE_DELETE, nil, windows.OPEN_EXISTING, 0, 0) if err != nil { return windows.InvalidHandle, fmt.Errorf("CreateFile on mangled PnPInstanceId path failed: %v", err) } |