ReactOS 0.4.16-dev-117-g38f21f9
assert.c File Reference
#include <rtl.h>
#include <debug.h>
Include dependency graph for assert.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

VOID NTAPI RtlAssert (IN PVOID FailedAssertion, IN PVOID FileName, IN ULONG LineNumber, IN PCHAR Message OPTIONAL)
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 13 of file assert.c.

Function Documentation

◆ RtlAssert()

VOID NTAPI RtlAssert ( IN PVOID  FailedAssertion,
IN PVOID  FileName,
IN ULONG  LineNumber,
IN PCHAR Message  OPTIONAL 
)

Definition at line 23 of file assert.c.

27{
28 CHAR Action[2];
30
31 /* Capture caller's context for the debugger */
33
34 /* Enter prompt loop */
35 for (;;)
36 {
37 /* Print the assertion */
38 DbgPrint("\n*** Assertion failed: %s%s\n"
39 "*** Source File: %s, line %lu\n\n",
40 Message != NULL ? Message : "",
41 (PSTR)FailedAssertion,
44
45 /* Check for reactos specific flag (set by rosautotest) */
47 {
49 }
50
51 /* Prompt for action */
52 DbgPrompt("Break repeatedly, break Once, Ignore, "
53 "terminate Process or terminate Thread (boipt)? ",
54 Action,
55 sizeof(Action));
56 switch (Action[0])
57 {
58 /* Break repeatedly / Break once */
59 case 'B': case 'b':
60 case 'O': case 'o':
61 DbgPrint("Execute '.cxr %p' to dump context\n", &Context);
62 /* Do a breakpoint, then prompt again or return */
64 if ((Action[0] == 'B') || (Action[0] == 'b'))
65 break;
66 /* else ('O','o'): fall through */
67
68 /* Ignore: Return to caller */
69 case 'I': case 'i':
70 return;
71
72 /* Terminate current process */
73 case 'P': case 'p':
74 ZwTerminateProcess(ZwCurrentProcess(), STATUS_UNSUCCESSFUL);
75 break;
76
77 /* Terminate current thread */
78 case 'T': case 't':
80 break;
81
82 /* Unrecognized: Prompt again */
83 default:
84 break;
85 }
86 }
87
88 /* Shouldn't get here */
90 ZwTerminateProcess(ZwCurrentProcess(), STATUS_UNSUCCESSFUL);
91}
ACPI_BUFFER *RetBuffer ACPI_BUFFER *RetBuffer char ACPI_WALK_RESOURCE_CALLBACK void *Context ACPI_BUFFER *RetBuffer UINT16 ACPI_RESOURCE **ResourcePtr ACPI_GENERIC_ADDRESS *Reg UINT32 *ReturnValue UINT8 UINT8 *Slp_TypB ACPI_PHYSICAL_ADDRESS PhysicalAddress64 UINT32 UINT32 *TimeElapsed UINT32 LineNumber
Definition: acpixf.h:1220
#define NULL
Definition: types.h:112
static const WCHAR Message[]
Definition: register.c:74
#define DbgPrint
Definition: hal.h:12
#define FLG_DISABLE_DEBUG_PROMPTS
Definition: pstypes.h:86
NTSYSAPI void WINAPI DbgBreakPoint(void)
NTSYSAPI ULONG WINAPI RtlGetNtGlobalFlags(void)
Definition: libsupp.c:95
NTSYSAPI NTSTATUS NTAPI ZwTerminateThread(_In_ HANDLE ThreadHandle, _In_ NTSTATUS ExitStatus)
DECLSPEC_NORETURN NTSYSAPI VOID NTAPI RtlRaiseStatus(_In_ NTSTATUS Status)
NTSYSAPI ULONG NTAPI DbgPrompt(_In_z_ PCCH Prompt, _Out_writes_bytes_(MaximumResponseLength) PCH Response, _In_ ULONG MaximumResponseLength)
NTSYSAPI VOID NTAPI RtlCaptureContext(_Out_ PCONTEXT ContextRecord)
#define STATUS_ASSERTION_FAILURE
Definition: ntstatus.h:960
char * PSTR
Definition: typedefs.h:51
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
_In_ WDFIOTARGET _In_ _Strict_type_match_ WDF_IO_TARGET_SENT_IO_ACTION Action
Definition: wdfiotarget.h:510
char CHAR
Definition: xmlstorage.h:175
#define ZwCurrentThread()
#define ZwCurrentProcess()