From e80b507f1e0ded2eee92a75248b81b8ea9ecc767 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Thu, 30 May 2019 13:11:59 +0200 Subject: [PATCH] ntoskrnl.exe: Dispatch server IRPs in critical region. Signed-off-by: Jacek Caban Signed-off-by: Alexandre Julliard --- dlls/ntoskrnl.exe/ntoskrnl.c | 2 ++ dlls/ntoskrnl.exe/tests/driver.c | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c index 14b5a1a676f..df8c4c1e2f9 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/ntoskrnl.c @@ -602,7 +602,9 @@ static void dispatch_irp( DEVICE_OBJECT *device, IRP *irp, struct dispatch_conte context->irp = irp; device->CurrentIrp = irp; + KeEnterCriticalRegion(); IoCallDriver( device, irp ); + KeLeaveCriticalRegion(); device->CurrentIrp = NULL; } diff --git a/dlls/ntoskrnl.exe/tests/driver.c b/dlls/ntoskrnl.exe/tests/driver.c index 69a7d78657d..b61e970b0aa 100644 --- a/dlls/ntoskrnl.exe/tests/driver.c +++ b/dlls/ntoskrnl.exe/tests/driver.c @@ -386,7 +386,6 @@ static void test_critical_region(BOOL is_dispatcher) KeLeaveCriticalRegion(); result = KeAreApcsDisabled(); - todo_wine_if(is_dispatcher) ok(result == is_dispatcher || broken(is_dispatcher && !result), "KeAreApcsDisabled returned %x\n", result); }