summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Dickens <christopher.a.dickens@gmail.com>2015-04-21 22:04:31 -0700
committerChris Dickens <christopher.a.dickens@gmail.com>2015-04-21 22:04:31 -0700
commit0e10f8f8673de2367df024b3400eaceef8e76659 (patch)
tree854c78c209f8f4657bdc7784026aee51d239f4b3
parent56aa10682477ac5b2c80e19842772c38749be1f1 (diff)
downloadlibusb-0e10f8f8673de2367df024b3400eaceef8e76659.tar.gz
Windows: Fix wIndex in setup packet for config descriptor request
Per the USB spec, the wIndex field should be zero or the language ID. Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
-rw-r--r--libusb/os/windows_usb.c4
-rw-r--r--libusb/version_nano.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/libusb/os/windows_usb.c b/libusb/os/windows_usb.c
index 098543b..787aa77 100644
--- a/libusb/os/windows_usb.c
+++ b/libusb/os/windows_usb.c
@@ -1151,7 +1151,7 @@ static int cache_config_descriptors(struct libusb_device *dev, HANDLE hub_handle
cd_buf_short.req.SetupPacket.bmRequest = LIBUSB_ENDPOINT_IN;
cd_buf_short.req.SetupPacket.bRequest = USB_REQUEST_GET_DESCRIPTOR;
cd_buf_short.req.SetupPacket.wValue = (USB_CONFIGURATION_DESCRIPTOR_TYPE << 8) | i;
- cd_buf_short.req.SetupPacket.wIndex = i;
+ cd_buf_short.req.SetupPacket.wIndex = 0;
cd_buf_short.req.SetupPacket.wLength = (USHORT)(size - sizeof(USB_DESCRIPTOR_REQUEST));
// Dummy call to get the required data size. Initial failures are reported as info rather
@@ -1180,7 +1180,7 @@ static int cache_config_descriptors(struct libusb_device *dev, HANDLE hub_handle
cd_buf_actual->SetupPacket.bmRequest = LIBUSB_ENDPOINT_IN;
cd_buf_actual->SetupPacket.bRequest = USB_REQUEST_GET_DESCRIPTOR;
cd_buf_actual->SetupPacket.wValue = (USB_CONFIGURATION_DESCRIPTOR_TYPE << 8) | i;
- cd_buf_actual->SetupPacket.wIndex = i;
+ cd_buf_actual->SetupPacket.wIndex = 0;
cd_buf_actual->SetupPacket.wLength = (USHORT)(size - sizeof(USB_DESCRIPTOR_REQUEST));
if (!DeviceIoControl(hub_handle, IOCTL_USB_GET_DESCRIPTOR_FROM_NODE_CONNECTION, cd_buf_actual, size,
diff --git a/libusb/version_nano.h b/libusb/version_nano.h
index a8bf988..d8030b5 100644
--- a/libusb/version_nano.h
+++ b/libusb/version_nano.h
@@ -1 +1 @@
-#define LIBUSB_NANO 10967
+#define LIBUSB_NANO 10968