diff --git a/sdk/lib/rtl/debug.c b/sdk/lib/rtl/debug.c index 0f9b2cc32ad..3c0be055496 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; }