wintun: Clean excessive setupapi.DevInfo.GetDeviceInfoListDetail() call
Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
parent
ef48d4fa95
commit
043b7e8013
@ -45,13 +45,6 @@ func GetInterface(ifname string, hwndParent uintptr) (*Wintun, error) {
|
|||||||
}
|
}
|
||||||
defer devInfoList.Close()
|
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
|
// Windows requires each interface to have a different name. When
|
||||||
// enforcing this, Windows treats interface names case-insensitive. If an
|
// enforcing this, Windows treats interface names case-insensitive. If an
|
||||||
// interface "FooBar" exists and this function reports there is no
|
// 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()
|
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.
|
// Iterate.
|
||||||
for index := 0; ; index++ {
|
for index := 0; ; index++ {
|
||||||
// Get the device from the list.
|
// Get the device from the list.
|
||||||
|
Loading…
Reference in New Issue
Block a user