[SDK] Reset InDbgPrint state when an exception occurs 1220/head
authorMark Jansen <mark.jansen@reactos.org>
Fri, 4 Jan 2019 20:55:38 +0000 (21:55 +0100)
committerMark Jansen <mark.jansen@reactos.org>
Sat, 5 Jan 2019 14:21:40 +0000 (15:21 +0100)
Previously this would not get reset, and all debug prints from the
current thread would be muted.

sdk/lib/rtl/debug.c

index 0f9b2cc..3c0be05 100644 (file)
@@ -91,6 +91,8 @@ vDbgPrintExWithPrefixInternal(IN PCCH Prefix,
     }
     _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
     {
+        /* In user-mode, clear the InDbgPrint Flag */
+        RtlpClearInDbgPrint();
         /* Fail */
         _SEH2_YIELD(return _SEH2_GetExceptionCode());
     }
@@ -129,8 +131,8 @@ vDbgPrintExWithPrefixInternal(IN PCCH Prefix,
         /* Raise the exception */
         RtlRaiseException(&ExceptionRecord);
 
-        /* This code only runs in user-mode, so setting the flag is safe */
-        NtCurrentTeb()->InDbgPrint = FALSE;
+        /* In user-mode, clear the InDbgPrint Flag */
+        RtlpClearInDbgPrint();
         return STATUS_SUCCESS;
     }