Release 980517
[wine] / include / except.h
1 /*
2  * except.h
3  * Copyright (c) 1996, Onno Hovers (onno@stack.urc.tue.nl)
4  */
5
6 #ifndef __WINE_EXCEPT_H
7 #define __WINE_EXCEPT_H
8
9 #include "winnt.h"
10
11 /*
12  * the function pointer to a exception handler
13  */
14
15 /* forward definition */
16 struct __EXCEPTION_FRAME;
17
18 typedef DWORD (CALLBACK *PEXCEPTION_HANDLER)( PEXCEPTION_RECORD pexcrec,
19                                       struct __EXCEPTION_FRAME  *pestframe,
20                                       PCONTEXT                   pcontext,
21                                       LPVOID                     pdispatcher);
22
23 /*
24  * The exception frame, used for registering exception handlers 
25  * Win32 cares only about this, but compilers generally emit 
26  * larger exception frames for their own use.
27  */
28
29 typedef struct __EXCEPTION_FRAME
30 {
31   struct __EXCEPTION_FRAME *Prev;
32   PEXCEPTION_HANDLER       Handler;
33 } EXCEPTION_FRAME, *PEXCEPTION_FRAME;
34
35 /*
36  * Function definitions  
37  */
38  
39 void WINAPI RaiseException(DWORD exccode, DWORD excflags, 
40                            DWORD nargs, const LPDWORD pargs,
41                            PCONTEXT pcontext /* Wine additional parameter */); 
42                         
43 /*
44  *  this undocumented function is called when an exception
45  *  handler wants all the frames to be unwound. RtlUnwind
46  *  calls all exception handlers with the EH_UNWIND or
47  *  EH_EXIT_UNWIND flags set in the exception record
48  *
49  *  This prototype assumes RtlUnwind takes the same
50  *  parameters as OS/2 2.0 DosUnwindException
51  *  Disassembling RtlUnwind shows this is true, except for
52  *  the TargetEIP parameter, which is unused. There is 
53  *  a fourth parameter, that is used as the eax in the 
54  *  context.   
55  */
56
57 void WINAPI RtlUnwind( PEXCEPTION_FRAME pestframe,
58                        LPVOID unusedEIP,
59                        PEXCEPTION_RECORD pexcrec,
60                        DWORD contextEAX,
61                        PCONTEXT pcontext /* Wine additional parameter */ );
62
63 #endif  /* __WINE_EXCEPT_H */