diff options
author | Chris Dickens <christopher.a.dickens@gmail.com> | 2018-02-01 23:31:18 -0800 |
---|---|---|
committer | Chris Dickens <christopher.a.dickens@gmail.com> | 2018-02-01 23:31:18 -0800 |
commit | cd7aeec8e73768f6091cec9c0d097adbc139b402 (patch) | |
tree | 0d38d143fc706ceba7932a657f91433611e30d3c /libusb | |
parent | 8ddd8d994df6e367603266630bc2fe83b9cad868 (diff) | |
download | libusb-cd7aeec8e73768f6091cec9c0d097adbc139b402.tar.gz |
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>
Diffstat (limited to 'libusb')
-rw-r--r-- | libusb/os/windows_winusb.c | 6 | ||||
-rw-r--r-- | libusb/version_nano.h | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/libusb/os/windows_winusb.c b/libusb/os/windows_winusb.c index 64c0a91..180affb 100644 --- a/libusb/os/windows_winusb.c +++ b/libusb/os/windows_winusb.c @@ -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 diff --git a/libusb/version_nano.h b/libusb/version_nano.h index 395c39f..e40a0dd 100644 --- a/libusb/version_nano.h +++ b/libusb/version_nano.h @@ -1 +1 @@ -#define LIBUSB_NANO 11297 +#define LIBUSB_NANO 11298 |