ReactOS 0.4.16-dev-927-g467dec4
terminate.cpp File Reference
Include dependency graph for terminate.cpp:

Go to the source code of this file.

Functions

static terminate_handler __cdecl get_terminate_or_default (__acrt_ptd const *const ptd) throw ()
 
terminate_handler __cdecl _get_terminate ()
 
terminate_handler __cdecl set_terminate (terminate_handler const new_handler) throw ()
 
void __cdecl terminate () throw ()
 

Function Documentation

◆ _get_terminate()

terminate_handler __cdecl _get_terminate ( void  )

Definition at line 20 of file terminate.cpp.

21{
23}
__acrt_ptd *__cdecl __acrt_getptd(void)
static terminate_handler __cdecl get_terminate_or_default(__acrt_ptd const *const ptd)
Definition: terminate.cpp:13

◆ get_terminate_or_default()

static terminate_handler __cdecl get_terminate_or_default ( __acrt_ptd const *const  ptd)
throw (
)
static

Definition at line 13 of file terminate.cpp.

16{
17 return ptd->_terminate ? ptd->_terminate : &abort;
18}
_In_ size_t const _In_ int _In_ bool const _In_ unsigned const _In_ __acrt_rounding_mode const _Inout_ __crt_cached_ptd_host & ptd
Definition: cvt.cpp:355
#define abort()
Definition: i386-dis.c:34

Referenced by _get_terminate(), and set_terminate().

◆ set_terminate()

terminate_handler __cdecl set_terminate ( terminate_handler const  new_handler)
throw (
)

Definition at line 25 of file terminate.cpp.

28{
29 __acrt_ptd* const ptd = __acrt_getptd();
30
32
33 ptd->_terminate = new_handler;
34
35 return old_handler;
36}
void(__cdecl * terminate_handler)(void)
Definition: eh.h:24

◆ terminate()

void __cdecl terminate ( void  )
throw (
)

Definition at line 38 of file terminate.cpp.

39{
41 if (handler)
42 {
43 // Note: We cannot allow any exceptions to propagate from a user-
44 // registered terminate handler, so if any structured exception escapes
45 // the user handler we abort.
46 __try
47 {
48 handler();
49 }
51 {
52 ; // Deliberately do nothing
53 }
55 }
56
57 // If the terminate handler returned, faulted, or otherwise failed to end
58 // execution, we will do it:
59 abort();
60}
UINT(* handler)(MSIPACKAGE *)
Definition: action.c:7512
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:90
#define __try
Definition: pseh2_64.h:188
#define __except
Definition: pseh2_64.h:189
#define __endtry
Definition: pseh2_64.h:191
terminate_handler _terminate

Referenced by __std_terminate(), _register_thread_local_exe_atexit_callback(), common_exit(), FromBase64(), sinc_hex_vari_process(), sinc_mono_vari_process(), sinc_multichan_vari_process(), sinc_quad_vari_process(), sinc_stereo_vari_process(), ToBase64(), WaveThread(), and xsltMessage().