ReactOS 0.4.16-dev-340-g0540c21
excpt.h
Go to the documentation of this file.
1
6#ifndef _INC_EXCPT
7#define _INC_EXCPT
8
9#include <vcruntime.h>
10
11#if !defined(RC_INVOKED)
12#include <pseh/pseh2.h>
13#endif
14
15#pragma pack(push,_CRT_PACKING)
16
17#ifdef __cplusplus
18extern "C" {
19#endif
20
22{
28
29#if (defined(_X86_) && !defined(__x86_64))
30 struct _EXCEPTION_RECORD;
31 struct _CONTEXT;
32
35 _except_handler(
36 _In_ struct _EXCEPTION_RECORD *_ExceptionRecord,
37 _In_ void *_EstablisherFrame,
38 _Inout_ struct _CONTEXT *_ContextRecord,
39 _Inout_ void *_DispatcherContext);
40
41#elif defined(__ia64__)
42
43 typedef struct _EXCEPTION_POINTERS *Exception_info_ptr;
44 struct _EXCEPTION_RECORD;
45 struct _CONTEXT;
47
53 _In_ struct _EXCEPTION_RECORD *_ExceptionRecord,
54 _In_ unsigned __int64 _MemoryStackFp,
55 _In_ unsigned __int64 _BackingStoreFp,
56 _Inout_ struct _CONTEXT *_ContextRecord,
57 _Inout_ struct _DISPATCHER_CONTEXT *_DispatcherContext,
58 _In_ unsigned __int64 _GlobalPointer);
59
60#elif defined(__x86_64) || defined(_M_ARM) || defined(_M_ARM64)
61
62 struct _EXCEPTION_RECORD;
63 struct _CONTEXT;
65
70 _In_ struct _EXCEPTION_RECORD *_ExceptionRecord,
71 _In_ void *_EstablisherFrame,
72 _Inout_ struct _CONTEXT *_ContextRecord,
73 _Inout_ struct _DISPATCHER_CONTEXT *_DispatcherContext);
74
75#endif
76
77#if defined(_MSC_VER) || (defined(__clang__) && defined(__SEH__))
78 unsigned long __cdecl _exception_code(void);
79 void *__cdecl _exception_info(void);
81#endif
82
83#define GetExceptionCode _exception_code
84#define exception_code _exception_code
85#define GetExceptionInformation (struct _EXCEPTION_POINTERS *)_exception_info
86#define exception_info (struct _EXCEPTION_POINTERS *)_exception_info
87#define AbnormalTermination _abnormal_termination
88#define abnormal_termination _abnormal_termination
89
90#define EXCEPTION_EXECUTE_HANDLER 1
91#define EXCEPTION_CONTINUE_SEARCH 0
92#define EXCEPTION_CONTINUE_EXECUTION -1
93
94#if 0
95 /* CRT stuff */
96 typedef void (__cdecl * _PHNDLR)(int);
97
98 struct _XCPT_ACTION {
99 unsigned long XcptNum;
100 int SigNum;
101 _PHNDLR XcptAction;
102 };
103
104 extern struct _XCPT_ACTION _XcptActTab[];
105 extern int _XcptActTabCount;
106 extern int _XcptActTabSize;
107 extern int _First_FPE_Indx;
108 extern int _Num_FPE;
109
110 int __cdecl __CppXcptFilter(unsigned long _ExceptionNum,struct _EXCEPTION_POINTERS * _ExceptionPtr);
111 int __cdecl _XcptFilter(unsigned long _ExceptionNum,struct _EXCEPTION_POINTERS * _ExceptionPtr);
112
113 /*
114 * The type of function that is expected as an exception handler to be
115 * installed with _try1.
116 */
117 typedef EXCEPTION_DISPOSITION (*PEXCEPTION_HANDLER)(struct _EXCEPTION_RECORD*, void*, struct _CONTEXT*, void*);
118
119#ifndef HAVE_NO_SEH
120 /*
121 * This is not entirely necessary, but it is the structure installed by
122 * the _try1 primitive below.
123 */
124 typedef struct _EXCEPTION_REGISTRATION {
125 struct _EXCEPTION_REGISTRATION *prev;
126 EXCEPTION_DISPOSITION (*handler)(struct _EXCEPTION_RECORD*, void*, struct _CONTEXT*, void*);
127 } EXCEPTION_REGISTRATION, *PEXCEPTION_REGISTRATION;
128
129 typedef EXCEPTION_REGISTRATION EXCEPTION_REGISTRATION_RECORD;
130 typedef PEXCEPTION_REGISTRATION PEXCEPTION_REGISTRATION_RECORD;
131#endif
132
133#if (defined(_X86_) && !defined(__x86_64))
134#define __try1(pHandler) \
135 __asm__ ("pushl %0;pushl %%fs:0;movl %%esp,%%fs:0;" : : "g" (pHandler));
136
137#define __except1 \
138 __asm__ ("movl (%%esp),%%eax;movl %%eax,%%fs:0;addl $8,%%esp;" \
139 : : : "%eax");
140#elif defined(__x86_64)
141#define __try1(pHandler) \
142 __asm__ ("pushq %0;pushq %%gs:0;movq %%rsp,%%gs:0;" : : "g" (pHandler));
143
144#define __except1 \
145 __asm__ ("movq (%%rsp),%%rax;movq %%rax,%%gs:0;addq $16,%%rsp;" \
146 : : : "%rax");
147#else
148#define __try1(pHandler)
149#define __except1
150#endif
151
152#endif // 0
153
154#ifdef __cplusplus
155}
156#endif
157
158#pragma pack(pop)
159#endif
#define __MINGW_EXTENSION
Definition: _mingw.h:166
#define __cdecl
Definition: accygwin.h:79
_CRTIMP EXCEPTION_DISPOSITION __cdecl __C_specific_handler(struct _EXCEPTION_RECORD *ExceptionRecord, void *EstablisherFrame, struct _CONTEXT *ContextRecord, struct _DISPATCHER_CONTEXT *DispatcherContext)
Definition: ehandler.c:15
#define __int64
Definition: basetyps.h:16
_EXCEPTION_DISPOSITION
Definition: compat.h:89
struct _EXCEPTION_REGISTRATION_RECORD * PEXCEPTION_REGISTRATION_RECORD
enum _EXCEPTION_DISPOSITION EXCEPTION_DISPOSITION
struct _EXCEPTION_REGISTRATION_RECORD EXCEPTION_REGISTRATION_RECORD
UINT(* handler)(MSIPACKAGE *)
Definition: action.c:7512
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
int CDECL _XcptFilter(NTSTATUS, PEXCEPTION_POINTERS)
Definition: except.c:278
int CDECL __CppXcptFilter(NTSTATUS, PEXCEPTION_POINTERS)
@ ExceptionContinueSearch
Definition: excpt.h:24
@ ExceptionCollidedUnwind
Definition: excpt.h:26
@ ExceptionNestedException
Definition: excpt.h:25
@ ExceptionContinueExecution
Definition: excpt.h:23
enum _EXCEPTION_DISPOSITION EXCEPTION_DISPOSITION
#define _Inout_
Definition: no_sal2.h:162
#define _In_
Definition: no_sal2.h:158
#define _abnormal_termination()
Definition: pseh2_64.h:179
#define _exception_code()
Definition: pseh2_64.h:178
#define _exception_info()
Definition: pseh2_64.h:177
DWORD(* PEXCEPTION_HANDLER)(struct _EXCEPTION_RECORD *, struct _EXCEPTION_REGISTRATION_RECORD *, struct _CONTEXT *, struct _EXCEPTION_REGISTRATION_RECORD **)
Definition: exception.h:36
#define _CRTIMP
Definition: vcruntime.h:54