mirror of
https://github.com/reactos/reactos.git
synced 2025-06-25 03:39:44 +00:00
[RTL][KERNEL32][ROSAUTOTEST] Disable debug prompts during autotest
This fixes timeouts + reboots for user mode assertion failures on the testbots. As a bonus it now shows a backtrace.
This commit is contained in:
parent
301675c112
commit
fd3c571d36
4 changed files with 53 additions and 1 deletions
|
@ -1628,6 +1628,12 @@ FatalExit(IN int ExitCode)
|
||||||
CHAR Action[2];
|
CHAR Action[2];
|
||||||
DbgPrint("FatalExit...\n\n");
|
DbgPrint("FatalExit...\n\n");
|
||||||
|
|
||||||
|
/* Check for reactos specific flag (set by rosautotest) */
|
||||||
|
if (RtlGetNtGlobalFlags() & FLG_DISABLE_DEBUG_PROMPTS)
|
||||||
|
{
|
||||||
|
RtlRaiseStatus(STATUS_FATAL_APP_EXIT);
|
||||||
|
}
|
||||||
|
|
||||||
while (TRUE)
|
while (TRUE)
|
||||||
{
|
{
|
||||||
DbgPrompt("A (Abort), B (Break), I (Ignore)? ", Action, sizeof(Action));
|
DbgPrompt("A (Abort), B (Break), I (Ignore)? ", Action, sizeof(Action));
|
||||||
|
|
|
@ -7,6 +7,8 @@
|
||||||
|
|
||||||
#include "precomp.h"
|
#include "precomp.h"
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
#include <ndk/setypes.h>
|
||||||
|
#include <ndk/exfuncs.h>
|
||||||
|
|
||||||
CConfiguration Configuration;
|
CConfiguration Configuration;
|
||||||
|
|
||||||
|
@ -43,6 +45,41 @@ IntPrintUsage()
|
||||||
<< " The test to be run. Needs to be a test of the specified module." << endl;
|
<< " The test to be run. Needs to be a test of the specified module." << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static
|
||||||
|
VOID
|
||||||
|
SetNtGlobalFlags()
|
||||||
|
{
|
||||||
|
ULONG NtGlobalFlags = 0;
|
||||||
|
BOOLEAN PrivilegeEnabled;
|
||||||
|
NTSTATUS Status;
|
||||||
|
|
||||||
|
/* Enable SeDebugPrivilege */
|
||||||
|
Status = RtlAdjustPrivilege(SE_DEBUG_PRIVILEGE, TRUE, FALSE, &PrivilegeEnabled);
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
DbgPrint("Failed to enable SeDebugPrivilege: 0x%08lx\n", Status);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Get current NtGlobalFlags */
|
||||||
|
Status = NtQuerySystemInformation(SystemFlagsInformation, &NtGlobalFlags, sizeof(NtGlobalFlags), NULL);
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
DbgPrint("Failed to get NtGlobalFlags: 0x%08lx\n", Status);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Disable debug prompts */
|
||||||
|
NtGlobalFlags |= FLG_DISABLE_DEBUG_PROMPTS;
|
||||||
|
|
||||||
|
/* Set new NtGlobalFlags */
|
||||||
|
Status = NtSetSystemInformation(SystemFlagsInformation, &NtGlobalFlags, sizeof(NtGlobalFlags));
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
DbgPrint("Failed to set NtGlobalFlags: 0x%08lx\n", Status);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Main entry point
|
* Main entry point
|
||||||
*/
|
*/
|
||||||
|
@ -51,6 +88,8 @@ wmain(int argc, wchar_t* argv[])
|
||||||
{
|
{
|
||||||
int ReturnValue = 1;
|
int ReturnValue = 1;
|
||||||
|
|
||||||
|
SetNtGlobalFlags();
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
stringstream ss;
|
stringstream ss;
|
||||||
|
|
|
@ -83,7 +83,8 @@ extern POBJECT_TYPE NTSYSAPI PsJobType;
|
||||||
#define FLG_ENABLE_HANDLE_TYPE_TAGGING 0x01000000
|
#define FLG_ENABLE_HANDLE_TYPE_TAGGING 0x01000000
|
||||||
#define FLG_HEAP_PAGE_ALLOCS 0x02000000
|
#define FLG_HEAP_PAGE_ALLOCS 0x02000000
|
||||||
#define FLG_DEBUG_INITIAL_COMMAND_EX 0x04000000
|
#define FLG_DEBUG_INITIAL_COMMAND_EX 0x04000000
|
||||||
#define FLG_VALID_BITS 0x07FFFFFF
|
#define FLG_DISABLE_DEBUG_PROMPTS 0x08000000 // ReactOS-specific
|
||||||
|
#define FLG_VALID_BITS 0x0FFFFFFF
|
||||||
|
|
||||||
//
|
//
|
||||||
// Flags for NtCreateProcessEx
|
// Flags for NtCreateProcessEx
|
||||||
|
|
|
@ -42,6 +42,12 @@ RtlAssert(IN PVOID FailedAssertion,
|
||||||
(PSTR)FileName,
|
(PSTR)FileName,
|
||||||
LineNumber);
|
LineNumber);
|
||||||
|
|
||||||
|
/* Check for reactos specific flag (set by rosautotest) */
|
||||||
|
if (RtlGetNtGlobalFlags() & FLG_DISABLE_DEBUG_PROMPTS)
|
||||||
|
{
|
||||||
|
RtlRaiseStatus(STATUS_ASSERTION_FAILURE);
|
||||||
|
}
|
||||||
|
|
||||||
/* Prompt for action */
|
/* Prompt for action */
|
||||||
DbgPrompt("Break repeatedly, break Once, Ignore, "
|
DbgPrompt("Break repeatedly, break Once, Ignore, "
|
||||||
"terminate Process or terminate Thread (boipt)? ",
|
"terminate Process or terminate Thread (boipt)? ",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue