[NTOS:EX] Worker threads must not exit with a critical region held. CORE-13734
authorThomas Faber <thomas.faber@reactos.org>
Wed, 7 Mar 2018 10:02:55 +0000 (11:02 +0100)
committerThomas Faber <thomas.faber@reactos.org>
Wed, 7 Mar 2018 12:18:09 +0000 (13:18 +0100)
ntoskrnl/ex/work.c

index 731f442..24d328a 100644 (file)
@@ -162,7 +162,7 @@ ProcessLoop:
         WorkItem->WorkerRoutine(WorkItem->Parameter);
 
         /* Make sure APCs are not disabled */
-        if (Thread->Tcb.SpecialApcDisable)
+        if (Thread->Tcb.CombinedApcDisable != 0)
         {
             /* We're nice and do it behind your back */
             DPRINT1("Warning: Broken Worker Thread: %p %p %p came back "
@@ -170,7 +170,8 @@ ProcessLoop:
                     WorkItem->WorkerRoutine,
                     WorkItem->Parameter,
                     WorkItem);
-            Thread->Tcb.SpecialApcDisable = 0;
+            ASSERT(Thread->Tcb.CombinedApcDisable == 0);
+            Thread->Tcb.CombinedApcDisable = 0;
         }
 
         /* Make sure it returned at right IRQL */