Module: wine Branch: master Commit: d0d1601e6c08116d9813f9899aafdde2df40209a URL: https://source.winehq.org/git/wine.git/?a=commit;h=d0d1601e6c08116d9813f9899...
Author: Paul Gofman pgofman@codeweavers.com Date: Wed Jun 3 14:29:44 2020 +0300
ntoskrnl.exe/tests: Avoid race condition in test driver.
Might fix random driver crash on testbot Win8 machine.
Signed-off-by: Paul Gofman pgofman@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/ntoskrnl.exe/tests/driver.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/dlls/ntoskrnl.exe/tests/driver.c b/dlls/ntoskrnl.exe/tests/driver.c index f51064986b..beac9c2c25 100644 --- a/dlls/ntoskrnl.exe/tests/driver.c +++ b/dlls/ntoskrnl.exe/tests/driver.c @@ -2194,7 +2194,9 @@ static NTSTATUS main_test(DEVICE_OBJECT *device, IRP *irp, IO_STACK_LOCATION *st main_test_work_item = IoAllocateWorkItem(lower_device); ok(main_test_work_item != NULL, "main_test_work_item = NULL\n");
+ IoMarkIrpPending(irp); IoQueueWorkItem(main_test_work_item, main_test_task, DelayedWorkQueue, irp); + return STATUS_PENDING; }
@@ -2380,7 +2382,6 @@ static NTSTATUS WINAPI driver_IoControl(DEVICE_OBJECT *device, IRP *irp) irp->IoStatus.Status = status; IoCompleteRequest(irp, IO_NO_INCREMENT); } - else IoMarkIrpPending(irp); return status; }