Add support for setupapi.setupDiCreateDeviceInfoListEx()

Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
Simon Rozman
2019-02-04 11:49:26 +01:00
committed by Jason A. Donenfeld
parent 963be8e993
commit 024a4916c2
3 changed files with 50 additions and 0 deletions

View File

@@ -70,6 +70,29 @@ func TestSetupDiClassGuidsFromNameEx(t *testing.T) {
}
}
func TestSetupDiCreateDeviceInfoListEx(t *testing.T) {
devInfoList, err := SetupDiCreateDeviceInfoListEx(&deviceClassNetGUID, 0, "")
if err == nil {
devInfoList.Close()
} else {
t.Errorf("Error calling SetupDiCreateDeviceInfoListEx: %s", err.Error())
}
devInfoList, err = SetupDiCreateDeviceInfoListEx(&deviceClassNetGUID, 0, computerName)
if err == nil {
devInfoList.Close()
} else {
t.Errorf("Error calling SetupDiCreateDeviceInfoListEx: %s", err.Error())
}
devInfoList, err = SetupDiCreateDeviceInfoListEx(nil, 0, "")
if err == nil {
devInfoList.Close()
} else {
t.Errorf("Error calling SetupDiCreateDeviceInfoListEx(nil): %s", err.Error())
}
}
func TestSetupDiGetClassDevsEx(t *testing.T) {
devInfoList, err := SetupDiGetClassDevsEx(&deviceClassNetGUID, "PCI", 0, DIGCF_PRESENT, DevInfo(0), computerName)
if err == nil {