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

Alexandre Julliard julliard at winehq.org
Mon Oct 4 15:42:18 CDT 2021


Module: wine
Branch: master
Commit: 62d89cee7cbdcdb3cc1c5e133a2334bffda1d042
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=62d89cee7cbdcdb3cc1c5e133a2334bffda1d042

Author: Ivo Ivanov <logos128 at gmail.com>
Date:   Mon Oct  4 10:18:12 2021 +0200

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 at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

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




More information about the wine-cvs mailing list