1996-03-14 19:08:34 +01:00
|
|
|
/*
|
|
|
|
* except.h
|
|
|
|
* Copyright (c) 1996, Onno Hovers (onno@stack.urc.tue.nl)
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __WINE_EXCEPT_H
|
|
|
|
#define __WINE_EXCEPT_H
|
|
|
|
|
1996-08-24 20:26:35 +02:00
|
|
|
#include "wintypes.h"
|
|
|
|
#include "registers.h"
|
1996-03-14 19:08:34 +01:00
|
|
|
/*
|
|
|
|
* exception codes
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define STATUS_WAIT_0 0x00000000
|
|
|
|
#define STATUS_ABANDONED_WAIT_0 0x00000080
|
|
|
|
#define STATUS_USER_APC 0x000000C0
|
|
|
|
#define STATUS_TIMEOUT 0x00000102
|
|
|
|
#define STATUS_PENDING 0x00000103
|
|
|
|
#define STATUS_DATATYPE_MISALIGNMENT 0x80000002
|
|
|
|
#define STATUS_BREAKPOINT 0x80000003
|
|
|
|
#define STATUS_SINGLE_STEP 0x80000004
|
|
|
|
#define STATUS_ACCESS_VIOLATION 0xC0000005
|
|
|
|
#define STATUS_IN_PAGE_ERROR 0xC0000006
|
|
|
|
#define STATUS_NO_MEMORY 0xC0000017
|
|
|
|
#define STATUS_ILLEGAL_INSTRUCTION 0xC000001D
|
|
|
|
#define STATUS_NONCONTINUABLE_EXCEPTION 0xC0000025
|
|
|
|
#define STATUS_INVALID_DISPOSITION 0xC0000026
|
|
|
|
#define STATUS_ARRAY_BOUNDS_EXCEEDED 0xC000008C
|
|
|
|
#define STATUS_FLOAT_DENORMAL_OPERAND 0xC000008D
|
|
|
|
#define STATUS_FLOAT_DIVIDE_BY_ZERO 0xC000008E
|
|
|
|
#define STATUS_FLOAT_INEXACT_RESULT 0xC000008F
|
|
|
|
#define STATUS_FLOAT_INVALID_OPERATION 0xC0000090
|
|
|
|
#define STATUS_FLOAT_OVERFLOW 0xC0000091
|
|
|
|
#define STATUS_FLOAT_STACK_CHECK 0xC0000092
|
|
|
|
#define STATUS_FLOAT_UNDERFLOW 0xC0000093
|
|
|
|
#define STATUS_INTEGER_DIVIDE_BY_ZERO 0xC0000094
|
|
|
|
#define STATUS_INTEGER_OVERFLOW 0xC0000095
|
|
|
|
#define STATUS_PRIVILEGED_INSTRUCTION 0xC0000096
|
|
|
|
#define STATUS_STACK_OVERFLOW 0xC00000FD
|
|
|
|
#define STATUS_CONTROL_C_EXIT 0xC000013A
|
|
|
|
|
|
|
|
#define EXCEPTION_ACCESS_VIOLATION STATUS_ACCESS_VIOLATION
|
|
|
|
#define EXCEPTION_DATATYPE_MISALIGNMENT STATUS_DATATYPE_MISALIGNMENT
|
|
|
|
#define EXCEPTION_BREAKPOINT STATUS_BREAKPOINT
|
|
|
|
#define EXCEPTION_SINGLE_STEP STATUS_SINGLE_STEP
|
|
|
|
#define EXCEPTION_ARRAY_BOUNDS_EXCEEDED STATUS_ARRAY_BOUNDS_EXCEEDED
|
|
|
|
#define EXCEPTION_FLT_DENORMAL_OPERAND STATUS_FLOAT_DENORMAL_OPERAND
|
|
|
|
#define EXCEPTION_FLT_DIVIDE_BY_ZERO STATUS_FLOAT_DIVIDE_BY_ZERO
|
|
|
|
#define EXCEPTION_FLT_INEXACT_RESULT STATUS_FLOAT_INEXACT_RESULT
|
|
|
|
#define EXCEPTION_FLT_INVALID_OPERATION STATUS_FLOAT_INVALID_OPERATION
|
|
|
|
#define EXCEPTION_FLT_OVERFLOW STATUS_FLOAT_OVERFLOW
|
|
|
|
#define EXCEPTION_FLT_STACK_CHECK STATUS_FLOAT_STACK_CHECK
|
|
|
|
#define EXCEPTION_FLT_UNDERFLOW STATUS_FLOAT_UNDERFLOW
|
|
|
|
#define EXCEPTION_INT_DIVIDE_BY_ZERO STATUS_INTEGER_DIVIDE_BY_ZERO
|
|
|
|
#define EXCEPTION_INT_OVERFLOW STATUS_INTEGER_OVERFLOW
|
|
|
|
#define EXCEPTION_PRIV_INSTRUCTION STATUS_PRIVILEGED_INSTRUCTION
|
|
|
|
#define EXCEPTION_IN_PAGE_ERROR STATUS_IN_PAGE_ERROR
|
|
|
|
|
|
|
|
/*
|
|
|
|
* return values from the actual exception handlers
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define ExceptionContinueExecution 0
|
|
|
|
#define ExceptionContinueSearch 1
|
|
|
|
#define ExceptionNestedException 2
|
|
|
|
#define ExceptionCollidedUnwind 3
|
|
|
|
|
|
|
|
/*
|
|
|
|
* return values from filters in except() and from UnhandledExceptionFilter
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define EXCEPTION_EXECUTE_HANDLER 1
|
|
|
|
#define EXCEPTION_CONTINUE_SEARCH 0
|
|
|
|
#define EXCEPTION_CONTINUE_EXECUTION -1
|
|
|
|
|
|
|
|
/*
|
|
|
|
* from OS/2 2.0 exception handling
|
|
|
|
* Win32 seems to use the same flags as ExceptionFlags in an EXCEPTION_RECORD
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define EH_NONCONTINUABLE 0x01
|
|
|
|
#define EH_UNWINDING 0x02
|
|
|
|
#define EH_EXIT_UNWIND 0x04
|
|
|
|
#define EH_STACK_INVALID 0x08
|
|
|
|
#define EH_NESTED_CALL 0x10
|
|
|
|
|
|
|
|
#define EXCEPTION_CONTINUABLE 0
|
|
|
|
#define EXCEPTION_NONCONTINUABLE EH_NONCONTINUABLE
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The exception record used by Win32 to give additional information
|
|
|
|
* about exception to exception handlers.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define EXCEPTION_MAXIMUM_PARAMETERS 15
|
|
|
|
|
|
|
|
typedef struct __EXCEPTION_RECORD
|
|
|
|
{
|
|
|
|
DWORD ExceptionCode;
|
|
|
|
DWORD ExceptionFlags;
|
|
|
|
struct __EXCEPTION_RECORD *ExceptionRecord;
|
|
|
|
|
Release 960611
Tue Jun 11 15:20:43 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [debugger/break.c] [loader/signal.c]
Fixed breakpoints in 32-bit code.
* [include/windows.h]
Added many more Win32 versions of standard structures.
* [include/winreg.h] [misc/registry.c]
Moved private types into registry.c.
* [memory/string.c] (New file)
Moved most string functions from misc/lstr.c; added Win32 version
of all functions.
* [misc/wsprintf.c]
Implemented Win32 wsprintf functions.
* [objects/bitmap.c]
Implemented Win32 bitmap functions.
* [windows/dialog.c]
Don't set dialog procedure before the controls are created. This
avoids a crash in Winhelp.
Tue Jun 11 14:10:06 1996 Martin von Loewis <loewis@informatik.hu-berlin.de>
* [controls/menu.c] [if1632/user.spec] [windows/message.c]
Replace PeekMessage with PeekMessage16.
* [if1632/kernel32.spec][misc/main.c]
GetVersion32,GetVersionEx32A,GetVersionEx32W: new functions.
MAIN_ParseVersion: new function, new command line option -winver.
GetVersion: modified to take command line argument into account.
* [if1632/kernel32.spec] [win32/process.c]
FreeLibrary32: new function.
TlsAlloc: initialize Tls to zero.
InterlockedIncrement,InterlockedDecrement,InterlockedExchange: new
functions.
* [if1632/kernel32.spec]
SetErrorMode,GetActiveWindow: new relays to existing functions.
* [if1632/kernel32.spec][win32/user32.c]
PeekMessage32A,PeekMessage32W: new functions.
* [include/struct32.h][include/windows.h]
Moved MSG32 to windows.h.
Renamed MSG to MSG16.
Modified prototypes to use MSG16
* [include/winbase.h]
OSVERSIONINFO32A,OSVERSIONINFO32W: new structures.
Sun Jun 9 20:53:30 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [if1632/Makefile.in] [loader/builtin.c]
version.dll,lz32.dll added.
* [include/lzexpand.h] [if1632/lz32.spec] [if1632/lzexpand.spec]
[misc/lzexpand.c]
lz32.dll added.
Modified to new function naming standard.
* [include/ver.h] [if1632/ver.spec] [if1632/version.spec] [misc/ver.c]
version.dll added (win32 version of ver.dll).
Modified to new function naming standard.
Use registry to look up a LOCALE langids too.
(VerInstallFile,VerFindFile still stubs)
Fri Jun 7 20:40:20 1996 Albrecht Kleine <kleine@ak.sax.de>
* [files/file.c]
Added a warning if GetTempFileName() gets a bad drive parameter.
* [misc/commdlg.c]
Changed file listbox color to gray in SaveFile dialog
(just like Windows does this).
1996-06-11 18:02:08 +02:00
|
|
|
LPVOID ExceptionAddress;
|
1996-03-14 19:08:34 +01:00
|
|
|
DWORD NumberParameters;
|
|
|
|
DWORD ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS];
|
|
|
|
} EXCEPTION_RECORD;
|
|
|
|
|
|
|
|
typedef struct __EXCEPTION_RECORD_MIN
|
|
|
|
{
|
|
|
|
DWORD ExceptionCode;
|
|
|
|
DWORD ExceptionFlags;
|
|
|
|
struct __EXCEPTION_RECORD *ExceptionRecord;
|
|
|
|
|
Release 960611
Tue Jun 11 15:20:43 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [debugger/break.c] [loader/signal.c]
Fixed breakpoints in 32-bit code.
* [include/windows.h]
Added many more Win32 versions of standard structures.
* [include/winreg.h] [misc/registry.c]
Moved private types into registry.c.
* [memory/string.c] (New file)
Moved most string functions from misc/lstr.c; added Win32 version
of all functions.
* [misc/wsprintf.c]
Implemented Win32 wsprintf functions.
* [objects/bitmap.c]
Implemented Win32 bitmap functions.
* [windows/dialog.c]
Don't set dialog procedure before the controls are created. This
avoids a crash in Winhelp.
Tue Jun 11 14:10:06 1996 Martin von Loewis <loewis@informatik.hu-berlin.de>
* [controls/menu.c] [if1632/user.spec] [windows/message.c]
Replace PeekMessage with PeekMessage16.
* [if1632/kernel32.spec][misc/main.c]
GetVersion32,GetVersionEx32A,GetVersionEx32W: new functions.
MAIN_ParseVersion: new function, new command line option -winver.
GetVersion: modified to take command line argument into account.
* [if1632/kernel32.spec] [win32/process.c]
FreeLibrary32: new function.
TlsAlloc: initialize Tls to zero.
InterlockedIncrement,InterlockedDecrement,InterlockedExchange: new
functions.
* [if1632/kernel32.spec]
SetErrorMode,GetActiveWindow: new relays to existing functions.
* [if1632/kernel32.spec][win32/user32.c]
PeekMessage32A,PeekMessage32W: new functions.
* [include/struct32.h][include/windows.h]
Moved MSG32 to windows.h.
Renamed MSG to MSG16.
Modified prototypes to use MSG16
* [include/winbase.h]
OSVERSIONINFO32A,OSVERSIONINFO32W: new structures.
Sun Jun 9 20:53:30 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [if1632/Makefile.in] [loader/builtin.c]
version.dll,lz32.dll added.
* [include/lzexpand.h] [if1632/lz32.spec] [if1632/lzexpand.spec]
[misc/lzexpand.c]
lz32.dll added.
Modified to new function naming standard.
* [include/ver.h] [if1632/ver.spec] [if1632/version.spec] [misc/ver.c]
version.dll added (win32 version of ver.dll).
Modified to new function naming standard.
Use registry to look up a LOCALE langids too.
(VerInstallFile,VerFindFile still stubs)
Fri Jun 7 20:40:20 1996 Albrecht Kleine <kleine@ak.sax.de>
* [files/file.c]
Added a warning if GetTempFileName() gets a bad drive parameter.
* [misc/commdlg.c]
Changed file listbox color to gray in SaveFile dialog
(just like Windows does this).
1996-06-11 18:02:08 +02:00
|
|
|
LPVOID ExceptionAddress;
|
1996-03-14 19:08:34 +01:00
|
|
|
DWORD NumberParameters;
|
|
|
|
DWORD ExceptionInformation[0];
|
|
|
|
} EXCEPTION_RECORD_MIN;
|
|
|
|
|
|
|
|
typedef struct __EXCEPTION_RECORD *PEXCEPTION_RECORD;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The exception pointers structure passed to exception filters
|
|
|
|
* in except() and the UnhandledExceptionFilter().
|
|
|
|
*/
|
|
|
|
|
|
|
|
typedef struct __EXCEPTION_POINTERS
|
|
|
|
{
|
|
|
|
PEXCEPTION_RECORD ExceptionRecord;
|
|
|
|
PCONTEXT ContextRecord;
|
|
|
|
} EXCEPTION_POINTERS;
|
|
|
|
|
|
|
|
typedef struct __EXCEPTION_POINTERS *PEXCEPTION_POINTERS;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* the function pointer to a exception handler
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* forward definition */
|
|
|
|
struct __EXCEPTION_FRAME;
|
|
|
|
|
|
|
|
typedef DWORD ( *PEXCEPTION_HANDLER)( PEXCEPTION_RECORD pexcrec,
|
|
|
|
struct __EXCEPTION_FRAME *pestframe,
|
|
|
|
PCONTEXT pcontext,
|
Release 960611
Tue Jun 11 15:20:43 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [debugger/break.c] [loader/signal.c]
Fixed breakpoints in 32-bit code.
* [include/windows.h]
Added many more Win32 versions of standard structures.
* [include/winreg.h] [misc/registry.c]
Moved private types into registry.c.
* [memory/string.c] (New file)
Moved most string functions from misc/lstr.c; added Win32 version
of all functions.
* [misc/wsprintf.c]
Implemented Win32 wsprintf functions.
* [objects/bitmap.c]
Implemented Win32 bitmap functions.
* [windows/dialog.c]
Don't set dialog procedure before the controls are created. This
avoids a crash in Winhelp.
Tue Jun 11 14:10:06 1996 Martin von Loewis <loewis@informatik.hu-berlin.de>
* [controls/menu.c] [if1632/user.spec] [windows/message.c]
Replace PeekMessage with PeekMessage16.
* [if1632/kernel32.spec][misc/main.c]
GetVersion32,GetVersionEx32A,GetVersionEx32W: new functions.
MAIN_ParseVersion: new function, new command line option -winver.
GetVersion: modified to take command line argument into account.
* [if1632/kernel32.spec] [win32/process.c]
FreeLibrary32: new function.
TlsAlloc: initialize Tls to zero.
InterlockedIncrement,InterlockedDecrement,InterlockedExchange: new
functions.
* [if1632/kernel32.spec]
SetErrorMode,GetActiveWindow: new relays to existing functions.
* [if1632/kernel32.spec][win32/user32.c]
PeekMessage32A,PeekMessage32W: new functions.
* [include/struct32.h][include/windows.h]
Moved MSG32 to windows.h.
Renamed MSG to MSG16.
Modified prototypes to use MSG16
* [include/winbase.h]
OSVERSIONINFO32A,OSVERSIONINFO32W: new structures.
Sun Jun 9 20:53:30 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [if1632/Makefile.in] [loader/builtin.c]
version.dll,lz32.dll added.
* [include/lzexpand.h] [if1632/lz32.spec] [if1632/lzexpand.spec]
[misc/lzexpand.c]
lz32.dll added.
Modified to new function naming standard.
* [include/ver.h] [if1632/ver.spec] [if1632/version.spec] [misc/ver.c]
version.dll added (win32 version of ver.dll).
Modified to new function naming standard.
Use registry to look up a LOCALE langids too.
(VerInstallFile,VerFindFile still stubs)
Fri Jun 7 20:40:20 1996 Albrecht Kleine <kleine@ak.sax.de>
* [files/file.c]
Added a warning if GetTempFileName() gets a bad drive parameter.
* [misc/commdlg.c]
Changed file listbox color to gray in SaveFile dialog
(just like Windows does this).
1996-06-11 18:02:08 +02:00
|
|
|
LPVOID pdispatcher);
|
1996-03-14 19:08:34 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
* function pointer to a UnhandledExceptionFilter();
|
|
|
|
*/
|
|
|
|
|
1996-05-06 18:06:24 +02:00
|
|
|
typedef long (*__PTOP_EXCFILTER)
|
1996-03-14 19:08:34 +01:00
|
|
|
(PEXCEPTION_POINTERS ExceptionInfo);
|
|
|
|
|
|
|
|
typedef __PTOP_EXCFILTER PTOP_LEVER_EXCEPTION_FILTER;
|
|
|
|
typedef __PTOP_EXCFILTER LPTOP_LEVEL_EXCEPTION_FILTER;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The exception frame, used for registering exception handlers
|
|
|
|
* Win32 cares only about this, but compilers generally emit
|
|
|
|
* larger exception frames for their own use.
|
|
|
|
*/
|
|
|
|
|
|
|
|
typedef struct __EXCEPTION_FRAME
|
|
|
|
{
|
|
|
|
struct __EXCEPTION_FRAME *Prev;
|
|
|
|
PEXCEPTION_HANDLER Handler;
|
|
|
|
} EXCEPTION_FRAME;
|
|
|
|
|
|
|
|
typedef struct __EXCEPTION_FRAME *PEXCEPTION_FRAME;
|
|
|
|
|
|
|
|
extern PEXCEPTION_FRAME TebExceptionFrame asm("%fs:0");
|
|
|
|
|
|
|
|
#define EXC_GetFrame() TebExceptionFrame
|
|
|
|
#define EXC_SetFrame(a) (TebExceptionFrame=(a))
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Function definitions
|
|
|
|
*/
|
|
|
|
|
|
|
|
void EXC_RaiseException(DWORD exccode, DWORD excflags,
|
|
|
|
DWORD nargs, const LPDWORD pargs,
|
|
|
|
PCONTEXT pcontext);
|
|
|
|
|
|
|
|
void EXC_RtlUnwind( PEXCEPTION_FRAME pestframe,
|
|
|
|
LPVOID unusedEIP,
|
|
|
|
PEXCEPTION_RECORD pexcrec,
|
|
|
|
DWORD contextEAX,
|
|
|
|
PCONTEXT pcontext );
|
|
|
|
|
|
|
|
DWORD EXC_CallUnhandledExceptionFilter( PEXCEPTION_RECORD precord,
|
|
|
|
PCONTEXT pcontext);
|
|
|
|
|
|
|
|
void EXC_Init(void);
|
|
|
|
|
1996-05-06 18:06:24 +02:00
|
|
|
BOOL RaiseException(DWORD exccode, DWORD excflags,
|
|
|
|
DWORD nargs, const LPDWORD pargs);
|
1996-03-14 19:08:34 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
* this undocumented function is called when an exception
|
|
|
|
* handler wants all the frames to be unwound. RtlUnwind
|
|
|
|
* calls all exception handlers with the EH_UNWIND or
|
|
|
|
* EH_EXIT_UNWIND flags set in the exception record
|
|
|
|
*
|
|
|
|
* This prototype assumes RtlUnwind takes the same
|
|
|
|
* parameters as OS/2 2.0 DosUnwindException
|
|
|
|
* Disassembling RtlUnwind shows this is true, except for
|
|
|
|
* the TargetEIP parameter, which is unused. There is
|
|
|
|
* a fourth parameter, that is used as the eax in the
|
|
|
|
* context.
|
|
|
|
*/
|
|
|
|
|
1996-05-06 18:06:24 +02:00
|
|
|
BOOL RtlUnwind( PEXCEPTION_FRAME pestframe,
|
|
|
|
LPVOID unusedEIP,
|
|
|
|
PEXCEPTION_RECORD pexcrec,
|
|
|
|
DWORD contextEAX );
|
1996-03-14 19:08:34 +01:00
|
|
|
|
1996-05-06 18:06:24 +02:00
|
|
|
DWORD UnhandledExceptionFilter(PEXCEPTION_POINTERS epointers);
|
1996-03-14 19:08:34 +01:00
|
|
|
|
1996-05-06 18:06:24 +02:00
|
|
|
__PTOP_EXCFILTER SetUnhandledExceptionFilter(
|
1996-03-14 19:08:34 +01:00
|
|
|
LPTOP_LEVEL_EXCEPTION_FILTER lpTopLevelExceptionFilter);
|
|
|
|
|
|
|
|
#endif /* __WINE_EXCEPT_H */
|