]> git.ipfire.org Git - thirdparty/wireguard-go.git/commitdiff
wintun: Clean excessive setupapi.DevInfo.GetDeviceInfoListDetail() call
authorSimon Rozman <simon@rozman.si>
Thu, 7 Feb 2019 19:49:41 +0000 (20:49 +0100)
committerSimon Rozman <simon@rozman.si>
Thu, 7 Feb 2019 19:49:41 +0000 (20:49 +0100)
Signed-off-by: Simon Rozman <simon@rozman.si>
tun/wintun/wintun_windows.go

index c1ffb1716ee214465d96e231dbb70a8c9d216c39..75180d52911974d44eca86fc7e82daa9a9628a82 100644 (file)
@@ -45,13 +45,6 @@ func GetInterface(ifname string, hwndParent uintptr) (*Wintun, error) {
        }
        defer devInfoList.Close()
 
-       // Retrieve information associated with a device information set.
-       // TODO: Is this really necessary?
-       _, err = devInfoList.GetDeviceInfoListDetail()
-       if err != nil {
-               return nil, err
-       }
-
        // Windows requires each interface to have a different name. When
        // enforcing this, Windows treats interface names case-insensitive. If an
        // interface "FooBar" exists and this function reports there is no
@@ -266,13 +259,6 @@ func (wintun *Wintun) DeleteInterface(hwndParent uintptr) (bool, bool, error) {
        }
        defer devInfoList.Close()
 
-       // Retrieve information associated with a device information set.
-       // TODO: Is this really necessary?
-       _, err = devInfoList.GetDeviceInfoListDetail()
-       if err != nil {
-               return false, false, err
-       }
-
        // Iterate.
        for index := 0; ; index++ {
                // Get the device from the list.