mirror of
https://github.com/amnezia-vpn/amneziawg-go.git
synced 2025-04-17 22:46:54 +02:00
wintun: enable sharing of pnp node
This commit is contained in:
parent
5ba866a5c8
commit
50cd522cb0
1 changed files with 1 additions and 1 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue