https://git.reactos.org/?p=reactos.git;a=commitdiff;h=2b8f4f6e244dcd83875564f72d8320c687a3a240

commit 2b8f4f6e244dcd83875564f72d8320c687a3a240
Author:     Thomas Faber <thomas.fa...@reactos.org>
AuthorDate: Wed Mar 7 11:02:55 2018 +0100
Commit:     Thomas Faber <thomas.fa...@reactos.org>
CommitDate: Wed Mar 7 13:18:09 2018 +0100

    [NTOS:EX] Worker threads must not exit with a critical region held. 
CORE-13734
---
 ntoskrnl/ex/work.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/ntoskrnl/ex/work.c b/ntoskrnl/ex/work.c
index 731f442a85..24d328abc0 100644
--- a/ntoskrnl/ex/work.c
+++ b/ntoskrnl/ex/work.c
@@ -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 */

Reply via email to