ReactOS  r76032
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
14 extern "C" {
15 #endif
16 
18 {
24 
25 #if (defined(_X86_) && !defined(__x86_64))
26  struct _EXCEPTION_RECORD;
27  struct _CONTEXT;
28 
30  __cdecl
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;
42  struct _DISPATCHER_CONTEXT;
43 
45  _CRTIMP
47  __cdecl
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)
57 
58  struct _EXCEPTION_RECORD;
59  struct _CONTEXT;
60  struct _DISPATCHER_CONTEXT;
61 
62  _CRTIMP
64  __cdecl
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 #ifdef _MSC_VER
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 __cdecl
Definition: accygwin.h:79
#define _CRTIMP
Definition: crtdefs.h:60
_CRTIMP EXCEPTION_DISPOSITION __cdecl __C_specific_handler(struct _EXCEPTION_RECORD *_ExceptionRecord, void *_EstablisherFrame, struct _CONTEXT *_ContextRecord, struct _DISPATCHER_CONTEXT *_DispatcherContext)
Definition: ehandler.c:8
struct _EXCEPTION_REGISTRATION_RECORD EXCEPTION_REGISTRATION_RECORD
_EXCEPTION_DISPOSITION
Definition: compat.h:78
DWORD(* PEXCEPTION_HANDLER)(struct _EXCEPTION_RECORD *, struct _EXCEPTION_REGISTRATION_RECORD *, struct _CONTEXT *, struct _EXCEPTION_REGISTRATION_RECORD **)
Definition: exception.h:32
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:47
#define __MINGW_EXTENSION
Definition: _mingw.h:148
enum _EXCEPTION_DISPOSITION EXCEPTION_DISPOSITION
#define _Inout_
Definition: no_sal2.h:244
#define _In_
Definition: no_sal2.h:204
int CDECL _XcptFilter(NTSTATUS ExceptionCode, struct _EXCEPTION_POINTERS *except)
Definition: xcptfil.c:27
int CDECL __CppXcptFilter(NTSTATUS ex, PEXCEPTION_POINTERS ptr)
Definition: cppexcept.c:547
void _abnormal_termination()
Definition: stubs.c:222
UINT(* handler)(MSIPACKAGE *)
Definition: action.c:7684
enum _EXCEPTION_DISPOSITION EXCEPTION_DISPOSITION
struct _EXCEPTION_REGISTRATION_RECORD * PEXCEPTION_REGISTRATION_RECORD
#define __int64
Definition: basetyps.h:16
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:29