Alexandre Julliard : ntdll: Add a wrapper to call the unhandled exception filter.

Alexandre Julliard julliard at winehq.org
Tue Oct 9 16:22:47 CDT 2018


Module: wine
Branch: master
Commit: da60ea1c337d47b76b50fb7e0cb9ddef788ae5e9
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=da60ea1c337d47b76b50fb7e0cb9ddef788ae5e9

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Tue Oct  9 14:42:30 2018 +0200

ntdll: Add a wrapper to call the unhandled exception filter.

Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/ntdll/exception.c      | 10 ++++++++++
 dlls/ntdll/ntdll_misc.h     |  1 +
 dlls/ntdll/signal_arm.c     |  2 +-
 dlls/ntdll/signal_arm64.c   |  2 +-
 dlls/ntdll/signal_i386.c    |  2 +-
 dlls/ntdll/signal_powerpc.c |  4 ++--
 dlls/ntdll/signal_x86_64.c  |  2 +-
 7 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/dlls/ntdll/exception.c b/dlls/ntdll/exception.c
index f853810..c1ab96a 100644
--- a/dlls/ntdll/exception.c
+++ b/dlls/ntdll/exception.c
@@ -306,6 +306,16 @@ ULONG WINAPI RtlRemoveVectoredExceptionHandler( PVOID handler )
 }
 
 
+/*******************************************************************
+ *         call_unhandled_exception_filter
+ */
+LONG WINAPI call_unhandled_exception_filter( PEXCEPTION_POINTERS eptr )
+{
+    if (!unhandled_exception_filter) return EXCEPTION_CONTINUE_SEARCH;
+    return unhandled_exception_filter( eptr );
+}
+
+
 /*************************************************************
  *            __wine_spec_unimplemented_stub
  *
diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h
index 85ba707..96d9467 100644
--- a/dlls/ntdll/ntdll_misc.h
+++ b/dlls/ntdll/ntdll_misc.h
@@ -57,6 +57,7 @@ extern NTSTATUS context_to_server( context_t *to, const CONTEXT *from ) DECLSPEC
 extern NTSTATUS context_from_server( CONTEXT *to, const context_t *from ) DECLSPEC_HIDDEN;
 extern NTSTATUS set_thread_context( HANDLE handle, const context_t *context, BOOL *self ) DECLSPEC_HIDDEN;
 extern NTSTATUS get_thread_context( HANDLE handle, context_t *context, unsigned int flags, BOOL *self ) DECLSPEC_HIDDEN;
+extern LONG WINAPI call_unhandled_exception_filter( PEXCEPTION_POINTERS eptr ) DECLSPEC_HIDDEN;
 
 /* debug helpers */
 extern LPCSTR debugstr_us( const UNICODE_STRING *str ) DECLSPEC_HIDDEN;
diff --git a/dlls/ntdll/signal_arm.c b/dlls/ntdll/signal_arm.c
index 1986389..da0c8fb 100644
--- a/dlls/ntdll/signal_arm.c
+++ b/dlls/ntdll/signal_arm.c
@@ -1227,7 +1227,7 @@ static void call_thread_entry_point( LPTHREAD_START_ROUTINE entry, void *arg )
         TRACE_(relay)( "\1Starting thread proc %p (arg=%p)\n", entry, arg );
         RtlExitUserThread( entry( arg ));
     }
-    __EXCEPT(unhandled_exception_filter)
+    __EXCEPT(call_unhandled_exception_filter)
     {
         NtTerminateThread( GetCurrentThread(), GetExceptionCode() );
     }
diff --git a/dlls/ntdll/signal_arm64.c b/dlls/ntdll/signal_arm64.c
index 5a44914..91a7e3b 100644
--- a/dlls/ntdll/signal_arm64.c
+++ b/dlls/ntdll/signal_arm64.c
@@ -998,7 +998,7 @@ static void WINAPI call_thread_entry_point( LPTHREAD_START_ROUTINE entry, void *
         TRACE_(relay)( "\1Starting thread proc %p (arg=%p)\n", entry, arg );
         RtlExitUserThread( entry( arg ));
     }
-    __EXCEPT(unhandled_exception_filter)
+    __EXCEPT(call_unhandled_exception_filter)
     {
         NtTerminateThread( GetCurrentThread(), GetExceptionCode() );
     }
diff --git a/dlls/ntdll/signal_i386.c b/dlls/ntdll/signal_i386.c
index 384615f..0719c64 100644
--- a/dlls/ntdll/signal_i386.c
+++ b/dlls/ntdll/signal_i386.c
@@ -2653,7 +2653,7 @@ void DECLSPEC_HIDDEN call_thread_func( LPTHREAD_START_ROUTINE entry, void *arg )
         TRACE_(relay)( "\1Starting thread proc %p (arg=%p)\n", entry, arg );
         RtlExitUserThread( call_thread_func_wrapper( entry, arg ));
     }
-    __EXCEPT(unhandled_exception_filter)
+    __EXCEPT(call_unhandled_exception_filter)
     {
         NtTerminateThread( GetCurrentThread(), GetExceptionCode() );
     }
diff --git a/dlls/ntdll/signal_powerpc.c b/dlls/ntdll/signal_powerpc.c
index f5231e7..1c96d62 100644
--- a/dlls/ntdll/signal_powerpc.c
+++ b/dlls/ntdll/signal_powerpc.c
@@ -648,7 +648,7 @@ static NTSTATUS call_stack_handlers( EXCEPTION_RECORD *rec, CONTEXT *context )
     /* hack: call unhandled exception filter directly */
     ptrs.ExceptionRecord = rec;
     ptrs.ContextRecord = context;
-    unhandled_exception_filter( &ptrs );
+    call_unhandled_exception_filter( &ptrs );
     return STATUS_UNHANDLED_EXCEPTION;
 }
 
@@ -1160,7 +1160,7 @@ static void WINAPI call_thread_entry_point( LPTHREAD_START_ROUTINE entry, void *
         TRACE_(relay)( "\1Starting thread proc %p (arg=%p)\n", entry, arg );
         RtlExitUserThread( entry( arg ));
     }
-    __EXCEPT(unhandled_exception_filter)
+    __EXCEPT(call_unhandled_exception_filter)
     {
         NtTerminateThread( GetCurrentThread(), GetExceptionCode() );
     }
diff --git a/dlls/ntdll/signal_x86_64.c b/dlls/ntdll/signal_x86_64.c
index 4fb80bb..7228adb 100644
--- a/dlls/ntdll/signal_x86_64.c
+++ b/dlls/ntdll/signal_x86_64.c
@@ -4370,7 +4370,7 @@ static void WINAPI call_thread_func( LPTHREAD_START_ROUTINE entry, void *arg )
         TRACE_(relay)( "\1Starting thread proc %p (arg=%p)\n", entry, arg );
         RtlExitUserThread( entry( arg ));
     }
-    __EXCEPT(unhandled_exception_filter)
+    __EXCEPT(call_unhandled_exception_filter)
     {
         NtTerminateThread( GetCurrentThread(), GetExceptionCode() );
     }




More information about the wine-cvs mailing list