Commit 324d86a3 authored by Alexandre Julliard's avatar Alexandre Julliard

Exception handling: Added a magic __EXCEPT_PAGE_FAULT macro to make it

easier to handle the common case of trapping page faults.
parent db7920bb
......@@ -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;
......
......@@ -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 )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment