diff options
author | mcuee <xiaofanc@gmail.com> | 2021-08-27 17:49:30 +0800 |
---|---|---|
committer | Tormod Volden <debian.tormod@gmail.com> | 2021-09-23 10:49:34 +0200 |
commit | f7624bf0143d2016ca2aac7bdada91c0b63f0cad (patch) | |
tree | 89d6ace27f35843319e7e8810cc3e915dd79ee1f | |
parent | 1a906274a66dd58bf81836db1306902d4a7dc185 (diff) | |
download | libusb-f7624bf0143d2016ca2aac7bdada91c0b63f0cad.tar.gz |
Fix Windows HID backend missing byte
When the report id is zero, we should indeed skip the first byte of
transfer_priv->hid_buffer, since it is not part of the actual report.
But the report size should not change.
Thanks to Jonas Malaco who has done the investigation in this issue.
Reference: Jonas Malaco's comments
https://github.com/libusb/libusb/issues/902#issuecomment-810726897
Fixes #902
Fixes #977
Closes #986
-rw-r--r-- | libusb/os/windows_winusb.c | 2 | ||||
-rw-r--r-- | libusb/version_nano.h | 2 |
2 files changed, 1 insertions, 3 deletions
diff --git a/libusb/os/windows_winusb.c b/libusb/os/windows_winusb.c index 299de16..df40773 100644 --- a/libusb/os/windows_winusb.c +++ b/libusb/os/windows_winusb.c @@ -4205,8 +4205,6 @@ static enum libusb_transfer_status hid_copy_transfer_data(int sub_api, struct us } if (transfer_priv->hid_buffer[0] == 0) { - // Discard the 1 byte report ID prefix - length--; memcpy(transfer_priv->hid_dest, transfer_priv->hid_buffer + 1, length); } else { memcpy(transfer_priv->hid_dest, transfer_priv->hid_buffer, length); diff --git a/libusb/version_nano.h b/libusb/version_nano.h index 1a8e712..36ca1a0 100644 --- a/libusb/version_nano.h +++ b/libusb/version_nano.h @@ -1 +1 @@ -#define LIBUSB_NANO 11650 +#define LIBUSB_NANO 11651 |