[KERNEL32][NTOS:PS][RTL] Cleanup some DbgPrompt() calls.

This commit is contained in:
Hermès Bélusca-Maïto 2022-11-27 19:11:29 +01:00
parent 51b4a38ab7
commit 1b25fe161c
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0
3 changed files with 22 additions and 40 deletions

View file

@ -1625,14 +1625,13 @@ FatalExit(IN int ExitCode)
{
#if DBG
/* On Checked builds, Windows gives the user a nice little debugger UI */
CHAR ch[2];
DbgPrint("FatalExit...\n");
DbgPrint("\n");
CHAR Action[2];
DbgPrint("FatalExit...\n\n");
while (TRUE)
{
DbgPrompt( "A (Abort), B (Break), I (Ignore)? ", ch, sizeof(ch));
switch (ch[0])
DbgPrompt("A (Abort), B (Break), I (Ignore)? ", Action, sizeof(Action));
switch (Action[0])
{
case 'B': case 'b':
DbgBreakPoint();

View file

@ -42,23 +42,20 @@ PspCatchCriticalBreak(IN PCHAR Message,
/* If a debugger isn't present, don't prompt */
if (KdDebuggerNotPresent) break;
/* A debuger is active, prompt for action */
DbgPrompt("Break, or Ignore (bi)?", Action, sizeof(Action));
/* A debugger is active, prompt for action */
DbgPrompt("Break, or Ignore (bi)? ", Action, sizeof(Action));
switch (Action[0])
{
/* Break */
case 'B': case 'b':
/* Do a breakpoint */
DbgBreakPoint();
/* Fall through */
/* Ignore */
/* Ignore: Handle it */
case 'I': case 'i':
/* Handle it */
Handled = TRUE;
/* Unrecognized */
/* Unrecognized: Prompt again */
default:
break;
}

View file

@ -43,52 +43,38 @@ RtlAssert(IN PVOID FailedAssertion,
LineNumber);
/* Prompt for action */
DbgPrompt("Break repeatedly, break Once, Ignore,"
" terminate Process or terminate Thread (boipt)? ",
DbgPrompt("Break repeatedly, break Once, Ignore, "
"terminate Process or terminate Thread (boipt)? ",
Action,
sizeof(Action));
switch (Action[0])
{
/* Break repeatedly */
/* Break repeatedly / Break once */
case 'B': case 'b':
/* Do a breakpoint, then prompt again */
DbgPrint("Execute '.cxr %p' to dump context\n", &Context);
DbgBreakPoint();
break;
/* Ignore */
case 'I': case 'i':
/* Return to caller */
return;
/* Break once */
case 'O': case 'o':
/* Do a breakpoint and return */
DbgPrint("Execute '.cxr %p' to dump context\n", &Context);
/* Do a breakpoint, then prompt again or return */
DbgBreakPoint();
if ((Action[0] == 'B') || (Action[0] == 'b'))
break;
/* else ('O','o'): fall through */
/* Ignore: Return to caller */
case 'I': case 'i':
return;
/* Terminate process*/
/* Terminate current process */
case 'P': case 'p':
/* Terminate us */
ZwTerminateProcess(ZwCurrentProcess(), STATUS_UNSUCCESSFUL);
break;
/* Terminate thread */
/* Terminate current thread */
case 'T': case 't':
/* Terminate us */
ZwTerminateThread(ZwCurrentThread(), STATUS_UNSUCCESSFUL);
break;
/* Unrecognized */
/* Unrecognized: Prompt again */
default:
/* Prompt again */
break;
}
}