summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToby Gray <toby.gray@realvnc.com>2013-03-22 13:50:01 +0000
committerPete Batard <pete@akeo.ie>2013-04-01 16:48:49 +0100
commitf00edf639d3c1272744ab37f07f96fea5246976d (patch)
treed81c96c1e94f56059a6d70ddfb728dbd0a07d3db
parent8aa50632adb1dff6eacf5a78b998b8def29b4c38 (diff)
downloadlibusb-f00edf639d3c1272744ab37f07f96fea5246976d.tar.gz
Windows: Fix USB descriptor creation code for HID devices
* Prior to this fix the location for the next endpoint structure was obtained by using ed++. This doesn't work as sizeof(libusb_endpoint_descriptor) is greater than LIBUSB_DT_ENDPOINT_SIZE due to extra members. * Closes #110
-rw-r--r--libusb/os/windows_usb.c3
-rw-r--r--libusb/version_nano.h2
2 files changed, 2 insertions, 3 deletions
diff --git a/libusb/os/windows_usb.c b/libusb/os/windows_usb.c
index d8156b8..1eb81b4 100644
--- a/libusb/os/windows_usb.c
+++ b/libusb/os/windows_usb.c
@@ -3226,8 +3226,7 @@ static int _hid_get_config_descriptor(struct hid_device_priv* dev, void *data, s
ed->bmAttributes = 3;
ed->wMaxPacketSize = dev->input_report_size - 1;
ed->bInterval = 10;
-
- ed++;
+ ed = (struct libusb_endpoint_descriptor *)((char*)ed + LIBUSB_DT_ENDPOINT_SIZE);
}
if (dev->output_report_size) {
diff --git a/libusb/version_nano.h b/libusb/version_nano.h
index 909ed7a..5a977a3 100644
--- a/libusb/version_nano.h
+++ b/libusb/version_nano.h
@@ -1 +1 @@
-#define LIBUSB_NANO 10632
+#define LIBUSB_NANO 10633