ntoskrnl.exe: Send PnP IRPs to the top of the device stack.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2019-06-06 11:12:52 -04:00 committed by Alexandre Julliard
parent 4820d9d76c
commit 9392aaa17f
1 changed files with 6 additions and 0 deletions

View File

@ -176,6 +176,8 @@ static NTSTATUS get_device_id( DEVICE_OBJECT *device, BUS_QUERY_ID_TYPE type, WC
IO_STATUS_BLOCK irp_status; IO_STATUS_BLOCK irp_status;
IRP *irp; IRP *irp;
device = IoGetAttachedDevice( device );
if (!(irp = IoBuildSynchronousFsdRequest( IRP_MJ_PNP, device, NULL, 0, NULL, NULL, &irp_status ))) if (!(irp = IoBuildSynchronousFsdRequest( IRP_MJ_PNP, device, NULL, 0, NULL, NULL, &irp_status )))
return STATUS_NO_MEMORY; return STATUS_NO_MEMORY;
@ -192,6 +194,8 @@ static NTSTATUS send_pnp_irp( DEVICE_OBJECT *device, UCHAR minor )
IO_STATUS_BLOCK irp_status; IO_STATUS_BLOCK irp_status;
IRP *irp; IRP *irp;
device = IoGetAttachedDevice( device );
if (!(irp = IoBuildSynchronousFsdRequest( IRP_MJ_PNP, device, NULL, 0, NULL, NULL, &irp_status ))) if (!(irp = IoBuildSynchronousFsdRequest( IRP_MJ_PNP, device, NULL, 0, NULL, NULL, &irp_status )))
return STATUS_NO_MEMORY; return STATUS_NO_MEMORY;
@ -291,6 +295,8 @@ static NTSTATUS send_power_irp( DEVICE_OBJECT *device, DEVICE_POWER_STATE power
IO_STACK_LOCATION *irpsp; IO_STACK_LOCATION *irpsp;
IRP *irp; IRP *irp;
device = IoGetAttachedDevice( device );
if (!(irp = IoBuildSynchronousFsdRequest( IRP_MJ_POWER, device, NULL, 0, NULL, NULL, &irp_status ))) if (!(irp = IoBuildSynchronousFsdRequest( IRP_MJ_POWER, device, NULL, 0, NULL, NULL, &irp_status )))
return STATUS_NO_MEMORY; return STATUS_NO_MEMORY;