[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.
This commit is contained in:
Mark Jansen 2019-01-04 21:55:38 +01:00
parent 372363930f
commit db8488e5ca
No known key found for this signature in database
GPG key ID: B39240EE84BEAE8B

View file

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