Rémi Bernon : dinput/tests: Keep child PDO remove IRP pending until fully removed.
Alexandre Julliard
julliard at winehq.org
Thu Mar 24 17:46:44 CDT 2022
Module: wine
Branch: master
Commit: d9fdde935a153d2ce7c27cf508c499be8ed15d0b
URL: https://source.winehq.org/git/wine.git/?a=commit;h=d9fdde935a153d2ce7c27cf508c499be8ed15d0b
Author: Rémi Bernon <rbernon at codeweavers.com>
Date: Wed Mar 23 16:09:41 2022 +0100
dinput/tests: Keep child PDO remove IRP pending until fully removed.
Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/dinput/tests/driver_bus.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/dlls/dinput/tests/driver_bus.c b/dlls/dinput/tests/driver_bus.c
index 9492f036c0f..be38de1999e 100644
--- a/dlls/dinput/tests/driver_bus.c
+++ b/dlls/dinput/tests/driver_bus.c
@@ -421,6 +421,7 @@ struct phys_device
WCHAR instance_id[MAX_PATH];
WCHAR device_id[MAX_PATH];
+ IRP *pending_remove;
BOOL use_report_id;
DWORD report_descriptor_len;
@@ -677,8 +678,14 @@ static NTSTATUS pdo_pnp( DEVICE_OBJECT *device, IRP *irp )
{
input_queue_cleanup( &impl->input_queue );
expect_queue_cleanup( &impl->expect_queue );
+ irp = impl->pending_remove;
IoDeleteDevice( device );
if (winetest_debug > 1) trace( "Deleted Bus PDO %p\n", device );
+ if (irp)
+ {
+ irp->IoStatus.Status = STATUS_SUCCESS;
+ IoCompleteRequest( irp, IO_NO_INCREMENT );
+ }
}
return STATUS_SUCCESS;
}
@@ -1220,7 +1227,9 @@ static NTSTATUS WINAPI pdo_ioctl( DEVICE_OBJECT *device, IRP *irp )
impl->base.state = PNP_DEVICE_REMOVED;
irp_queue_clear( &impl->input_queue.pending );
KeReleaseSpinLock( &impl->base.lock, irql );
- status = STATUS_SUCCESS;
+ impl->pending_remove = irp;
+ IoMarkIrpPending( irp );
+ status = STATUS_PENDING;
break;
case IOCTL_WINETEST_CREATE_DEVICE:
ok( 0, "unexpected call\n" );
More information about the wine-cvs
mailing list