From 0497af09a79d84f8cb29dcbb171e447978333e8f Mon Sep 17 00:00:00 2001 From: Dmitry Timoshkov Date: Thu, 24 Feb 2005 13:15:36 +0000 Subject: [PATCH] Match RaiseException and EXCEPTION_RECORD to SDK definitions. --- dlls/kernel/except.c | 2 +- dlls/ntdll/critsection.c | 2 +- dlls/ntdll/exception.c | 2 +- dlls/ntdll/loader.c | 4 ++-- dlls/ntdll/signal_i386.c | 2 +- dlls/ntdll/signal_powerpc.c | 4 ++-- dlls/ntdll/signal_sparc.c | 2 +- dlls/ntdll/tests/generated.c | 6 +++--- include/winbase.h | 2 +- include/winnt.h | 8 ++++---- 10 files changed, 17 insertions(+), 17 deletions(-) diff --git a/dlls/kernel/except.c b/dlls/kernel/except.c index f2e9ff91436..8a644e1fa55 100644 --- a/dlls/kernel/except.c +++ b/dlls/kernel/except.c @@ -66,7 +66,7 @@ typedef INT (WINAPI *MessageBoxW_funcptr)(HWND,LPCWSTR,LPCWSTR,UINT); /******************************************************************* * 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; diff --git a/dlls/ntdll/critsection.c b/dlls/ntdll/critsection.c index 8de00094b24..2fbb27d68a5 100644 --- a/dlls/ntdll/critsection.c +++ b/dlls/ntdll/critsection.c @@ -264,7 +264,7 @@ NTSTATUS WINAPI RtlpWaitForCriticalSection( RTL_CRITICAL_SECTION *crit ) rec.ExceptionRecord = NULL; rec.ExceptionAddress = RtlRaiseException; /* sic */ rec.NumberParameters = 1; - rec.ExceptionInformation[0] = (DWORD)crit; + rec.ExceptionInformation[0] = (ULONG_PTR)crit; RtlRaiseException( &rec ); } } diff --git a/dlls/ntdll/exception.c b/dlls/ntdll/exception.c index 5ba9e36b57d..10046d47c91 100644 --- a/dlls/ntdll/exception.c +++ b/dlls/ntdll/exception.c @@ -266,7 +266,7 @@ void WINAPI EXC_RtlRaiseException( EXCEPTION_RECORD *rec, CONTEXT *context ) /* Check frame address */ if (((void*)frame < NtCurrentTeb()->Tib.StackLimit) || ((void*)(frame+1) > NtCurrentTeb()->Tib.StackBase) || - (int)frame & 3) + (ULONG_PTR)frame & 3) { rec->ExceptionFlags |= EH_STACK_INVALID; break; diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index 884f10b5877..de84592ffa1 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -178,8 +178,8 @@ static void stub_entry_point( const char *dll, const char *name, ... ) rec.ExceptionAddress = *((void **)&dll - 1); #endif rec.NumberParameters = 2; - rec.ExceptionInformation[0] = (DWORD)dll; - rec.ExceptionInformation[1] = (DWORD)name; + rec.ExceptionInformation[0] = (ULONG_PTR)dll; + rec.ExceptionInformation[1] = (ULONG_PTR)name; for (;;) RtlRaiseException( &rec ); } diff --git a/dlls/ntdll/signal_i386.c b/dlls/ntdll/signal_i386.c index 683060f3955..dd903cb610e 100644 --- a/dlls/ntdll/signal_i386.c +++ b/dlls/ntdll/signal_i386.c @@ -1022,7 +1022,7 @@ static HANDLER_DEF(segv_handler) #ifdef FAULT_ADDRESS rec->NumberParameters = 2; rec->ExceptionInformation[0] = (get_error_code(HANDLER_CONTEXT) & 2) != 0; - rec->ExceptionInformation[1] = (DWORD)FAULT_ADDRESS; + rec->ExceptionInformation[1] = (ULONG_PTR)FAULT_ADDRESS; #endif break; case T_ALIGNFLT: /* Alignment check exception */ diff --git a/dlls/ntdll/signal_powerpc.c b/dlls/ntdll/signal_powerpc.c index a0b6eb0b843..9e9c0daa9fd 100644 --- a/dlls/ntdll/signal_powerpc.c +++ b/dlls/ntdll/signal_powerpc.c @@ -317,7 +317,7 @@ static void do_segv( CONTEXT *context, int trap, int err, int code, void * addr case SEGV_ACCERR: rec.NumberParameters = 2; rec.ExceptionInformation[0] = 0; /* FIXME ? */ - rec.ExceptionInformation[1] = (DWORD)addr; + rec.ExceptionInformation[1] = (ULONG_PTR)addr; if (!(page_fault_code=VIRTUAL_HandleFault(addr))) return; rec.ExceptionCode = page_fault_code; @@ -339,7 +339,7 @@ static void do_segv( CONTEXT *context, int trap, int err, int code, void * addr /* FIXME: correct for all cases ? */ rec.NumberParameters = 2; rec.ExceptionInformation[0] = 0; /* FIXME ? */ - rec.ExceptionInformation[1] = (DWORD)addr; + rec.ExceptionInformation[1] = (ULONG_PTR)addr; if (!(page_fault_code=VIRTUAL_HandleFault(addr))) return; rec.ExceptionCode = page_fault_code; diff --git a/dlls/ntdll/signal_sparc.c b/dlls/ntdll/signal_sparc.c index 36b42b9820f..2ab103f44db 100644 --- a/dlls/ntdll/signal_sparc.c +++ b/dlls/ntdll/signal_sparc.c @@ -171,7 +171,7 @@ static void segv_handler( int signal, siginfo_t *info, ucontext_t *ucontext ) rec.ExceptionAddress = (LPVOID)context.pc; rec.NumberParameters = 2; 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 ); restore_context( &context, ucontext ); diff --git a/dlls/ntdll/tests/generated.c b/dlls/ntdll/tests/generated.c index 7ca73796d5b..6815416b4bf 100644 --- a/dlls/ntdll/tests/generated.c +++ b/dlls/ntdll/tests/generated.c @@ -374,10 +374,10 @@ static void test_pack_EXCEPTION_RECORD(void) TEST_TYPE(EXCEPTION_RECORD, 80, 4); TEST_FIELD(EXCEPTION_RECORD, DWORD, ExceptionCode, 0, 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, LPVOID, ExceptionAddress, 12, 4, 4); + TEST_FIELD(EXCEPTION_RECORD, struct _EXCEPTION_RECORD *, ExceptionRecord, 8, 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[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) diff --git a/include/winbase.h b/include/winbase.h index e278500d750..32f1923c958 100644 --- a/include/winbase.h +++ b/include/winbase.h @@ -1600,7 +1600,7 @@ DWORD WINAPI QueryDosDeviceW(LPCWSTR,LPWSTR,DWORD); BOOL WINAPI QueryPerformanceCounter(LARGE_INTEGER*); BOOL WINAPI QueryPerformanceFrequency(LARGE_INTEGER*); 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 ReadEventLogW(HANDLE,DWORD,DWORD,LPVOID,DWORD,DWORD *,DWORD *); #define ReadEventLog WINELIB_NAME_AW(ReadEventLog) diff --git a/include/winnt.h b/include/winnt.h index 18f856bb45c..1121fea3fe1 100644 --- a/include/winnt.h +++ b/include/winnt.h @@ -1494,15 +1494,15 @@ typedef CONTEXT *PCONTEXT; #define EXCEPTION_MAXIMUM_PARAMETERS 15 -typedef struct __EXCEPTION_RECORD +typedef struct _EXCEPTION_RECORD { DWORD ExceptionCode; DWORD ExceptionFlags; - struct __EXCEPTION_RECORD *ExceptionRecord; + struct _EXCEPTION_RECORD *ExceptionRecord; - LPVOID ExceptionAddress; + PVOID ExceptionAddress; DWORD NumberParameters; - DWORD ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS]; + ULONG_PTR ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS]; } EXCEPTION_RECORD, *PEXCEPTION_RECORD; /*