hidclass.sys: Use the report length when copying report data.

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 <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Ivo Ivanov 2021-10-04 10:18:12 +02:00 committed by Alexandre Julliard
parent a41c5e057c
commit 62d89cee7c
1 changed files with 2 additions and 3 deletions

View File

@ -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 );