Rémi Bernon : hidclass.sys: Pass sizeof(packet) as input for IOCTL_HID_SET_OUTPUT_REPORT.

Alexandre Julliard julliard at winehq.org
Fri Aug 6 16:10:40 CDT 2021


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

Author: Rémi Bernon <rbernon at codeweavers.com>
Date:   Fri Aug  6 09:49:35 2021 +0200

hidclass.sys: Pass sizeof(packet) as input for IOCTL_HID_SET_OUTPUT_REPORT.

Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/hidclass.sys/device.c           | 11 ++++++++++-
 dlls/ntoskrnl.exe/tests/driver_hid.c |  4 ++--
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/dlls/hidclass.sys/device.c b/dlls/hidclass.sys/device.c
index 8a57516d5d5..123feeb6032 100644
--- a/dlls/hidclass.sys/device.c
+++ b/dlls/hidclass.sys/device.c
@@ -356,7 +356,16 @@ static void hid_device_xfer_report( BASE_DEVICE_EXTENSION *ext, ULONG code, IRP
         packet.reportBufferLen--;
     }
 
-    call_minidriver( code, ext->u.pdo.parent_fdo, NULL, 0, &packet, sizeof(packet), &irp->IoStatus );
+    switch (code)
+    {
+    case IOCTL_HID_GET_FEATURE:
+    case IOCTL_HID_GET_INPUT_REPORT:
+        call_minidriver( code, ext->u.pdo.parent_fdo, NULL, 0, &packet, sizeof(packet), &irp->IoStatus );
+        break;
+    case IOCTL_HID_SET_OUTPUT_REPORT:
+        call_minidriver( code, ext->u.pdo.parent_fdo, NULL, sizeof(packet), &packet, 0, &irp->IoStatus );
+        break;
+    }
 }
 
 static void HID_set_to_device( DEVICE_OBJECT *device, IRP *irp )
diff --git a/dlls/ntoskrnl.exe/tests/driver_hid.c b/dlls/ntoskrnl.exe/tests/driver_hid.c
index 422b9b74daa..8ddbfe3850f 100644
--- a/dlls/ntoskrnl.exe/tests/driver_hid.c
+++ b/dlls/ntoskrnl.exe/tests/driver_hid.c
@@ -549,8 +549,8 @@ static NTSTATUS WINAPI driver_internal_ioctl(DEVICE_OBJECT *device, IRP *irp)
         {
             HID_XFER_PACKET *packet = irp->UserBuffer;
             ULONG expected_size = 2;
-            todo_wine ok(in_size == sizeof(*packet), "got input size %u\n", in_size);
-            todo_wine ok(!out_size, "got output size %u\n", out_size);
+            ok(in_size == sizeof(*packet), "got input size %u\n", in_size);
+            ok(!out_size, "got output size %u\n", out_size);
 
             todo_wine_if(packet->reportId == 0x5a)
             ok(packet->reportId == report_id, "got id %u\n", packet->reportId);




More information about the wine-cvs mailing list