2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS Run-Time Library
4 * PURPOSE: Implements RtlAssert used by the ASSERT
5 * and ASSERTMSG debugging macros
6 * FILE: lib/rtl/assert.c
7 * PROGRAMERS: Stefan Ginsberg (stefan.ginsberg@reactos.org)
10 /* INCLUDES *****************************************************************/
16 /* PUBLIC FUNCTIONS **********************************************************/
23 RtlAssert(IN PVOID FailedAssertion
,
26 IN PCHAR Message OPTIONAL
)
28 #if 0 // Disabled until sysreg can handle debug prompts
32 /* Capture caller's context for the debugger */
33 RtlCaptureContext(&Context
);
35 /* Enter prompt loop */
38 /* Print the assertion */
39 DbgPrint("\n*** Assertion failed: %s%s\n"
40 "*** Source File: %s, line %ld\n\n",
41 Message
!= NULL
? Message
: "",
42 (PSTR
)FailedAssertion
,
46 /* Prompt for action */
47 DbgPrompt("Break repeatedly, break Once, Ignore,"
48 " terminate Process or terminate Thread (boipt)? ",
53 /* Break repeatedly */
56 /* Do a breakpoint, then prompt again */
57 DbgPrint("Execute '.cxr %p' to dump context\n", &Context
);
64 /* Return to caller */
70 /* Do a breakpoint and return */
71 DbgPrint("Execute '.cxr %p' to dump context\n", &Context
);
75 /* Terminate process*/
79 ZwTerminateProcess(ZwCurrentProcess(), STATUS_UNSUCCESSFUL
);
82 /* Terminate thread */
86 ZwTerminateThread(ZwCurrentThread(), STATUS_UNSUCCESSFUL
);
97 /* Shouldn't get here */
99 ZwTerminateProcess(ZwCurrentProcess(), STATUS_UNSUCCESSFUL
);
103 DbgPrint("Assertion \'%s\' failed at %s line %u: %s\n",
104 (PCHAR
)FailedAssertion
,
111 DbgPrint("Assertion \'%s\' failed at %s line %u\n",
112 (PCHAR
)FailedAssertion
,