Windows: Always search for "USB" PnP enumerator class

On systems running Windows 7 and earlier that only have a USB 3.0 host
controller, devices may not be listed correctly if the root hub PnP
enumerator is anything other than "USB". This regression was introduced
in the recent enumeration refactoring (commit 71a779d07).

Closes #385

Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
This commit is contained in:
Chris Dickens
2018-02-01 23:31:18 -08:00
parent 8ddd8d994d
commit cd7aeec8e7
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -1132,8 +1132,8 @@ static int winusb_get_device_list(struct libusb_context *ctx, struct discovered_
unsigned int guid_size = GUID_SIZE_STEP;
unsigned int nb_guids;
// Keep a list of PnP enumerator strings that are found
char *usb_enumerator[8];
unsigned int nb_usb_enumerators = 0;
char *usb_enumerator[8] = { "USB" };
unsigned int nb_usb_enumerators = 1;
unsigned int usb_enum_index = 0;
// Keep a list of newly allocated devs to unref
#define UNREF_SIZE_STEP 16
@@ -1512,7 +1512,7 @@ static int winusb_get_device_list(struct libusb_context *ctx, struct discovered_
free((void *)guid_list);
// Free any PnP enumerator strings
for (i = 0; i < nb_usb_enumerators; i++)
for (i = 1; i < nb_usb_enumerators; i++)
free(usb_enumerator[i]);
// Unref newly allocated devs
+1 -1
View File
@@ -1 +1 @@
#define LIBUSB_NANO 11297
#define LIBUSB_NANO 11298