aboutsummaryrefslogtreecommitdiff
path: root/tun/wintun/iphlpapi/conversion_windows.go
diff options
context:
space:
mode:
authorSimon Rozman <simon@rozman.si>2020-07-22 09:15:49 +0200
committerSimon Rozman <simon@rozman.si>2020-11-07 12:46:35 +0100
commit3e08b8aee0f6ae038f6316ca1bb84e5214db318f (patch)
tree34681cb00b6b22bded95e0df6ed271de18983646 /tun/wintun/iphlpapi/conversion_windows.go
parent5ca1218a5c16fb9b5e99b61c0b5758f66087e2e4 (diff)
downloadwireguard-go-3e08b8aee0f6ae038f6316ca1bb84e5214db318f.tar.gz
wireguard-go-3e08b8aee0f6ae038f6316ca1bb84e5214db318f.zip
wintun: migrate to wintun.dll API
Rather than having every application using Wintun driver reinvent the wheel, the Wintun device/adapter/interface management has been moved from wireguard-go to wintun.dll deployed with Wintun itself. Signed-off-by: Simon Rozman <simon@rozman.si>
Diffstat (limited to 'tun/wintun/iphlpapi/conversion_windows.go')
-rw-r--r--tun/wintun/iphlpapi/conversion_windows.go25
1 files changed, 0 insertions, 25 deletions
diff --git a/tun/wintun/iphlpapi/conversion_windows.go b/tun/wintun/iphlpapi/conversion_windows.go
deleted file mode 100644
index d2db8a3..0000000
--- a/tun/wintun/iphlpapi/conversion_windows.go
+++ /dev/null
@@ -1,25 +0,0 @@
-/* SPDX-License-Identifier: MIT
- *
- * Copyright (C) 2020 WireGuard LLC. All Rights Reserved.
- */
-
-package iphlpapi
-
-import "golang.org/x/sys/windows"
-
-//sys convertInterfaceLUIDToGUID(interfaceLUID *uint64, interfaceGUID *windows.GUID) (ret error) = iphlpapi.ConvertInterfaceLuidToGuid
-//sys convertInterfaceAliasToLUID(interfaceAlias *uint16, interfaceLUID *uint64) (ret error) = iphlpapi.ConvertInterfaceAliasToLuid
-
-func InterfaceGUIDFromAlias(alias string) (*windows.GUID, error) {
- var luid uint64
- var guid windows.GUID
- err := convertInterfaceAliasToLUID(windows.StringToUTF16Ptr(alias), &luid)
- if err != nil {
- return nil, err
- }
- err = convertInterfaceLUIDToGUID(&luid, &guid)
- if err != nil {
- return nil, err
- }
- return &guid, nil
-}