STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
excpt.h
Go to the documentation of this file.
1 /***
2 *excpt.h - defines exception values, types and routines
3 *
4 * Copyright (c) Microsoft Corporation. All rights reserved.
5 *
6 *Purpose:
7 * This file contains the definitions and prototypes for the compiler-
8 * dependent intrinsics, support functions and keywords which implement
9 * the structured exception handling extensions.
10 *
11 * [Public]
12 *
13 ****/
14 
15 #pragma once
16 
17 #ifndef _INC_EXCPT
18 #define _INC_EXCPT
19 
20 #include <crtdefs.h>
21 
22 /*
23  * Currently, all MS C compilers for Win32 platforms default to 8 byte
24  * alignment.
25  */
26 #pragma pack(push,_CRT_PACKING)
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif /* __cplusplus */
31 
32 /*
33  * Exception disposition return values.
34  */
35 typedef enum _EXCEPTION_DISPOSITION {
41 
42 
43 /*
44  * Prototype for SEH support function.
45  */
46 
47 #ifdef _M_IX86
48 
49 /*
50  * Declarations to keep MS C 8 (386/486) compiler happy
51  */
52 struct _EXCEPTION_RECORD;
53 struct _CONTEXT;
54 
55 EXCEPTION_DISPOSITION __cdecl _except_handler (
56  _In_ struct _EXCEPTION_RECORD *_ExceptionRecord,
57  _In_ void * _EstablisherFrame,
58  _Inout_ struct _CONTEXT *_ContextRecord,
59  _Inout_ void * _DispatcherContext
60  );
61 
62 #elif defined (_M_X64) || defined (_M_ARM)
63 
64 /*
65  * Declarations to keep AMD64 compiler happy
66  */
67 struct _EXCEPTION_RECORD;
68 struct _CONTEXT;
69 struct _DISPATCHER_CONTEXT;
70 
71 #ifndef _M_CEE_PURE
72 
73 _CRTIMP EXCEPTION_DISPOSITION __C_specific_handler (
74  _In_ struct _EXCEPTION_RECORD * ExceptionRecord,
75  _In_ void * EstablisherFrame,
76  _Inout_ struct _CONTEXT * ContextRecord,
77  _Inout_ struct _DISPATCHER_CONTEXT * DispatcherContext
78 );
79 
80 #endif /* _M_CEE_PURE */
81 
82 #endif /* defined (_M_X64) || defined (_M_ARM) */
83 
84 
85 /*
86  * Keywords and intrinsics for SEH
87  */
88 
89 #define GetExceptionCode _exception_code
90 #define exception_code _exception_code
91 #define GetExceptionInformation (struct _EXCEPTION_POINTERS *)_exception_info
92 #define exception_info (struct _EXCEPTION_POINTERS *)_exception_info
93 #define AbnormalTermination _abnormal_termination
94 #define abnormal_termination _abnormal_termination
95 
96 unsigned long __cdecl _exception_code(void);
97 void * __cdecl _exception_info(void);
98 int __cdecl _abnormal_termination(void);
99 
100 
101 /*
102  * Legal values for expression in except().
103  */
104 
105 #define EXCEPTION_EXECUTE_HANDLER 1
106 #define EXCEPTION_CONTINUE_SEARCH 0
107 #define EXCEPTION_CONTINUE_EXECUTION -1
108 
109 #ifdef _CRTBLD
110 /*
111  * for convenience, define a type name for a pointer to signal-handler
112  */
113 
114 typedef void (__cdecl * _PHNDLR)(int);
115 
116 /*
117  * Exception-action table used by the C runtime to identify and dispose of
118  * exceptions corresponding to C runtime errors or C signals.
119  */
120 struct _XCPT_ACTION {
121 
122  /*
123  * exception code or number. defined by the host OS.
124  */
125  unsigned long XcptNum;
126 
127  /*
128  * signal code or number. defined by the C runtime.
129  */
130  int SigNum;
131 
132  /*
133  * exception action code. either a special code or the address of
134  * a handler function. always determines how the exception filter
135  * should dispose of the exception.
136  */
137  _PHNDLR XcptAction;
138 };
139 
140 extern const struct _XCPT_ACTION _XcptActTab[];
141 
142 /*
143  * number of entries in the exception-action table
144  */
145 extern const int _XcptActTabCount;
146 
147 /*
148  * size of exception-action table (in bytes)
149  */
150 extern const int _XcptActTabSize;
151 
152 /*
153  * index of the first floating point exception entry
154  */
155 extern const int _First_FPE_Indx;
156 
157 /*
158  * number of FPE entries
159  */
160 extern const int _Num_FPE;
161 
162 /*
163  * return values and prototype for the exception filter function used in the
164  * C startup
165  */
166 
167 struct _EXCEPTION_POINTERS;
168 
169 int __cdecl __CppXcptFilter(_In_ unsigned long _ExceptionNum, _In_ struct _EXCEPTION_POINTERS * _ExceptionPtr);
170 int __cdecl _XcptFilter(_In_ unsigned long _ExceptionNum, _In_ struct _EXCEPTION_POINTERS * _ExceptionPtr);
171 
172 #endif /* _CRTBLD */
173 
174 #ifdef __cplusplus
175 }
176 #endif /* __cplusplus */
177 
178 #pragma pack(pop)
179 
180 #endif /* _INC_EXCPT */
int __cdecl _abnormal_termination(void)
#define _CRTIMP
Definition: crtdefs.h:23
_CRTIMP _In_opt_z_ const wchar_t _In_opt_z_ const wchar_t unsigned int
Definition: crtdefs.h:642
typedef void(__cdecl *_se_translator_function)(unsigned int
enum _EXCEPTION_DISPOSITION EXCEPTION_DISPOSITION
Definition: excpt.h:39
#define _In_
Definition: sal.h:314
Definition: excpt.h:38
Definition: excpt.h:36
_EXCEPTION_DISPOSITION
Definition: excpt.h:35
Definition: excpt.h:37
void *__cdecl _exception_info(void)
#define _Inout_
Definition: sal.h:384
unsigned long __cdecl _exception_code(void)