Exception handling: Added a magic __EXCEPT_PAGE_FAULT macro to make it

easier to handle the common case of trapping page faults.
This commit is contained in:
Alexandre Julliard 2005-12-16 16:58:47 +01:00
parent db7920bb44
commit 324d86a3af
2 changed files with 11 additions and 1 deletions

View File

@ -546,7 +546,13 @@ DWORD __wine_exception_handler( EXCEPTION_RECORD *record, EXCEPTION_REGISTRATION
if (record->ExceptionFlags & (EH_UNWINDING | EH_EXIT_UNWIND | EH_NESTED_CALL))
return ExceptionContinueSearch;
if (wine_frame->u.filter)
if (wine_frame->u.filter == (void *)1) /* special hack for page faults */
{
if (record->ExceptionCode != EXCEPTION_ACCESS_VIOLATION)
return ExceptionContinueSearch;
}
else if (wine_frame->u.filter)
{
EXCEPTION_POINTERS ptrs;
ptrs.ExceptionRecord = record;

View File

@ -71,6 +71,7 @@
#define __EXCEPT(func) __except((func)(GetExceptionInformation()))
#define __FINALLY(func) __finally { (func)(!AbnormalTermination()); }
#define __ENDTRY /*nothing*/
#define __EXCEPT_PAGE_FAULT __except(GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION)
#else /* USE_COMPILER_EXCEPTIONS */
@ -122,6 +123,9 @@
typedef DWORD (CALLBACK *__WINE_FILTER)(PEXCEPTION_POINTERS);
typedef void (CALLBACK *__WINE_FINALLY)(BOOL);
/* convenience handler for page fault exceptions */
#define __EXCEPT_PAGE_FAULT __EXCEPT( (__WINE_FILTER)1 )
#define WINE_EXCEPTION_FILTER(func) DWORD WINAPI func( EXCEPTION_POINTERS *__eptr )
#define WINE_FINALLY_FUNC(func) void WINAPI func( BOOL __normal )