[PATCH 4/5] ntoskrnl.exe: Send PnP IRPs to the top of the device stack.

Zebediah Figura zfigura at codeweavers.com
Thu Jun 6 10:12:52 CDT 2019


From: Zebediah Figura <z.figura12 at gmail.com>

Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
---
 dlls/ntoskrnl.exe/pnp.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/dlls/ntoskrnl.exe/pnp.c b/dlls/ntoskrnl.exe/pnp.c
index 20e1538c1a..e7303b6100 100644
--- a/dlls/ntoskrnl.exe/pnp.c
+++ b/dlls/ntoskrnl.exe/pnp.c
@@ -176,6 +176,8 @@ static NTSTATUS get_device_id( DEVICE_OBJECT *device, BUS_QUERY_ID_TYPE type, WC
     IO_STATUS_BLOCK irp_status;
     IRP *irp;
 
+    device = IoGetAttachedDevice( device );
+
     if (!(irp = IoBuildSynchronousFsdRequest( IRP_MJ_PNP, device, NULL, 0, NULL, NULL, &irp_status )))
         return STATUS_NO_MEMORY;
 
@@ -192,6 +194,8 @@ static NTSTATUS send_pnp_irp( DEVICE_OBJECT *device, UCHAR minor )
     IO_STATUS_BLOCK irp_status;
     IRP *irp;
 
+    device = IoGetAttachedDevice( device );
+
     if (!(irp = IoBuildSynchronousFsdRequest( IRP_MJ_PNP, device, NULL, 0, NULL, NULL, &irp_status )))
         return STATUS_NO_MEMORY;
 
@@ -291,6 +295,8 @@ static NTSTATUS send_power_irp( DEVICE_OBJECT *device, DEVICE_POWER_STATE power
     IO_STACK_LOCATION *irpsp;
     IRP *irp;
 
+    device = IoGetAttachedDevice( device );
+
     if (!(irp = IoBuildSynchronousFsdRequest( IRP_MJ_POWER, device, NULL, 0, NULL, NULL, &irp_status )))
         return STATUS_NO_MEMORY;
 
-- 
2.20.1




More information about the wine-devel mailing list