Windows: Allow arbitrary bConfigurationValue in config descriptors Unlike bInterfaceNumber, bConfigurationValue does not have to be either sequential or contiguous. The bConfigurationValue is now included in debug output. Fixes #48 reported by Benjamin Dobell.
diff --git a/libusb/os/windows_usb.c b/libusb/os/windows_usb.c index e19693e..b999746 100644 --- a/libusb/os/windows_usb.c +++ b/libusb/os/windows_usb.c
@@ -846,13 +846,8 @@ LOOP_BREAK(LIBUSB_ERROR_IO); } - usbi_dbg("cached config descriptor #%d (%d bytes)", i+1, cd_data->wTotalLength); - - // Sanity check. Ensures that indexes for our list of config desc is in the right order - if (i != (cd_data->bConfigurationValue-1)) { - usbi_warn(ctx, "program assertion failed - config descriptors are being read out of order"); - continue; - } + usbi_dbg("cached config descriptor %d (bConfigurationValue=%d, %d bytes)", + i, cd_data->bConfigurationValue, cd_data->wTotalLength); // Cache the descriptor priv->config_descriptor[i] = malloc(cd_data->wTotalLength);