diff options
author | Toby Gray <toby.gray@realvnc.com> | 2013-03-22 13:50:01 +0000 |
---|---|---|
committer | Pete Batard <pete@akeo.ie> | 2013-04-01 16:48:49 +0100 |
commit | f00edf639d3c1272744ab37f07f96fea5246976d (patch) | |
tree | d81c96c1e94f56059a6d70ddfb728dbd0a07d3db /libusb/os/windows_usb.c | |
parent | 8aa50632adb1dff6eacf5a78b998b8def29b4c38 (diff) | |
download | libusb-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
Diffstat (limited to 'libusb/os/windows_usb.c')
-rw-r--r-- | libusb/os/windows_usb.c | 3 |
1 files changed, 1 insertions, 2 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) { |