ReactOS 0.4.16-dev-2110-ge3521eb
abort.cpp File Reference
#include <corecrt_internal.h>
#include <signal.h>
#include <stdlib.h>
Include dependency graph for abort.cpp:

Go to the source code of this file.

Macros

#define _INIT_ABORT_BEHAVIOR   _CALL_REPORTFAULT
 

Functions

void __cdecl abort ()
 Aborts the program.
 
unsigned int __cdecl _set_abort_behavior (unsigned int flags, unsigned int mask)
 Specifies the behavior of the abort() function.
 

Variables

unsigned int __abort_behavior = _INIT_ABORT_BEHAVIOR
 

Macro Definition Documentation

◆ _INIT_ABORT_BEHAVIOR

#define _INIT_ABORT_BEHAVIOR   _CALL_REPORTFAULT

Definition at line 18 of file abort.cpp.

Function Documentation

◆ _set_abort_behavior()

unsigned int __cdecl _set_abort_behavior ( unsigned int  flags,
unsigned int  mask 
)

Specifies the behavior of the abort() function.

Parameters
flags- Value of the new flags.
mask- Mask that specifies which flags to update.
Returns
The old flags value.

Definition at line 109 of file abort.cpp.

110{
111 unsigned int oldflags = __abort_behavior;
112 __abort_behavior = oldflags & (~mask) | flags & mask;
113 return oldflags;
114}
unsigned int __abort_behavior
Definition: abort.cpp:21
GLenum GLint GLuint mask
Definition: glext.h:6028
GLbitfield flags
Definition: glext.h:7161

Referenced by _assert().

◆ abort()

void __cdecl abort ( void  )

Aborts the program.

Note
The function does not return.
Todo:
unimplemented

Definition at line 46 of file abort.cpp.

47{
48 #ifdef _DEBUG
50 {
51 __acrt_report_runtime_error(L"abort() has been called");
52 }
53 #endif
54
55
56 /* Check if the user installed a handler for SIGABRT.
57 * We need to read the user handler atomically in the case
58 * another thread is aborting while we change the signal
59 * handler.
60 */
62 if (sigabrt_action != SIG_DFL)
63 {
65 }
66
67 /* If there is no user handler for SIGABRT or if the user
68 * handler returns, then exit from the program anyway
69 */
70
72 {
73 #if defined _M_ARM || defined _M_ARM64 || defined _M_ARM64EC || defined _UCRT_ENCLAVE_BUILD
75 #else
78
80 #endif
81 }
82
83
84 /* If we don't want to call ReportFault, then we call _exit(3), which is the
85 * same as invoking the default handler for SIGABRT
86 */
87
88
89 _exit(3);
90}
void(__cdecl * __crt_signal_handler_t)(int)
__crt_signal_handler_t __cdecl __acrt_get_sigabrt_handler(void)
Definition: signal.cpp:564
void __cdecl __acrt_call_reportfault(int nDbgHookCode, DWORD dwExceptionCode, DWORD dwExceptionFlags)
void __cdecl __acrt_report_runtime_error(_In_z_ wchar_t const *message)
BOOL WINAPI IsProcessorFeaturePresent(IN DWORD ProcessorFeature)
Definition: sysinfo.c:169
int CDECL raise(int sig)
Definition: except.c:682
void CDECL _exit(int exitcode)
Definition: exit.c:187
#define SIG_DFL
Definition: signal.h:41
#define SIGABRT
Definition: signal.h:31
#define _CALL_REPORTFAULT
Definition: stdlib.h:80
#define _WRITE_ABORT_MSG
Definition: stdlib.h:79
#define L(x)
Definition: resources.c:13
#define _CRT_DEBUGGER_ABORT
__fastfail(FAST_FAIL_INVALID_ARG)
#define STATUS_FATAL_APP_EXIT
Definition: ntstatus.h:210
#define EXCEPTION_NONCONTINUABLE
Definition: stubs.h:23
#define PF_FASTFAIL_AVAILABLE
Definition: ketypes.h:199
#define FAST_FAIL_FATAL_APP_EXIT

Variable Documentation

◆ __abort_behavior

unsigned int __abort_behavior = _INIT_ABORT_BEHAVIOR

Definition at line 21 of file abort.cpp.

Referenced by _set_abort_behavior(), and abort().