Windows: Ignore any device interface GUIDs beyond the first
The NZXT Kraken Z73 device has been reported to brokenly have two
identical device interface GUIDs registered. Accept such cases by
treating the ERROR_MORE_DATA return value as success and processing the
first returned GUID as if it would be the only one.
If one day we see legitimate cases of multiple GUIDs we will need to
deal with them properly.
References jdkvision/libusb#1
Closes #1010
Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
diff --git a/libusb/os/windows_winusb.c b/libusb/os/windows_winusb.c
index f6ed979..5c860ea 100644
--- a/libusb/os/windows_winusb.c
+++ b/libusb/os/windows_winusb.c
@@ -1619,6 +1619,7 @@
if (key == INVALID_HANDLE_VALUE)
break;
// Look for both DeviceInterfaceGUIDs *and* DeviceInterfaceGUID, in that order
+ // If multiple GUIDs just process the first and ignore the others
size = sizeof(guid_string);
s = pRegQueryValueExA(key, "DeviceInterfaceGUIDs", NULL, ®_type,
(LPBYTE)guid_string, &size);
@@ -1628,7 +1629,7 @@
pRegCloseKey(key);
if (s == ERROR_FILE_NOT_FOUND) {
break; /* no DeviceInterfaceGUID registered */
- } else if (s != ERROR_SUCCESS) {
+ } else if (s != ERROR_SUCCESS && s != ERROR_MORE_DATA) {
usbi_warn(ctx, "unexpected error from pRegQueryValueExA for '%s'", dev_id);
break;
}
diff --git a/libusb/version_nano.h b/libusb/version_nano.h
index 1033492..c65a80b 100644
--- a/libusb/version_nano.h
+++ b/libusb/version_nano.h
@@ -1 +1 @@
-#define LIBUSB_NANO 11671
+#define LIBUSB_NANO 11672