mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-15 21:37:17 +00:00
ntoskrnl/tests: Also test that IoInvalidateDeviceRelations() during device enumeration doesn't deadlock.
wineusb enumerates new devices and completes IRPs from the same thread (as if it were an IRQ thread). On the other hand, the Hauppauge cx231xx USB driver performs I/O from within IRP_MN_START_DEVICE. If the wineusb "IRQ" thread is currently trying to report a new device, it won't be able to report I/O completion, resulting in a deadlock. Although wineusb could be modified to use more threads, these tests show that calling IoInvalidateDeviceRelations() should not block in this situation.
This commit is contained in:
parent
200d7b25ec
commit
92456eb747
|
@ -275,6 +275,8 @@ static NTSTATUS pdo_pnp(DEVICE_OBJECT *device_obj, IRP *irp)
|
||||||
todo_wine ok(!status, "Failed to wait for child plug event, status %#lx.\n", status);
|
todo_wine ok(!status, "Failed to wait for child plug event, status %#lx.\n", status);
|
||||||
status = ZwSetEvent(device->plug_event2, NULL);
|
status = ZwSetEvent(device->plug_event2, NULL);
|
||||||
ok(!status, "Failed to set event, status %#lx.\n", status);
|
ok(!status, "Failed to set event, status %#lx.\n", status);
|
||||||
|
status = ZwWaitForSingleObject(device->plug_event, TRUE, &wait_time);
|
||||||
|
todo_wine ok(!status, "Failed to wait for child plug event, status %#lx.\n", status);
|
||||||
|
|
||||||
ret = STATUS_SUCCESS;
|
ret = STATUS_SUCCESS;
|
||||||
break;
|
break;
|
||||||
|
@ -648,6 +650,10 @@ static NTSTATUS fdo_ioctl(IRP *irp, IO_STACK_LOCATION *stack, ULONG code)
|
||||||
ok(!status, "Failed to set event, status %#lx.\n", status);
|
ok(!status, "Failed to set event, status %#lx.\n", status);
|
||||||
status = ZwWaitForSingleObject(device->plug_event2, TRUE, &wait_time);
|
status = ZwWaitForSingleObject(device->plug_event2, TRUE, &wait_time);
|
||||||
ok(!status, "Failed to wait for child plug event, status %#lx.\n", status);
|
ok(!status, "Failed to wait for child plug event, status %#lx.\n", status);
|
||||||
|
/* IoInvalidateDeviceRelations() here shouldn't deadlock either. */
|
||||||
|
IoInvalidateDeviceRelations(bus_pdo, BusRelations);
|
||||||
|
status = ZwSetEvent(device->plug_event, NULL);
|
||||||
|
ok(!status, "Failed to set event, status %#lx.\n", status);
|
||||||
|
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue