diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-08-24 12:29:17 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-08-24 12:29:17 +0200 |
commit | 0c540ad60e6942f0c8458d8b9b5ceb2d76a0d29b (patch) | |
tree | 7cfb3c2a29aa5959c60a6952f96672ef2fd3e3fd /tun/wintun/wintun_windows.go | |
parent | 3cedc22d7b49be8ca00dc549c79de9e4a2d3df5b (diff) |
wintun: make description consistent across fields
Diffstat (limited to 'tun/wintun/wintun_windows.go')
-rw-r--r-- | tun/wintun/wintun_windows.go | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/tun/wintun/wintun_windows.go b/tun/wintun/wintun_windows.go index 1caa4a1..c1f5025 100644 --- a/tun/wintun/wintun_windows.go +++ b/tun/wintun/wintun_windows.go @@ -157,17 +157,14 @@ func GetInterface(ifname string) (*Wintun, error) { return nil, windows.ERROR_OBJECT_NOT_FOUND } -// CreateInterface creates a Wintun interface. description is a string that -// supplies the text description of the device. The description is optional -// and can be "". requestedGUID is the GUID of the created network interface, -// which then influences NLA generation deterministically. If it is set to nil, -// the GUID is chosen by the system at random, and hence a new NLA entry is -// created for each new interface. It is called "requested" GUID because the -// API it uses is completely undocumented, and so there could be minor -// interesting complications with its usage. This function returns the network -// interface ID and a flag if reboot is required. -// -func CreateInterface(description string, requestedGUID *windows.GUID) (wintun *Wintun, rebootRequired bool, err error) { +// CreateInterface creates a Wintun interface. requestedGUID is the GUID of the +// created network interface, which then influences NLA generation +// deterministically. If it is set to nil, the GUID is chosen by the system at +// random, and hence a new NLA entry is created for each new interface. It is +// called "requested" GUID because the API it uses is completely undocumented, +// and so there could be minor interesting complications with its usage. This +// function returns the network interface ID and a flag if reboot is required. +func CreateInterface(requestedGUID *windows.GUID) (wintun *Wintun, rebootRequired bool, err error) { // Create an empty device info set for network adapter device class. devInfoList, err := setupapi.SetupDiCreateDeviceInfoListEx(&deviceClassNetGUID, 0, "") if err != nil { @@ -184,7 +181,7 @@ func CreateInterface(description string, requestedGUID *windows.GUID) (wintun *W } // Create a new device info element and add it to the device info set. - deviceData, err := devInfoList.CreateDeviceInfo(className, &deviceClassNetGUID, description, 0, setupapi.DICD_GENERATE_ID) + deviceData, err := devInfoList.CreateDeviceInfo(className, &deviceClassNetGUID, deviceTypeName, 0, setupapi.DICD_GENERATE_ID) if err != nil { err = fmt.Errorf("SetupDiCreateDeviceInfo failed: %v", err) return |