1
0
Fork 0

Print the NTSTATUS name next to the process exit code

See #2874
This commit is contained in:
Duncan Ogilvie 2022-05-18 12:35:25 +02:00
parent 101f4ae569
commit c7aeda7965
1 changed files with 12 additions and 1 deletions

View File

@ -1546,7 +1546,18 @@ static void cbCreateProcess(CREATE_PROCESS_DEBUG_INFO* CreateProcessInfo)
static void cbExitProcess(EXIT_PROCESS_DEBUG_INFO* ExitProcess)
{
dprintf(QT_TRANSLATE_NOOP("DBG", "Process stopped with exit code 0x%X\n"), ExitProcess->dwExitCode);
{
auto exitCode = ExitProcess->dwExitCode;
auto exitDescription = StringUtils::sprintf("0x%X (%d)", exitCode, exitCode);
if((exitCode & 0x80000000) != 0)
{
auto statusName = NtStatusCodeToName(exitCode);
if(!statusName.empty())
exitDescription = StringUtils::sprintf("0x%X (%s)", exitCode, statusName.c_str());
}
dprintf(QT_TRANSLATE_NOOP("DBG", "Process stopped with exit code %s\n"), exitDescription.c_str());
}
const bool breakHere = settingboolget("Events", "NtTerminateProcess");
if(breakHere)
{