summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Dickens <christopher.a.dickens@gmail.com>2018-02-01 23:31:18 -0800
committerChris Dickens <christopher.a.dickens@gmail.com>2018-02-01 23:31:18 -0800
commitcd7aeec8e73768f6091cec9c0d097adbc139b402 (patch)
tree0d38d143fc706ceba7932a657f91433611e30d3c
parent8ddd8d994df6e367603266630bc2fe83b9cad868 (diff)
downloadlibusb-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>
-rw-r--r--libusb/os/windows_winusb.c6
-rw-r--r--libusb/version_nano.h2
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