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