mirror of
https://github.com/RPCS3/libusb.git
synced 2026-07-01 13:13:20 -04:00
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:
@@ -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 @@
|
||||
#define LIBUSB_NANO 11297
|
||||
#define LIBUSB_NANO 11298
|
||||
|
||||
Reference in New Issue
Block a user