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
)
31 /* Capture caller's context for the debugger */
32 RtlCaptureContext(&Context
);
34 /* Enter prompt loop */
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
,
45 /* Prompt for action */
46 DbgPrompt("Break repeatedly, break Once, Ignore,"
47 " terminate Process or terminate Thread (boipt)? ",
52 /* Break repeatedly */
55 /* Do a breakpoint, then prompt again */
56 DbgPrint("Execute '.cxr %p' to dump context\n", &Context
);
63 /* Return to caller */
69 /* Do a breakpoint and return */
70 DbgPrint("Execute '.cxr %p' to dump context\n", &Context
);
74 /* Terminate process*/
78 ZwTerminateProcess(ZwCurrentProcess(), STATUS_UNSUCCESSFUL
);
81 /* Terminate thread */
85 ZwTerminateThread(ZwCurrentThread(), STATUS_UNSUCCESSFUL
);
96 /* Shouldn't get here */
98 ZwTerminateProcess(ZwCurrentProcess(), STATUS_UNSUCCESSFUL
);