- Build cdfs, ntfs, vfatfs with PCH
[reactos.git] / reactos / include / libs / pseh / framebased / internal.h
1 /*
2 Copyright (c) 2004/2005 KJK::Hyperion
3
4 Permission is hereby granted, free of charge, to any person obtaining a copy of
5 this software and associated documentation files (the "Software"), to deal in
6 the Software without restriction, including without limitation the rights to
7 use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
8 of the Software, and to permit persons to whom the Software is furnished to do
9 so, subject to the following conditions:
10
11 The above copyright notice and this permission notice shall be included in all
12 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 FROM,
19 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 SOFTWARE.
21 */
22
23 #ifndef KJK_PSEH_FRAMEBASED_INTERNAL_H_
24 #define KJK_PSEH_FRAMEBASED_INTERNAL_H_
25
26 struct _EXCEPTION_RECORD;
27 struct _EXCEPTION_POINTERS;
28 struct _CONTEXT;
29
30 typedef int (__cdecl * _SEHFrameHandler_t)
31 (
32 struct _EXCEPTION_RECORD *,
33 void *,
34 struct _CONTEXT *,
35 void *
36 );
37
38 typedef struct __SEHRegistration
39 {
40 struct __SEHRegistration * SER_Prev;
41 _SEHFrameHandler_t SER_Handler;
42 }
43 _SEHRegistration_t;
44
45 struct __SEHPortableFrame;
46 struct __SEHPortableTryLevel;
47
48 typedef long (__stdcall * _SEHFilter_t)
49 (
50 struct _EXCEPTION_POINTERS *,
51 struct __SEHPortableFrame *
52 );
53
54 typedef __declspec(noreturn) void (__stdcall * _SEHHandler_t)
55 (
56 struct __SEHPortableTryLevel *
57 );
58
59 typedef void (__stdcall * _SEHFinally_t)
60 (
61 struct __SEHPortableFrame *
62 );
63
64 typedef struct __SEHHandlers
65 {
66 _SEHFilter_t SH_Filter;
67 _SEHFinally_t SH_Finally;
68 }
69 _SEHHandlers_t;
70
71 typedef struct __SEHPortableTryLevel
72 {
73 struct __SEHPortableTryLevel * SPT_Next;
74 const _SEHHandlers_t * SPT_Handlers;
75 }
76 _SEHPortableTryLevel_t;
77
78 typedef struct __SEHPortableFrame
79 {
80 _SEHRegistration_t SPF_Registration;
81 unsigned long SPF_Code;
82 _SEHHandler_t SPF_Handler;
83 _SEHPortableTryLevel_t * SPF_TopTryLevel;
84 }
85 _SEHPortableFrame_t;
86
87 #ifdef __cplusplus
88 extern "C"
89 {
90 #endif
91
92 extern void __stdcall _SEHEnterFrame_s
93 (
94 _SEHPortableFrame_t *,
95 _SEHPortableTryLevel_t *
96 );
97
98 extern void __stdcall _SEHEnterTry_s(_SEHPortableTryLevel_t *);
99 extern void __stdcall _SEHLeave_s(void);
100
101 #if !defined(_SEH_NO_FASTCALL)
102 # ifdef _M_IX86
103 # define _SEH_FASTCALL __fastcall
104 # else
105 # define _SEH_FASTCALL __stdcall
106 # endif
107
108 extern void _SEH_FASTCALL _SEHEnterFrame_f
109 (
110 _SEHPortableFrame_t *,
111 _SEHPortableTryLevel_t *
112 );
113
114 extern void _SEH_FASTCALL _SEHEnterTry_f(_SEHPortableTryLevel_t *);
115 extern void _SEH_FASTCALL _SEHLeave_f(void);
116
117 # define _SEHEnterFrame _SEHEnterFrame_f
118 # define _SEHEnterTry _SEHEnterTry_f
119 # define _SEHLeave _SEHLeave_f
120 #else
121 # define _SEHEnterFrame _SEHEnterFrame_s
122 # define _SEHEnterTry _SEHEnterTry_s
123 # define _SEHLeave _SEHLeave_s
124 #endif
125
126 #ifdef __cplusplus
127 }
128 #endif
129
130 #endif
131
132 /* EOF */