include: Added definitions for the fault address exception information.

oldstable
Alexandre Julliard 2006-09-20 11:27:53 +02:00
parent 530e765035
commit a27d0aa4e9
5 changed files with 38 additions and 7 deletions

View File

@ -117,8 +117,9 @@ static int format_exception_msg( const EXCEPTION_POINTERS *ptr, char *buffer, in
case EXCEPTION_ACCESS_VIOLATION:
if (rec->NumberParameters == 2)
len = snprintf( buffer, size, "Unhandled page fault on %s access to 0x%08lx",
rec->ExceptionInformation[0] ? "write" : "read",
rec->ExceptionInformation[1]);
rec->ExceptionInformation[0] == EXCEPTION_WRITE_FAULT ? "write" :
rec->ExceptionInformation[0] == EXCEPTION_EXECUTE_FAULT ? "execute" : "read",
rec->ExceptionInformation[1]);
else
len = snprintf( buffer, size, "Unhandled page fault");
break;
@ -448,11 +449,11 @@ LONG WINAPI UnhandledExceptionFilter(PEXCEPTION_POINTERS epointers)
{
switch(rec->ExceptionInformation[0])
{
case 1: /* write access */
case EXCEPTION_WRITE_FAULT:
if (check_resource_write( (void *)rec->ExceptionInformation[1] ))
return EXCEPTION_CONTINUE_EXECUTION;
break;
case 8: /* execute access */
case EXCEPTION_EXECUTE_FAULT:
if (check_no_exec( (void *)rec->ExceptionInformation[1] ))
return EXCEPTION_CONTINUE_EXECUTION;
break;

View File

@ -970,7 +970,8 @@ static void WINAPI raise_segv_exception( EXCEPTION_RECORD *rec, CONTEXT *context
case EXCEPTION_ACCESS_VIOLATION:
if (rec->NumberParameters == 2)
{
if ((rec->ExceptionInformation[0] == 8) && check_atl_thunk( rec, context )) goto done;
if (rec->ExceptionInformation[0] == EXCEPTION_EXECUTE_FAULT && check_atl_thunk( rec, context ))
goto done;
rec->ExceptionCode = VIRTUAL_HandleFault( (void *)rec->ExceptionInformation[1] );
}
break;

View File

@ -4359,7 +4359,7 @@ static LONG CALLBACK X11DRV_DIB_FaultHandler( PEXCEPTION_POINTERS ep )
if (!found) return EXCEPTION_CONTINUE_SEARCH;
X11DRV_DIB_Lock( physBitmap, DIB_Status_None, FALSE );
if (ep->ExceptionRecord->ExceptionInformation[0]) {
if (ep->ExceptionRecord->ExceptionInformation[0] == EXCEPTION_WRITE_FAULT) {
/* the app tried to write the DIB bits */
X11DRV_DIB_Coerce( physBitmap, DIB_Status_AppMod, FALSE );
} else {

View File

@ -714,6 +714,10 @@ typedef struct _CONTEXT86
typedef CONTEXT86 CONTEXT;
#define EXCEPTION_READ_FAULT 0
#define EXCEPTION_WRITE_FAULT 1
#define EXCEPTION_EXECUTE_FAULT 8
#endif /* __i386__ */
typedef struct _LDT_ENTRY {
@ -754,6 +758,10 @@ typedef struct _LDT_ENTRY {
#define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_FLOATING_POINT)
#define CONTEXT_ALL (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_SEGMENTS | CONTEXT_FLOATING_POINT | CONTEXT_DEBUG_REGISTERS)
#define EXCEPTION_READ_FAULT 0
#define EXCEPTION_WRITE_FAULT 1
#define EXCEPTION_EXECUTE_FAULT 8
typedef struct DECLSPEC_ALIGN(16) _M128A {
ULONGLONG Low;
LONGLONG High;
@ -877,6 +885,10 @@ typedef struct DECLSPEC_ALIGN(16) _CONTEXT {
#define CONTEXT_INTEGER (CONTEXT_ALPHA | 0x00000004L)
#define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_FLOATING_POINT | CONTEXT_INTEGER)
#define EXCEPTION_READ_FAULT 0
#define EXCEPTION_WRITE_FAULT 1
#define EXCEPTION_EXECUTE_FAULT 8
typedef struct _CONTEXT
{
/* selected by CONTEXT_FLOATING_POINT */
@ -973,6 +985,10 @@ typedef struct _CONTEXT
#define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_INTEGER)
#define EXCEPTION_READ_FAULT 0
#define EXCEPTION_WRITE_FAULT 1
#define EXCEPTION_EXECUTE_FAULT 8
typedef struct _CONTEXT {
/* The flags values within this flag control the contents of
a CONTEXT record.
@ -1028,6 +1044,10 @@ typedef struct _CONTEXT {
#define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_FLOATING_POINT | CONTEXT_INTEGER)
#define EXCEPTION_READ_FAULT 0
#define EXCEPTION_WRITE_FAULT 1
#define EXCEPTION_EXECUTE_FAULT 8
typedef struct _CONTEXT
{
DWORD Argument[4];
@ -1123,6 +1143,10 @@ typedef struct _CONTEXT
#define CONTEXT_DEBUG_REGISTERS 0x0008
#define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_FLOATING_POINT | CONTEXT_INTEGER)
#define EXCEPTION_READ_FAULT 0
#define EXCEPTION_WRITE_FAULT 1
#define EXCEPTION_EXECUTE_FAULT 8
typedef struct
{
/* These are selected by CONTEXT_FLOATING_POINT */
@ -1267,6 +1291,10 @@ typedef struct _STACK_FRAME_HEADER
#define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_FLOATING_POINT | CONTEXT_INTEGER)
#define EXCEPTION_READ_FAULT 0
#define EXCEPTION_WRITE_FAULT 1
#define EXCEPTION_EXECUTE_FAULT 8
typedef struct _CONTEXT
{
DWORD ContextFlags;

View File

@ -307,7 +307,8 @@ static DWORD dbg_handle_exception(const EXCEPTION_RECORD* rec, BOOL first_chance
case EXCEPTION_ACCESS_VIOLATION:
if (rec->NumberParameters == 2)
dbg_printf("page fault on %s access to 0x%08lx",
rec->ExceptionInformation[0] ? "write" : "read",
rec->ExceptionInformation[0] == EXCEPTION_WRITE_FAULT ? "write" :
rec->ExceptionInformation[0] == EXCEPTION_EXECUTE_FAULT ? "execute" : "read",
rec->ExceptionInformation[1]);
else
dbg_printf("page fault");