diff options
author | Tormod Volden <debian.tormod@gmail.com> | 2021-10-17 00:13:44 +0200 |
---|---|---|
committer | Tormod Volden <debian.tormod@gmail.com> | 2021-11-07 12:48:27 +0100 |
commit | 3178abb79093231f46d7fa544335a58ddd58a324 (patch) | |
tree | dac942fe8ff750e2ce0e08c8eaacbfc5570dddcc /libusb | |
parent | 8fa0582438d9b624eb5d2c6d0d71821e20897479 (diff) | |
download | libusb-3178abb79093231f46d7fa544335a58ddd58a324.tar.gz |
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>
Diffstat (limited to 'libusb')
-rw-r--r-- | libusb/os/windows_winusb.c | 3 | ||||
-rw-r--r-- | libusb/version_nano.h | 2 |
2 files changed, 3 insertions, 2 deletions
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 @@ static int winusb_get_device_list(struct libusb_context *ctx, struct discovered_ 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 @@ static int winusb_get_device_list(struct libusb_context *ctx, struct discovered_ 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 |