Correctly bugcheck if we aren't returning a usermode thread (#506)
authorJason Johnson <jasonmjohnson1@gmail.com>
Tue, 24 Apr 2018 22:07:02 +0000 (18:07 -0400)
committerGed Murphy <gedmurphy@reactos.org>
Tue, 24 Apr 2018 22:07:02 +0000 (23:07 +0100)
Cause a corresponding bug check to occur for the reason of the user context flag being zero (a system thread), instead of using DbgBreakPoint.

ntoskrnl/ke/i386/thrdini.c

index 683ed88..678bedd 100644 (file)
@@ -78,7 +78,10 @@ KiThreadStartup(VOID)
     StartFrame->SystemRoutine(StartFrame->StartRoutine, StartFrame->StartContext);
 
     /* If we returned, we better be a user thread */
-    if (!StartFrame->UserThread) DbgBreakPoint();
+    if (!StartFrame->UserThread)
+    {
+        KeBugCheck(NO_USER_MODE_CONTEXT);
+    }
 
     /* Exit to user-mode */
     KiServiceExit2(TrapFrame);