From: "Rémi Bernon" Subject: [PATCH 1/3] hidclass.sys: Use the report length when copying report data. Message-Id: <20211004081814.3494839-1-rbernon@codeweavers.com> Date: Mon, 4 Oct 2021 10:18:12 +0200 From: Ivo Ivanov Instead of the HID descriptor input report length. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51828 Signed-off-by: Rémi Bernon --- dlls/hidclass.sys/device.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/dlls/hidclass.sys/device.c b/dlls/hidclass.sys/device.c index 026ec1efeb1..632e98ab740 100644 --- a/dlls/hidclass.sys/device.c +++ b/dlls/hidclass.sys/device.c @@ -216,7 +216,6 @@ static struct hid_report *hid_queue_pop_report( struct hid_queue *queue ) static void hid_device_queue_input( DEVICE_OBJECT *device, HID_XFER_PACKET *packet ) { BASE_DEVICE_EXTENSION *ext = device->DeviceExtension; - HIDP_COLLECTION_DESC *desc = ext->u.pdo.device_desc.CollectionDesc; const BOOL polled = ext->u.pdo.information.Polled; struct hid_report *last_report, *report; struct hid_queue *queue; @@ -270,7 +269,7 @@ static void hid_device_queue_input( DEVICE_OBJECT *device, HID_XFER_PACKET *pack if (!(irp = hid_queue_pop_irp( queue ))) break; if (!(report = hid_queue_pop_report( queue ))) hid_report_incref( (report = last_report) ); - memcpy( irp->AssociatedIrp.SystemBuffer, report->buffer, desc->InputLength ); + memcpy( irp->AssociatedIrp.SystemBuffer, report->buffer, report->length ); irp->IoStatus.Information = report->length; irp->IoStatus.Status = STATUS_SUCCESS; hid_report_decref( report ); @@ -652,7 +651,7 @@ NTSTATUS WINAPI pdo_read(DEVICE_OBJECT *device, IRP *irp) irp->IoStatus.Information = 0; if ((report = hid_queue_pop_report( queue ))) { - memcpy( irp->AssociatedIrp.SystemBuffer, report->buffer, desc->InputLength ); + memcpy( irp->AssociatedIrp.SystemBuffer, report->buffer, report->length ); irp->IoStatus.Information = report->length; irp->IoStatus.Status = STATUS_SUCCESS; hid_report_decref( report ); -- 2.33.0