ReactOS  0.4.13-dev-563-g0561610
internal.h
Go to the documentation of this file.
1 /*
2  Copyright (c) 2004/2005 KJK::Hyperion
3 
4  Permission is hereby granted, free of charge, to any person obtaining a
5  copy of this software and associated documentation files (the "Software"),
6  to deal in the Software without restriction, including without limitation
7  the rights to use, copy, modify, merge, publish, distribute, sublicense,
8  and/or sell copies of the Software, and to permit persons to whom the
9  Software is furnished to do so, subject to the following conditions:
10 
11  The above copyright notice and this permission notice shall be included in
12  all copies or substantial portions of the Software.
13 
14  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20  DEALINGS IN THE SOFTWARE.
21 */
22 
23 #ifndef KJK_PSEH_FRAMEBASED_INTERNAL_H_
24 #define KJK_PSEH_FRAMEBASED_INTERNAL_H_
25 
26 #define _SEH_DO_TRACE_ENTER_LEAVE (1 << 0)
27 #define _SEH_DO_TRACE_EXCEPTION_RECORD (1 << 1)
28 #define _SEH_DO_TRACE_CONTEXT (1 << 2)
29 #define _SEH_DO_TRACE_UNWIND (1 << 3)
30 #define _SEH_DO_TRACE_TRYLEVEL (1 << 4)
31 #define _SEH_DO_TRACE_CALL_FILTER (1 << 5)
32 #define _SEH_DO_TRACE_FILTER (1 << 6)
33 #define _SEH_DO_TRACE_CALL_HANDLER (1 << 7)
34 #define _SEH_DO_TRACE_CALL_FINALLY (1 << 8)
35 
36 #define _SEH_DO_TRACE_NONE (0)
37 #define _SEH_DO_TRACE_ALL (-1)
38 
39 #ifndef _SEH_DO_DEFAULT_TRACING
40 #define _SEH_DO_DEFAULT_TRACING _SEH_DO_TRACE_NONE
41 #endif
42 
43 struct _EXCEPTION_RECORD;
44 struct _EXCEPTION_POINTERS;
45 struct _CONTEXT;
46 
47 typedef int (__cdecl * _SEHFrameHandler_t)
48 (
49  struct _EXCEPTION_RECORD *,
50  void *,
51  struct _CONTEXT *,
52  void *
53 );
54 
55 typedef struct __SEHRegistration
56 {
58  _SEHFrameHandler_t SER_Handler;
59 }
61 
62 struct __SEHPortableFrame;
64 
65 typedef long (__stdcall * _SEHFilter_t)
66 (
67  struct _EXCEPTION_POINTERS *,
68  struct __SEHPortableFrame *
69 );
70 
71 typedef void (__stdcall * _SEHHandler_t)
72 (
73  struct __SEHPortableTryLevel *
74 );
75 
76 typedef void (__stdcall * _SEHFinally_t)
77 (
78  struct __SEHPortableFrame *
79 );
80 
81 typedef struct __SEHHandlers
82 {
83  _SEHFilter_t SH_Filter;
85 }
87 
88 typedef struct __SEHPortableTryLevel
89 {
90  struct __SEHPortableTryLevel * volatile SPT_Next;
92 }
94 
95 typedef struct __SEHPortableFrame
96 {
98  unsigned long SPF_Code;
99  volatile _SEHHandler_t SPF_Handler;
101  volatile int SPF_Tracing;
102 }
104 
105 #ifdef __cplusplus
106 extern "C"
107 {
108 #endif
109 
111 extern void __stdcall _SEHLeaveFrame_s(void);
112 extern void __stdcall _SEHReturn_s(void);
113 
114 #if !defined(_SEH_NO_FASTCALL)
115 # ifdef _M_IX86
116 # define _SEH_FASTCALL __fastcall
117 # else
118 # define _SEH_FASTCALL __stdcall
119 # endif
120 
122 extern void _SEH_FASTCALL _SEHLeaveFrame_f(void);
123 extern void _SEH_FASTCALL _SEHReturn_f(void);
124 
125 # define _SEHEnterFrame _SEHEnterFrame_f
126 # define _SEHLeaveFrame _SEHLeaveFrame_f
127 # define _SEHReturn _SEHReturn_f
128 #else
129 # define _SEHEnterFrame _SEHEnterFrame_s
130 # define _SEHLeaveFrame _SEHLeaveFrame_s
131 # define _SEHReturn _SEHReturn_s
132 #endif
133 
134 #ifdef __cplusplus
135 }
136 #endif
137 
138 #endif
139 
140 /* EOF */
#define __cdecl
Definition: accygwin.h:79
volatile _SEHHandlers_t SPT_Handlers
Definition: internal.h:91
struct __SEHPortableTryLevel *volatile SPT_Next
Definition: internal.h:90
volatile int SPF_Tracing
Definition: internal.h:101
void __stdcall _SEHReturn_s(void)
Definition: framebased.c:457
void _SEH_FASTCALL _SEHLeaveFrame_f(void)
Definition: framebased.c:471
void _SEH_FASTCALL _SEHEnterFrame_f(_SEHPortableFrame_t *)
Definition: framebased.c:462
void __stdcall _SEHEnterFrame_s(_SEHPortableFrame_t *)
Definition: framebased.c:447
_SEHRegistration_t SPF_Registration
Definition: internal.h:97
typedef void struct _CONTEXT void *struct __SEHRegistration _SEHRegistration_t
struct __SEHHandlers _SEHHandlers_t
struct __SEHRegistration * SER_Prev
Definition: internal.h:57
void(__stdcall * _SEHFinally_t)(struct __SEHPortableFrame *)
Definition: internal.h:77
_SEHFrameHandler_t SER_Handler
Definition: internal.h:58
typedef long(__stdcall *_SEHFilter_t)(struct _EXCEPTION_POINTERS *
#define __stdcall
Definition: typedefs.h:25
_SEHFilter_t SH_Filter
Definition: internal.h:83
volatile _SEHHandler_t SPF_Handler
Definition: internal.h:99
void __stdcall _SEHLeaveFrame_s(void)
Definition: framebased.c:452
_SEHFinally_t SH_Finally
Definition: internal.h:84
struct __SEHPortableFrame *typedef void(__stdcall *_SEHHandler_t)(struct __SEHPortableTryLevel *)
Definition: internal.h:71
void _SEH_FASTCALL _SEHReturn_f(void)
Definition: framebased.c:488
typedef int(__cdecl *_SEHFrameHandler_t)(struct _EXCEPTION_RECORD *
#define _SEH_FASTCALL
Definition: internal.h:118
_SEHPortableTryLevel_t *volatile SPF_TopTryLevel
Definition: internal.h:100
struct __SEHPortableTryLevel _SEHPortableTryLevel_t
struct __SEHPortableFrame _SEHPortableFrame_t
unsigned long SPF_Code
Definition: internal.h:98