wugren vor 3 Jahren
Ursprung
Commit
3a1c0b439f
1 geänderte Dateien mit 6 neuen und 0 gelöschten Zeilen
  1. 6 0
      hidapi/windows/hid.c

+ 6 - 0
hidapi/windows/hid.c

@@ -344,6 +344,7 @@ struct hid_device_info HID_API_EXPORT * HID_API_CALL hid_enumerate(unsigned shor
 
 		/* Make sure this device is of Setup Class "HIDClass" and has a
 		   driver bound to it. */
+		char driverkey[1024];
 		for (i = 0; ; i++) {
 			char driver_name[256];
 
@@ -354,6 +355,11 @@ struct hid_device_info HID_API_EXPORT * HID_API_CALL hid_enumerate(unsigned shor
 				goto cont;
 
 			res = SetupDiGetDeviceRegistryPropertyA(device_info_set, &devinfo_data,
+				SPDRP_HARDWAREID, NULL, (PBYTE)driverkey, sizeof(driverkey), NULL);
+			if (!res)
+				goto cont;
+					
+			res = SetupDiGetDeviceRegistryPropertyA(device_info_set, &devinfo_data,
 			               SPDRP_CLASS, NULL, (PBYTE)driver_name, sizeof(driver_name), NULL);
 			if (!res)
 				goto cont;