diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-08-21 08:40:44 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-08-21 09:16:12 +0200 |
commit | 68fea631d8e97aa7395b944916e569cf66553e73 (patch) | |
tree | 5ebd8d7c0227fd1b59cf961328814335f024060d /tun/wintun/netshell/netshell_windows.go | |
parent | ef23100a4f86948e0466dce980d8604ad95f13df (diff) |
wintun: use nci.dll directly instead of buggy netshell
Diffstat (limited to 'tun/wintun/netshell/netshell_windows.go')
-rw-r--r-- | tun/wintun/netshell/netshell_windows.go | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/tun/wintun/netshell/netshell_windows.go b/tun/wintun/netshell/netshell_windows.go deleted file mode 100644 index 3122d87..0000000 --- a/tun/wintun/netshell/netshell_windows.go +++ /dev/null @@ -1,32 +0,0 @@ -/* SPDX-License-Identifier: MIT - * - * Copyright (C) 2019 WireGuard LLC. All Rights Reserved. - */ - -package netshell - -import ( - "syscall" - "unsafe" - - "golang.org/x/sys/windows" -) - -var ( - modnetshell = windows.NewLazySystemDLL("netshell.dll") - procHrRenameConnection = modnetshell.NewProc("HrRenameConnection") -) - -func HrRenameConnection(guid *windows.GUID, newName *uint16) (err error) { - err = procHrRenameConnection.Find() - if err != nil { - // Missing from servercore, so we can't presume it's always there. - return - } - - ret, _, _ := syscall.Syscall(procHrRenameConnection.Addr(), 2, uintptr(unsafe.Pointer(guid)), uintptr(unsafe.Pointer(newName)), 0) - if ret != 0 { - err = syscall.Errno(ret) - } - return -} |