Alexandre Julliard : include: Exception filters should return LONG, not DWORD.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Sep 20 05:33:42 CDT 2006


Module: wine
Branch: master
Commit: 530e76503537466f873f7980c4db4df6a0efc14a
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=530e76503537466f873f7980c4db4df6a0efc14a

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Wed Sep 20 11:26:59 2006 +0200

include: Exception filters should return LONG, not DWORD.

Also move UnhandledExceptionFilter definitions to winbase.h since they
are there in the latest SDK.

---

 dlls/kernel32/except.c   |    4 ++--
 dlls/ntdll/thread.c      |    2 +-
 include/winbase.h        |    5 +++++
 include/wine/exception.h |    4 ++--
 include/winnt.h          |    6 ------
 5 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/dlls/kernel32/except.c b/dlls/kernel32/except.c
index 8ff81f2..ed31ab9 100644
--- a/dlls/kernel32/except.c
+++ b/dlls/kernel32/except.c
@@ -440,7 +440,7 @@ inline static BOOL check_no_exec( void *
 /*******************************************************************
  *         UnhandledExceptionFilter   (KERNEL32.@)
  */
-DWORD WINAPI UnhandledExceptionFilter(PEXCEPTION_POINTERS epointers)
+LONG WINAPI UnhandledExceptionFilter(PEXCEPTION_POINTERS epointers)
 {
     const EXCEPTION_RECORD *rec = epointers->ExceptionRecord;
 
@@ -469,7 +469,7 @@ DWORD WINAPI UnhandledExceptionFilter(PE
 
         if (top_filter)
         {
-            DWORD ret = top_filter( epointers );
+            LONG ret = top_filter( epointers );
             if (ret != EXCEPTION_CONTINUE_SEARCH) return ret;
         }
 
diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c
index dbcc5a6..364c86d 100644
--- a/dlls/ntdll/thread.c
+++ b/dlls/ntdll/thread.c
@@ -302,7 +302,7 @@ HANDLE thread_init(void)
     return exe_file;
 }
 
-typedef ULONG (WINAPI *PUNHANDLED_EXCEPTION_FILTER)(PEXCEPTION_POINTERS);
+typedef LONG (WINAPI *PUNHANDLED_EXCEPTION_FILTER)(PEXCEPTION_POINTERS);
 static PUNHANDLED_EXCEPTION_FILTER get_unhandled_exception_filter(void)
 {
     static PUNHANDLED_EXCEPTION_FILTER unhandled_exception_filter;
diff --git a/include/winbase.h b/include/winbase.h
index 8bc83cf..b6788f3 100644
--- a/include/winbase.h
+++ b/include/winbase.h
@@ -131,6 +131,9 @@ typedef PCONTEXT LPCONTEXT;
 typedef PEXCEPTION_RECORD LPEXCEPTION_RECORD;
 typedef PEXCEPTION_POINTERS LPEXCEPTION_POINTERS;
 
+typedef LONG (CALLBACK *PTOP_LEVEL_EXCEPTION_FILTER)(PEXCEPTION_POINTERS);
+typedef PTOP_LEVEL_EXCEPTION_FILTER LPTOP_LEVEL_EXCEPTION_FILTER;
+
 #define OFS_MAXPATHNAME 128
 typedef struct _OFSTRUCT
 {
@@ -1978,6 +1981,7 @@ BOOL        WINAPI SetThreadPriorityBoos
 BOOL        WINAPI SetThreadToken(PHANDLE,HANDLE);
 BOOL        WINAPI SetTimeZoneInformation(const TIME_ZONE_INFORMATION *);
 BOOL        WINAPI SetTokenInformation(HANDLE,TOKEN_INFORMATION_CLASS,LPVOID,DWORD);
+LPTOP_LEVEL_EXCEPTION_FILTER WINAPI SetUnhandledExceptionFilter(LPTOP_LEVEL_EXCEPTION_FILTER);
 BOOL        WINAPI SetVolumeLabelA(LPCSTR,LPCSTR);
 BOOL        WINAPI SetVolumeLabelW(LPCWSTR,LPCWSTR);
 #define     SetVolumeLabel WINELIB_NAME_AW(SetVolumeLabel)
@@ -2005,6 +2009,7 @@ BOOL        WINAPI TransactNamedPipe(HAN
 BOOL        WINAPI TransmitCommChar(HANDLE,CHAR);
 BOOL        WINAPI TryEnterCriticalSection(CRITICAL_SECTION *lpCrit);
 BOOL        WINAPI TzSpecificLocalTimeToSystemTime(LPTIME_ZONE_INFORMATION,LPSYSTEMTIME,LPSYSTEMTIME);
+LONG        WINAPI UnhandledExceptionFilter(PEXCEPTION_POINTERS);
 BOOL        WINAPI UnlockFile(HANDLE,DWORD,DWORD,DWORD,DWORD);
 BOOL        WINAPI UnlockFileEx(HANDLE,DWORD,DWORD,DWORD,LPOVERLAPPED);
 #define     UnlockSegment(handle) GlobalUnfix((HANDLE)(handle))
diff --git a/include/wine/exception.h b/include/wine/exception.h
index f90866b..eebfdfb 100644
--- a/include/wine/exception.h
+++ b/include/wine/exception.h
@@ -120,13 +120,13 @@ #define __FINALLY(func) \
     } while (0);
 
 
-typedef DWORD (CALLBACK *__WINE_FILTER)(PEXCEPTION_POINTERS);
+typedef LONG (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_EXCEPTION_FILTER(func) LONG WINAPI func( EXCEPTION_POINTERS *__eptr )
 #define WINE_FINALLY_FUNC(func) void WINAPI func( BOOL __normal )
 
 #define GetExceptionInformation() (__eptr)
diff --git a/include/winnt.h b/include/winnt.h
index 05e0276..3bbbcac 100644
--- a/include/winnt.h
+++ b/include/winnt.h
@@ -1855,12 +1855,6 @@ typedef struct _EXCEPTION_REGISTRATION_R
  */
 
 typedef LONG (CALLBACK *PVECTORED_EXCEPTION_HANDLER)(PEXCEPTION_POINTERS ExceptionInfo);
-typedef LONG (CALLBACK *PTOP_LEVEL_EXCEPTION_FILTER)(PEXCEPTION_POINTERS ExceptionInfo);
-typedef PTOP_LEVEL_EXCEPTION_FILTER LPTOP_LEVEL_EXCEPTION_FILTER;
-
-DWORD WINAPI UnhandledExceptionFilter( PEXCEPTION_POINTERS epointers );
-LPTOP_LEVEL_EXCEPTION_FILTER
-WINAPI SetUnhandledExceptionFilter( LPTOP_LEVEL_EXCEPTION_FILTER filter );
 
 typedef struct _NT_TIB
 {




More information about the wine-cvs mailing list