Match RaiseException and EXCEPTION_RECORD to SDK definitions
Dmitry Timoshkov
dmitry at baikal.ru
Thu Feb 24 03:39:18 CST 2005
Hello,
Changelog:
Dmitry Timoshkov <dmitry at codeweavers.com>
Match RaiseException and EXCEPTION_RECORD to SDK definitions.
diff -up cvs/hq/wine/dlls/kernel/except.c wine/dlls/kernel/except.c
--- cvs/hq/wine/dlls/kernel/except.c 2004-12-15 20:43:25.000000000 +0800
+++ wine/dlls/kernel/except.c 2005-02-24 16:37:00.000000000 +0800
@@ -66,7 +66,7 @@ typedef INT (WINAPI *MessageBoxW_funcptr
/*******************************************************************
* 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 -up cvs/hq/wine/dlls/ntdll/critsection.c wine/dlls/ntdll/critsection.c
--- cvs/hq/wine/dlls/ntdll/critsection.c 2004-09-07 15:20:58.000000000 +0900
+++ wine/dlls/ntdll/critsection.c 2005-02-24 16:37:00.000000000 +0800
@@ -264,7 +264,7 @@ NTSTATUS WINAPI RtlpWaitForCriticalSecti
rec.ExceptionRecord = NULL;
rec.ExceptionAddress = RtlRaiseException; /* sic */
rec.NumberParameters = 1;
- rec.ExceptionInformation[0] = (DWORD)crit;
+ rec.ExceptionInformation[0] = (ULONG_PTR)crit;
RtlRaiseException( &rec );
}
}
diff -up cvs/hq/wine/dlls/ntdll/exception.c wine/dlls/ntdll/exception.c
--- cvs/hq/wine/dlls/ntdll/exception.c 2004-12-15 20:43:28.000000000 +0800
+++ wine/dlls/ntdll/exception.c 2005-02-24 16:37:00.000000000 +0800
@@ -266,7 +266,7 @@ void WINAPI EXC_RtlRaiseException( EXCEP
/* 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 -up cvs/hq/wine/dlls/ntdll/loader.c wine/dlls/ntdll/loader.c
--- cvs/hq/wine/dlls/ntdll/loader.c 2005-02-24 16:30:11.000000000 +0800
+++ wine/dlls/ntdll/loader.c 2005-02-24 16:37:00.000000000 +0800
@@ -178,8 +178,8 @@ static void stub_entry_point( const char
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 -up cvs/hq/wine/dlls/ntdll/signal_i386.c wine/dlls/ntdll/signal_i386.c
--- cvs/hq/wine/dlls/ntdll/signal_i386.c 2004-12-06 14:26:26.000000000 +0800
+++ wine/dlls/ntdll/signal_i386.c 2005-02-24 16:37:00.000000000 +0800
@@ -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 -up cvs/hq/wine/dlls/ntdll/signal_powerpc.c wine/dlls/ntdll/signal_powerpc.c
--- cvs/hq/wine/dlls/ntdll/signal_powerpc.c 2003-12-09 22:42:45.000000000 +0800
+++ wine/dlls/ntdll/signal_powerpc.c 2005-02-24 16:37:00.000000000 +0800
@@ -317,7 +317,7 @@ static void do_segv( CONTEXT *context, i
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, i
/* 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 -up cvs/hq/wine/dlls/ntdll/signal_sparc.c wine/dlls/ntdll/signal_sparc.c
--- cvs/hq/wine/dlls/ntdll/signal_sparc.c 2004-11-22 17:52:21.000000000 +0800
+++ wine/dlls/ntdll/signal_sparc.c 2005-02-24 16:37:00.000000000 +0800
@@ -171,7 +171,7 @@ static void segv_handler( int signal, si
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 -up cvs/hq/wine/dlls/ntdll/tests/generated.c wine/dlls/ntdll/tests/generated.c
--- cvs/hq/wine/dlls/ntdll/tests/generated.c 2004-09-07 15:20:58.000000000 +0900
+++ wine/dlls/ntdll/tests/generated.c 2005-02-24 16:43:13.000000000 +0800
@@ -374,10 +374,10 @@ static void test_pack_EXCEPTION_RECORD(v
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 -up cvs/hq/wine/include/winbase.h wine/include/winbase.h
--- cvs/hq/wine/include/winbase.h 2005-02-24 16:30:20.000000000 +0800
+++ wine/include/winbase.h 2005-02-24 16:37:00.000000000 +0800
@@ -1600,7 +1600,7 @@ DWORD WINAPI QueryDosDeviceW(LPCWS
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 -up cvs/hq/wine/include/winnt.h wine/include/winnt.h
--- cvs/hq/wine/include/winnt.h 2005-02-24 16:30:20.000000000 +0800
+++ wine/include/winnt.h 2005-02-24 16:41:27.000000000 +0800
@@ -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;
/*
More information about the wine-patches
mailing list