1 #ifndef __WINE_WINE_EXCEPTION_H
2 #define __WINE_WINE_EXCEPTION_H
5 #include <pseh/pseh2.h>
6 #include <pseh/excpt.h>
12 struct _EXCEPTION_REGISTRATION_RECORD
;
13 typedef struct _EXCEPTION_REGISTRATION_RECORD EXCEPTION_REGISTRATION_RECORD
, *PEXCEPTION_REGISTRATION_RECORD
;
15 struct _EXCEPTION_REGISTRATION_RECORD
17 struct _EXCEPTION_REGISTRATION_RECORD
* Prev
;
18 PEXCEPTION_HANDLER Handler
;
21 #define __TRY _SEH2_TRY
22 #define __EXCEPT(func) _SEH2_EXCEPT(func(_SEH2_GetExceptionInformation()))
23 #define __EXCEPT_PAGE_FAULT _SEH2_EXCEPT(_SEH2_GetExceptionCode() == STATUS_ACCESS_VIOLATION)
24 #define __EXCEPT_ALL _SEH2_EXCEPT(_SEH_EXECUTE_HANDLER)
25 #define __ENDTRY _SEH2_END
26 #define __FINALLY(func) _SEH2_FINALLY { func(!_SEH2_AbnormalTermination()); }
28 #ifndef GetExceptionCode
29 #define GetExceptionCode() _SEH2_GetExceptionCode()
32 #ifndef GetExceptionInformation
33 #define GetExceptionInformation() _SEH2_GetExceptionInformation()
36 #ifndef AbnormalTermination
37 #define AbnormalTermination() _SEH2_AbnormalTermination()
40 #define EXCEPTION_WINE_STUB 0x80000100
41 #define EXCEPTION_WINE_ASSERTION 0x80000101
43 #define EXCEPTION_VM86_INTx 0x80000110
44 #define EXCEPTION_VM86_STI 0x80000111
45 #define EXCEPTION_VM86_PICRETURN 0x80000112
47 static inline EXCEPTION_REGISTRATION_RECORD
*__wine_push_frame( EXCEPTION_REGISTRATION_RECORD
*frame
)
49 frame
->Prev
= (struct _EXCEPTION_REGISTRATION_RECORD
*)__readfsdword(0);
50 __writefsdword(0, (unsigned long)frame
);
54 static inline EXCEPTION_REGISTRATION_RECORD
*__wine_pop_frame( EXCEPTION_REGISTRATION_RECORD
*frame
)
56 __writefsdword(0, (unsigned long)frame
->Prev
);
60 extern void __wine_enter_vm86( CONTEXT
*context
);