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

commit db8488e5cacc8d0ecb3bb0fec7b7f68ad235165d
Author:     Mark Jansen <[email protected]>
AuthorDate: Fri Jan 4 21:55:38 2019 +0100
Commit:     Mark Jansen <[email protected]>
CommitDate: Sat Jan 5 15:21:40 2019 +0100

    [SDK] Reset InDbgPrint state when an exception occurs
    Previously this would not get reset, and all debug prints from the
    current thread would be muted.
---
 sdk/lib/rtl/debug.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/sdk/lib/rtl/debug.c b/sdk/lib/rtl/debug.c
index 0f9b2cc32a..3c0be05549 100644
--- a/sdk/lib/rtl/debug.c
+++ b/sdk/lib/rtl/debug.c
@@ -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;
     }
 

Reply via email to