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
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 @@ } 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