aboutsummaryrefslogtreecommitdiff
path: root/setupapi/setupapi_windows_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'setupapi/setupapi_windows_test.go')
-rw-r--r--setupapi/setupapi_windows_test.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/setupapi/setupapi_windows_test.go b/setupapi/setupapi_windows_test.go
index 25e712f..1d3c33d 100644
--- a/setupapi/setupapi_windows_test.go
+++ b/setupapi/setupapi_windows_test.go
@@ -135,3 +135,27 @@ func TestSetupDiOpenDevRegKey(t *testing.T) {
defer key.Close()
}
}
+
+func TestSetupDiGetDeviceInstallParams(t *testing.T) {
+ devInfoList, err := SetupDiGetClassDevsEx(&deviceClassNetGUID, "", 0, DIGCF_PRESENT, DevInfo(0), "")
+ if err != nil {
+ t.Errorf("Error calling SetupDiGetClassDevsEx: %s", err.Error())
+ }
+ defer devInfoList.Close()
+
+ var data SP_DEVINFO_DATA
+ for i := 0; true; i++ {
+ err := SetupDiEnumDeviceInfo(devInfoList, i, &data)
+ if err != nil {
+ if errWin, ok := err.(syscall.Errno); ok && errWin == 259 /*ERROR_NO_MORE_ITEMS*/ {
+ break
+ }
+ continue
+ }
+
+ _, err = SetupDiGetDeviceInstallParams(devInfoList, &data)
+ if err != nil {
+ t.Errorf("Error calling SetupDiOpenDevRegKey: %s", err.Error())
+ }
+ }
+}