Commit 0497af09 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

Match RaiseException and EXCEPTION_RECORD to SDK definitions.

parent 29d7b817
...@@ -66,7 +66,7 @@ typedef INT (WINAPI *MessageBoxW_funcptr)(HWND,LPCWSTR,LPCWSTR,UINT); ...@@ -66,7 +66,7 @@ typedef INT (WINAPI *MessageBoxW_funcptr)(HWND,LPCWSTR,LPCWSTR,UINT);
/******************************************************************* /*******************************************************************
* RaiseException (KERNEL32.@) * RaiseException (KERNEL32.@)
*/ */
void WINAPI RaiseException( DWORD code, DWORD flags, DWORD nbargs, const LPDWORD args ) void WINAPI RaiseException( DWORD code, DWORD flags, DWORD nbargs, const ULONG_PTR *args )
{ {
EXCEPTION_RECORD record; EXCEPTION_RECORD record;
......
...@@ -264,7 +264,7 @@ NTSTATUS WINAPI RtlpWaitForCriticalSection( RTL_CRITICAL_SECTION *crit ) ...@@ -264,7 +264,7 @@ NTSTATUS WINAPI RtlpWaitForCriticalSection( RTL_CRITICAL_SECTION *crit )
rec.ExceptionRecord = NULL; rec.ExceptionRecord = NULL;
rec.ExceptionAddress = RtlRaiseException; /* sic */ rec.ExceptionAddress = RtlRaiseException; /* sic */
rec.NumberParameters = 1; rec.NumberParameters = 1;
rec.ExceptionInformation[0] = (DWORD)crit; rec.ExceptionInformation[0] = (ULONG_PTR)crit;
RtlRaiseException( &rec ); RtlRaiseException( &rec );
} }
} }
......
...@@ -266,7 +266,7 @@ void WINAPI EXC_RtlRaiseException( EXCEPTION_RECORD *rec, CONTEXT *context ) ...@@ -266,7 +266,7 @@ void WINAPI EXC_RtlRaiseException( EXCEPTION_RECORD *rec, CONTEXT *context )
/* Check frame address */ /* Check frame address */
if (((void*)frame < NtCurrentTeb()->Tib.StackLimit) || if (((void*)frame < NtCurrentTeb()->Tib.StackLimit) ||
((void*)(frame+1) > NtCurrentTeb()->Tib.StackBase) || ((void*)(frame+1) > NtCurrentTeb()->Tib.StackBase) ||
(int)frame & 3) (ULONG_PTR)frame & 3)
{ {
rec->ExceptionFlags |= EH_STACK_INVALID; rec->ExceptionFlags |= EH_STACK_INVALID;
break; break;
......
...@@ -178,8 +178,8 @@ static void stub_entry_point( const char *dll, const char *name, ... ) ...@@ -178,8 +178,8 @@ static void stub_entry_point( const char *dll, const char *name, ... )
rec.ExceptionAddress = *((void **)&dll - 1); rec.ExceptionAddress = *((void **)&dll - 1);
#endif #endif
rec.NumberParameters = 2; rec.NumberParameters = 2;
rec.ExceptionInformation[0] = (DWORD)dll; rec.ExceptionInformation[0] = (ULONG_PTR)dll;
rec.ExceptionInformation[1] = (DWORD)name; rec.ExceptionInformation[1] = (ULONG_PTR)name;
for (;;) RtlRaiseException( &rec ); for (;;) RtlRaiseException( &rec );
} }
......
...@@ -1022,7 +1022,7 @@ static HANDLER_DEF(segv_handler) ...@@ -1022,7 +1022,7 @@ static HANDLER_DEF(segv_handler)
#ifdef FAULT_ADDRESS #ifdef FAULT_ADDRESS
rec->NumberParameters = 2; rec->NumberParameters = 2;
rec->ExceptionInformation[0] = (get_error_code(HANDLER_CONTEXT) & 2) != 0; rec->ExceptionInformation[0] = (get_error_code(HANDLER_CONTEXT) & 2) != 0;
rec->ExceptionInformation[1] = (DWORD)FAULT_ADDRESS; rec->ExceptionInformation[1] = (ULONG_PTR)FAULT_ADDRESS;
#endif #endif
break; break;
case T_ALIGNFLT: /* Alignment check exception */ case T_ALIGNFLT: /* Alignment check exception */
......
...@@ -317,7 +317,7 @@ static void do_segv( CONTEXT *context, int trap, int err, int code, void * addr ...@@ -317,7 +317,7 @@ static void do_segv( CONTEXT *context, int trap, int err, int code, void * addr
case SEGV_ACCERR: case SEGV_ACCERR:
rec.NumberParameters = 2; rec.NumberParameters = 2;
rec.ExceptionInformation[0] = 0; /* FIXME ? */ rec.ExceptionInformation[0] = 0; /* FIXME ? */
rec.ExceptionInformation[1] = (DWORD)addr; rec.ExceptionInformation[1] = (ULONG_PTR)addr;
if (!(page_fault_code=VIRTUAL_HandleFault(addr))) if (!(page_fault_code=VIRTUAL_HandleFault(addr)))
return; return;
rec.ExceptionCode = page_fault_code; rec.ExceptionCode = page_fault_code;
...@@ -339,7 +339,7 @@ static void do_segv( CONTEXT *context, int trap, int err, int code, void * addr ...@@ -339,7 +339,7 @@ static void do_segv( CONTEXT *context, int trap, int err, int code, void * addr
/* FIXME: correct for all cases ? */ /* FIXME: correct for all cases ? */
rec.NumberParameters = 2; rec.NumberParameters = 2;
rec.ExceptionInformation[0] = 0; /* FIXME ? */ rec.ExceptionInformation[0] = 0; /* FIXME ? */
rec.ExceptionInformation[1] = (DWORD)addr; rec.ExceptionInformation[1] = (ULONG_PTR)addr;
if (!(page_fault_code=VIRTUAL_HandleFault(addr))) if (!(page_fault_code=VIRTUAL_HandleFault(addr)))
return; return;
rec.ExceptionCode = page_fault_code; rec.ExceptionCode = page_fault_code;
......
...@@ -171,7 +171,7 @@ static void segv_handler( int signal, siginfo_t *info, ucontext_t *ucontext ) ...@@ -171,7 +171,7 @@ static void segv_handler( int signal, siginfo_t *info, ucontext_t *ucontext )
rec.ExceptionAddress = (LPVOID)context.pc; rec.ExceptionAddress = (LPVOID)context.pc;
rec.NumberParameters = 2; rec.NumberParameters = 2;
rec.ExceptionInformation[0] = 0; /* FIXME: read/write access ? */ rec.ExceptionInformation[0] = 0; /* FIXME: read/write access ? */
rec.ExceptionInformation[1] = (DWORD)info->si_addr; rec.ExceptionInformation[1] = (ULONG_PTR)info->si_addr;
EXC_RtlRaiseException( &rec, &context ); EXC_RtlRaiseException( &rec, &context );
restore_context( &context, ucontext ); restore_context( &context, ucontext );
......
...@@ -374,10 +374,10 @@ static void test_pack_EXCEPTION_RECORD(void) ...@@ -374,10 +374,10 @@ static void test_pack_EXCEPTION_RECORD(void)
TEST_TYPE(EXCEPTION_RECORD, 80, 4); TEST_TYPE(EXCEPTION_RECORD, 80, 4);
TEST_FIELD(EXCEPTION_RECORD, DWORD, ExceptionCode, 0, 4, 4); TEST_FIELD(EXCEPTION_RECORD, DWORD, ExceptionCode, 0, 4, 4);
TEST_FIELD(EXCEPTION_RECORD, DWORD, ExceptionFlags, 4, 4, 4); TEST_FIELD(EXCEPTION_RECORD, DWORD, ExceptionFlags, 4, 4, 4);
TEST_FIELD(EXCEPTION_RECORD, struct __EXCEPTION_RECORD *, ExceptionRecord, 8, 4, 4); TEST_FIELD(EXCEPTION_RECORD, struct _EXCEPTION_RECORD *, ExceptionRecord, 8, 4, 4);
TEST_FIELD(EXCEPTION_RECORD, LPVOID, ExceptionAddress, 12, 4, 4); TEST_FIELD(EXCEPTION_RECORD, PVOID, ExceptionAddress, 12, 4, 4);
TEST_FIELD(EXCEPTION_RECORD, DWORD, NumberParameters, 16, 4, 4); TEST_FIELD(EXCEPTION_RECORD, DWORD, NumberParameters, 16, 4, 4);
TEST_FIELD(EXCEPTION_RECORD, DWORD[EXCEPTION_MAXIMUM_PARAMETERS], ExceptionInformation, 20, 60, 4); TEST_FIELD(EXCEPTION_RECORD, ULONG_PTR[EXCEPTION_MAXIMUM_PARAMETERS], ExceptionInformation, 20, 60, 4);
} }
static void test_pack_EXECUTION_STATE(void) static void test_pack_EXECUTION_STATE(void)
......
...@@ -1600,7 +1600,7 @@ DWORD WINAPI QueryDosDeviceW(LPCWSTR,LPWSTR,DWORD); ...@@ -1600,7 +1600,7 @@ DWORD WINAPI QueryDosDeviceW(LPCWSTR,LPWSTR,DWORD);
BOOL WINAPI QueryPerformanceCounter(LARGE_INTEGER*); BOOL WINAPI QueryPerformanceCounter(LARGE_INTEGER*);
BOOL WINAPI QueryPerformanceFrequency(LARGE_INTEGER*); BOOL WINAPI QueryPerformanceFrequency(LARGE_INTEGER*);
DWORD WINAPI QueueUserAPC(PAPCFUNC,HANDLE,ULONG_PTR); DWORD WINAPI QueueUserAPC(PAPCFUNC,HANDLE,ULONG_PTR);
void WINAPI RaiseException(DWORD,DWORD,DWORD,const LPDWORD); void WINAPI RaiseException(DWORD,DWORD,DWORD,const ULONG_PTR *);
BOOL WINAPI ReadEventLogA(HANDLE,DWORD,DWORD,LPVOID,DWORD,DWORD *,DWORD *); BOOL WINAPI ReadEventLogA(HANDLE,DWORD,DWORD,LPVOID,DWORD,DWORD *,DWORD *);
BOOL WINAPI ReadEventLogW(HANDLE,DWORD,DWORD,LPVOID,DWORD,DWORD *,DWORD *); BOOL WINAPI ReadEventLogW(HANDLE,DWORD,DWORD,LPVOID,DWORD,DWORD *,DWORD *);
#define ReadEventLog WINELIB_NAME_AW(ReadEventLog) #define ReadEventLog WINELIB_NAME_AW(ReadEventLog)
......
...@@ -1494,15 +1494,15 @@ typedef CONTEXT *PCONTEXT; ...@@ -1494,15 +1494,15 @@ typedef CONTEXT *PCONTEXT;
#define EXCEPTION_MAXIMUM_PARAMETERS 15 #define EXCEPTION_MAXIMUM_PARAMETERS 15
typedef struct __EXCEPTION_RECORD typedef struct _EXCEPTION_RECORD
{ {
DWORD ExceptionCode; DWORD ExceptionCode;
DWORD ExceptionFlags; DWORD ExceptionFlags;
struct __EXCEPTION_RECORD *ExceptionRecord; struct _EXCEPTION_RECORD *ExceptionRecord;
LPVOID ExceptionAddress; PVOID ExceptionAddress;
DWORD NumberParameters; DWORD NumberParameters;
DWORD ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS]; ULONG_PTR ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS];
} EXCEPTION_RECORD, *PEXCEPTION_RECORD; } EXCEPTION_RECORD, *PEXCEPTION_RECORD;
/* /*
......
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