Alexandre Julliard : ntdll: Allow the dispatcher functions to return to the caller.

Alexandre Julliard julliard at winehq.org
Fri Jun 11 15:31:30 CDT 2021


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Fri Jun 11 10:56:23 2021 +0200

ntdll: Allow the dispatcher functions to return to the caller.

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

---

 dlls/ntdll/unix/server.c       | 10 +++++-----
 dlls/ntdll/unix/thread.c       |  2 +-
 dlls/ntdll/unix/unix_private.h | 14 +++++++-------
 3 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/dlls/ntdll/unix/server.c b/dlls/ntdll/unix/server.c
index cec2ef250a3..19e9d603d52 100644
--- a/dlls/ntdll/unix/server.c
+++ b/dlls/ntdll/unix/server.c
@@ -354,10 +354,10 @@ static int wait_select_reply( void *cookie )
 /***********************************************************************
  *              invoke_user_apc
  */
-static void invoke_user_apc( CONTEXT *context, const user_apc_t *apc, NTSTATUS status )
+static NTSTATUS invoke_user_apc( CONTEXT *context, const user_apc_t *apc, NTSTATUS status )
 {
-    call_user_apc_dispatcher( context, apc->args[0], apc->args[1], apc->args[2],
-                              wine_server_get_ptr( apc->func ), pKiUserApcDispatcher, status );
+    return call_user_apc_dispatcher( context, apc->args[0], apc->args[1], apc->args[2],
+                                     wine_server_get_ptr( apc->func ), pKiUserApcDispatcher, status );
 }
 
 
@@ -675,7 +675,7 @@ unsigned int server_wait( const select_op_t *select_op, data_size_t size, UINT f
     }
 
     ret = server_select( select_op, size, flags, abs_timeout, NULL, NULL, &apc );
-    if (ret == STATUS_USER_APC) invoke_user_apc( NULL, &apc, ret );
+    if (ret == STATUS_USER_APC) return invoke_user_apc( NULL, &apc, ret );
 
     /* A test on Windows 2000 shows that Windows always yields during
        a wait, but a wait that is hit by an event gets a priority
@@ -696,7 +696,7 @@ NTSTATUS WINAPI NtContinue( CONTEXT *context, BOOLEAN alertable )
     if (alertable)
     {
         status = server_select( NULL, 0, SELECT_INTERRUPTIBLE | SELECT_ALERTABLE, 0, NULL, NULL, &apc );
-        if (status == STATUS_USER_APC) invoke_user_apc( context, &apc, status );
+        if (status == STATUS_USER_APC) return invoke_user_apc( context, &apc, status );
     }
     status = NtSetContextThread( GetCurrentThread(), context );
     if (!status && (context->ContextFlags & CONTEXT_INTEGER) == CONTEXT_INTEGER)
diff --git a/dlls/ntdll/unix/thread.c b/dlls/ntdll/unix/thread.c
index 54b748e99cb..d460be909a4 100644
--- a/dlls/ntdll/unix/thread.c
+++ b/dlls/ntdll/unix/thread.c
@@ -1163,7 +1163,7 @@ NTSTATUS WINAPI NtRaiseException( EXCEPTION_RECORD *rec, CONTEXT *context, BOOL
     if (status == DBG_CONTINUE || status == DBG_EXCEPTION_HANDLED)
         return NtContinue( context, FALSE );
 
-    if (first_chance) call_user_exception_dispatcher( rec, context, pKiUserExceptionDispatcher );
+    if (first_chance) return call_user_exception_dispatcher( rec, context, pKiUserExceptionDispatcher );
 
     if (rec->ExceptionFlags & EH_STACK_INVALID)
         ERR_(seh)("Exception frame is not in stack limits => unable to dispatch exception.\n");
diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h
index 5ebbc6d702b..e2a6ea1591f 100644
--- a/dlls/ntdll/unix/unix_private.h
+++ b/dlls/ntdll/unix/unix_private.h
@@ -284,13 +284,13 @@ extern void add_completion( HANDLE handle, ULONG_PTR value, NTSTATUS status, ULO
 
 extern void dbg_init(void) DECLSPEC_HIDDEN;
 
-extern void WINAPI DECLSPEC_NORETURN call_user_apc_dispatcher( CONTEXT *context_ptr, ULONG_PTR arg1,
-                                                               ULONG_PTR arg2, ULONG_PTR arg3,
-                                                               PNTAPCFUNC func,
-                                                               void (WINAPI *dispatcher)(CONTEXT*,ULONG_PTR,ULONG_PTR,ULONG_PTR,PNTAPCFUNC),
-                                                               NTSTATUS status ) DECLSPEC_HIDDEN;
-extern void WINAPI DECLSPEC_NORETURN call_user_exception_dispatcher( EXCEPTION_RECORD *rec, CONTEXT *context,
-                                                                     NTSTATUS (WINAPI *dispatcher)(EXCEPTION_RECORD*,CONTEXT*) ) DECLSPEC_HIDDEN;
+extern NTSTATUS WINAPI call_user_apc_dispatcher( CONTEXT *context_ptr, ULONG_PTR arg1,
+                                                 ULONG_PTR arg2, ULONG_PTR arg3,
+                                                 PNTAPCFUNC func,
+                                                 void (WINAPI *dispatcher)(CONTEXT*,ULONG_PTR,ULONG_PTR,ULONG_PTR,PNTAPCFUNC),
+                                                 NTSTATUS status ) DECLSPEC_HIDDEN;
+extern NTSTATUS WINAPI call_user_exception_dispatcher( EXCEPTION_RECORD *rec, CONTEXT *context,
+                                                       NTSTATUS (WINAPI *dispatcher)(EXCEPTION_RECORD*,CONTEXT*) ) DECLSPEC_HIDDEN;
 extern void WINAPI call_raise_user_exception_dispatcher( NTSTATUS (WINAPI *dispatcher)(void) ) DECLSPEC_HIDDEN;
 
 #define IMAGE_DLLCHARACTERISTICS_PREFER_NATIVE 0x0010 /* Wine extension */




More information about the wine-cvs mailing list