Zebediah Figura : winehid.sys: Pass PnP IRPs down to the next device.

Alexandre Julliard julliard at winehq.org
Tue Apr 20 16:27:44 CDT 2021


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

Author: Zebediah Figura <z.figura12 at gmail.com>
Date:   Mon Apr 19 23:37:08 2021 -0500

winehid.sys: Pass PnP IRPs down to the next device.

hidclass requires the minidriver to do this, and to return success from
IRP_MN_START_DEVICE.

Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/winehid.sys/main.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/dlls/winehid.sys/main.c b/dlls/winehid.sys/main.c
index 0f18514208a..975deac993f 100644
--- a/dlls/winehid.sys/main.c
+++ b/dlls/winehid.sys/main.c
@@ -68,6 +68,14 @@ static NTSTATUS WINAPI internal_ioctl(DEVICE_OBJECT *device, IRP *irp)
     }
 }
 
+static NTSTATUS WINAPI driver_pnp(DEVICE_OBJECT *device, IRP *irp)
+{
+    HID_DEVICE_EXTENSION *ext = device->DeviceExtension;
+
+    IoSkipCurrentIrpStackLocation(irp);
+    return IoCallDriver(ext->NextDeviceObject, irp);
+}
+
 static NTSTATUS WINAPI add_device(DRIVER_OBJECT *driver, DEVICE_OBJECT *device)
 {
     TRACE("(%p, %p)\n", driver, device);
@@ -81,6 +89,7 @@ NTSTATUS WINAPI DriverEntry(DRIVER_OBJECT *driver, UNICODE_STRING *path)
     TRACE("(%p, %s)\n", driver, debugstr_w(path->Buffer));
 
     driver->MajorFunction[IRP_MJ_INTERNAL_DEVICE_CONTROL] = internal_ioctl;
+    driver->MajorFunction[IRP_MJ_PNP] = driver_pnp;
     driver->DriverExtension->AddDevice = add_device;
 
     memset(&registration, 0, sizeof(registration));




More information about the wine-cvs mailing list