https://git.reactos.org/?p=reactos.git;a=commitdiff;h=1b25fe161caff2806f47b3...
commit 1b25fe161caff2806f47b31f4d467d16861ba648 Author: Hermès Bélusca-Maïto hermes.belusca-maito@reactos.org AuthorDate: Sun Nov 27 19:11:29 2022 +0100 Commit: Hermès Bélusca-Maïto hermes.belusca-maito@reactos.org CommitDate: Fri Jan 6 14:44:49 2023 +0100
[KERNEL32][NTOS:PS][RTL] Cleanup some DbgPrompt() calls. --- dll/win32/kernel32/client/proc.c | 9 ++++----- ntoskrnl/ps/kill.c | 13 +++++-------- sdk/lib/rtl/assert.c | 38 ++++++++++++-------------------------- 3 files changed, 21 insertions(+), 39 deletions(-)
diff --git a/dll/win32/kernel32/client/proc.c b/dll/win32/kernel32/client/proc.c index d2e38355ddd..22f29ca4bba 100644 --- a/dll/win32/kernel32/client/proc.c +++ b/dll/win32/kernel32/client/proc.c @@ -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(); diff --git a/ntoskrnl/ps/kill.c b/ntoskrnl/ps/kill.c index 115768687c4..4a746492486 100644 --- a/ntoskrnl/ps/kill.c +++ b/ntoskrnl/ps/kill.c @@ -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; } diff --git a/sdk/lib/rtl/assert.c b/sdk/lib/rtl/assert.c index 0c6fcaeeefe..6f4facb6239 100644 --- a/sdk/lib/rtl/assert.c +++ b/sdk/lib/rtl/assert.c @@ -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 */ + case 'O': case 'o': DbgPrint("Execute '.cxr %p' to dump context\n", &Context); + /* Do a breakpoint, then prompt again or return */ DbgBreakPoint(); - break; + if ((Action[0] == 'B') || (Action[0] == 'b')) + break; + /* else ('O','o'): fall through */
- /* Ignore */ + /* Ignore: Return to caller */ 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); - DbgBreakPoint(); - 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; } }