STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
corecrt_startup.h
Go to the documentation of this file.
1 //
2 // corecrt_startup.h
3 //
4 // Copyright (c) Microsoft Corporation. All rights reserved.
5 //
6 // Declarations for the CoreCRT startup functionality, used while initializing
7 // the CRT and during app startup and termination.
8 //
9 #pragma once
10 
11 #include <corecrt.h>
12 #include <math.h>
13 #include <vcruntime_startup.h>
14 
16 
17 
18 
19 //-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
20 //
21 // Exception Filters for main() and DllMain()
22 //
23 //-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
24 struct _EXCEPTION_POINTERS;
25 
26 _ACRTIMP int __cdecl _seh_filter_dll(
27  _In_ unsigned long _ExceptionNum,
28  _In_ struct _EXCEPTION_POINTERS* _ExceptionPtr
29  );
30 
31 _ACRTIMP int __cdecl _seh_filter_exe(
32  _In_ unsigned long _ExceptionNum,
33  _In_ struct _EXCEPTION_POINTERS* _ExceptionPtr
34  );
35 
36 
37 
38 //-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
39 //
40 // Miscellaneous Runtime Support
41 //
42 //-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
43 typedef enum _crt_app_type
44 {
49 
51 
52 _ACRTIMP void __cdecl _set_app_type(
54  );
55 
56 typedef int (__cdecl *_UserMathErrorFunctionPointer)(struct _exception *);
57 
58 _ACRTIMP void __cdecl __setusermatherr(
59  _UserMathErrorFunctionPointer _UserMathErrorFunction
60  );
61 
62 int __cdecl _is_c_termination_complete(void);
63 
64 
65 
66 //-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
67 //
68 // Arguments API for main() et al.
69 //
70 //-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
72  _In_ _crt_argv_mode mode
73  );
74 
76  _In_ _crt_argv_mode mode
77  );
78 
79 // There is a linkopt for these to disable environment initialization when using
80 // the static CRT, so they are not declared _ACRTIMP.
83 
84 _ACRTIMP char** __cdecl _get_initial_narrow_environment(void);
85 _ACRTIMP wchar_t** __cdecl _get_initial_wide_environment(void);
86 
89 
90 _ACRTIMP char** __cdecl __p__acmdln(void);
91 _ACRTIMP wchar_t** __cdecl __p__wcmdln(void);
92 
93 #ifdef _CRT_DECLARE_GLOBAL_VARIABLES_DIRECTLY
94  extern char* _acmdln;
95  extern wchar_t* _wcmdln;
96 #else
97  #define _acmdln (*__p__acmdln())
98  #define _wcmdln (*__p__wcmdln())
99 #endif
100 
101 
102 
103 //-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
104 //
105 // Initializer and Terminator Support
106 //
107 //-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
108 typedef void (__cdecl* _PVFV)(void);
109 typedef int (__cdecl* _PIFV)(void);
110 typedef void (__cdecl* _PVFI)(int);
111 
112 #ifndef _M_CEE
113  _ACRTIMP void __cdecl _initterm(
114  _In_reads_(_Last - _First) _In_ _PVFV* _First,
115  _In_ _PVFV* _Last
116  );
117 
118  _ACRTIMP int __cdecl _initterm_e(
119  _In_reads_(_Last - _First) _PIFV* _First,
120  _In_ _PIFV* _Last
121  );
122 #endif
123 
124 #ifndef _CRT_ONEXIT_T_DEFINED
125  #define _CRT_ONEXIT_T_DEFINED
126 
128  #ifdef _M_CEE
129  typedef int (__clrcall* _onexit_m_t)(void);
130  #endif
131 #endif
132 
133 typedef struct _onexit_table_t
134 {
139 
141  _In_opt_ _onexit_table_t* _Table
142  );
143 
145  _In_opt_ _onexit_table_t* _Table,
146  _In_opt_ _onexit_t _Function
147  );
148 
149 _ACRTIMP int __cdecl _execute_onexit_table(
150  _In_opt_ _onexit_table_t* _Table
151  );
152 
153 _ACRTIMP int __cdecl _crt_atexit(
154  _In_opt_ _PVFV _Function
155  );
156 
157 _ACRTIMP int __cdecl _crt_at_quick_exit(
158  _In_opt_ _PVFV _Function
159  );
160 
161 
162 
163 //-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
164 //
165 // Static CRT Initialization Support
166 //
167 //-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
168 #if _CRT_FUNCTIONS_REQUIRED
169 
170  _Success_(return != 0)
171  __crt_bool __cdecl __acrt_initialize(void);
172 
173  _Success_(return != 0)
174  __crt_bool __cdecl __acrt_uninitialize(
175  _In_ __crt_bool _Terminating
176  );
177 
178  _Success_(return != 0)
179  __crt_bool __cdecl __acrt_uninitialize_critical(
180  _In_ __crt_bool _Terminating
181  );
182 
183  _Success_(return != 0)
184  __crt_bool __cdecl __acrt_thread_attach(void);
185 
186  _Success_(return != 0)
187  __crt_bool __cdecl __acrt_thread_detach(void);
188 
189 #endif // _CRT_FUNCTIONS_REQUIRED
190 
191 
192 
_PVFV * _end
Definition: corecrt_startup.h:137
_ACRTIMP char **__cdecl __p__acmdln(void)
return
Definition: corecrt_memcpy_s.h:60
wchar_t *__CRTDECL _get_wide_winmain_command_line(void)
_ACRTIMP void __cdecl _set_app_type(_In_ _crt_app_type _Type)
#define _ACRTIMP
Definition: corecrt.h:27
_PVFV * _first
Definition: corecrt_startup.h:135
_ACRTIMP int __cdecl _crt_atexit(_In_opt_ _PVFV _Function)
_ACRTIMP char **__cdecl _get_initial_narrow_environment(void)
_ACRTIMP int __cdecl _crt_at_quick_exit(_In_opt_ _PVFV _Function)
struct _onexit_table_t _onexit_table_t
_ACRTIMP errno_t __cdecl _configure_wide_argv(_In_ _crt_argv_mode mode)
_ACRTIMP void __cdecl _initterm(_In_reads_(_Last-_First) _In_ _PVFV *_First, _In_ _PVFV *_Last)
char *__CRTDECL _get_narrow_winmain_command_line(void)
_Success_(return!=0) __crt_bool __cdecl __acrt_initialize(void)
_Bool __crt_bool
Definition: corecrt.h:139
_ACRTIMP int __cdecl _initterm_e(_In_reads_(_Last-_First) _PIFV *_First, _In_ _PIFV *_Last)
int(__cdecl * _PIFV)(void)
Definition: corecrt_startup.h:109
_ACRTIMP int __cdecl _initialize_onexit_table(_In_opt_ _onexit_table_t *_Table)
int errno_t
Definition: corecrt.h:476
_PVFV * _last
Definition: corecrt_startup.h:136
Definition: corecrt_startup.h:133
int __CRTDECL _initialize_wide_environment(void)
#define _CRT_BEGIN_C_HEADER
Definition: vcruntime.h:73
_ACRTIMP int __cdecl _seh_filter_dll(_In_ unsigned long _ExceptionNum, _In_ struct _EXCEPTION_POINTERS *_ExceptionPtr)
_ACRTIMP int __cdecl _seh_filter_exe(_In_ unsigned long _ExceptionNum, _In_ struct _EXCEPTION_POINTERS *_ExceptionPtr)
_ACRTIMP _crt_app_type __cdecl _query_app_type(void)
void(__cdecl * _PVFV)(void)
Definition: corecrt_startup.h:108
int __cdecl _is_c_termination_complete(void)
#define __CRTDECL
Definition: vcruntime.h:156
#define _In_
Definition: sal.h:305
_In_ wctype_t _Type
Definition: corecrt_wctype.h:111
#define _acmdln
Definition: corecrt_startup.h:97
#define _In_opt_
Definition: sal.h:306
_ACRTIMP int __cdecl _execute_onexit_table(_In_opt_ _onexit_table_t *_Table)
_crt_argv_mode
Definition: vcruntime_startup.h:16
int(__CRTDECL * _onexit_t)(void)
Definition: corecrt_startup.h:127
#define _wcmdln
Definition: corecrt_startup.h:98
_CRT_BEGIN_C_HEADER typedef void(__CRTDECL *terminate_handler)()
char int *typedef int(__CRTDECL *_CRT_REPORT_HOOKW)(int
Definition: crtdbg.h:45
_ACRTIMP errno_t __cdecl _configure_narrow_argv(_In_ _crt_argv_mode mode)
Definition: corecrt_startup.h:45
_In_reads_(_N) wchar_t const *_S2
_ACRTIMP wchar_t **__cdecl __p__wcmdln(void)
_crt_app_type
Definition: corecrt_startup.h:43
#define _CRT_END_C_HEADER
Definition: vcruntime.h:76
void(__cdecl * _PVFI)(int)
Definition: corecrt_startup.h:110
int __CRTDECL _initialize_narrow_environment(void)
_ACRTIMP void __cdecl __setusermatherr(_UserMathErrorFunctionPointer _UserMathErrorFunction)
Definition: corecrt_math.h:24
_ACRTIMP int __cdecl _register_onexit_function(_In_opt_ _onexit_table_t *_Table, _In_opt_ _onexit_t _Function)
Definition: corecrt_startup.h:47
Definition: corecrt_startup.h:46
_ACRTIMP wchar_t **__cdecl _get_initial_wide_environment(void)
int(__cdecl * _UserMathErrorFunctionPointer)(struct _exception *)
Definition: corecrt_startup.h:56
_FwdIt _Last
Definition: algorithm:1936