Jacek Caban : win32u: Get rid of no longer needed NtUserSetCallbacks.

Alexandre Julliard julliard at winehq.org
Thu Jul 21 17:04:08 CDT 2022


Module: wine
Branch: master
Commit: 88462d9127f68519e6ba3db019466e60f28d36c1
URL:    https://gitlab.winehq.org/wine/wine/-/commit/88462d9127f68519e6ba3db019466e60f28d36c1

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Wed Jul 20 01:02:52 2022 +0200

win32u: Get rid of no longer needed NtUserSetCallbacks.

---

 dlls/user32/user_main.c      | 20 --------------------
 dlls/win32u/gdiobj.c         |  3 ---
 dlls/win32u/ntuser_private.h | 10 ----------
 dlls/win32u/sysparams.c      |  3 ---
 dlls/win32u/win32u_private.h |  2 --
 dlls/win32u/window.c         |  2 +-
 include/ntuser.h             |  1 -
 7 files changed, 1 insertion(+), 40 deletions(-)

diff --git a/dlls/user32/user_main.c b/dlls/user32/user_main.c
index 7125e32b154..d3940d4a95c 100644
--- a/dlls/user32/user_main.c
+++ b/dlls/user32/user_main.c
@@ -119,23 +119,6 @@ static void dpiaware_init(void)
     }
 }
 
-static NTSTATUS try_finally( NTSTATUS (CDECL *func)( void *), void *arg,
-                             void (CALLBACK *finally_func)( BOOL ))
-{
-    NTSTATUS status;
-    __TRY
-    {
-        status = func( arg );
-    }
-    __FINALLY( finally_func );
-    return status;
-}
-
-static const struct user_callbacks user_funcs =
-{
-    try_finally,
-};
-
 static NTSTATUS WINAPI User32CopyImage( const struct copy_image_params *params, ULONG size )
 {
     HANDLE ret = CopyImage( params->hwnd, params->type, params->dx, params->dy, params->flags );
@@ -247,9 +230,6 @@ static BOOL process_attach(void)
 {
     NtCurrentTeb()->Peb->KernelCallbackTable = kernel_callback_table;
 
-    /* FIXME: should not be needed */
-    NtUserCallOneParam( (UINT_PTR)&user_funcs, NtUserSetCallbacks );
-
     dpiaware_init();
     winproc_init();
     register_desktop_class();
diff --git a/dlls/win32u/gdiobj.c b/dlls/win32u/gdiobj.c
index 30c507275fc..b20e3a7ddbb 100644
--- a/dlls/win32u/gdiobj.c
+++ b/dlls/win32u/gdiobj.c
@@ -50,8 +50,6 @@ static GDI_HANDLE_ENTRY *next_unused;
 static LONG debug_count;
 SYSTEM_BASIC_INFORMATION system_info;
 
-const struct user_callbacks *user_callbacks = NULL;
-
 static inline HGDIOBJ entry_to_handle( GDI_HANDLE_ENTRY *entry )
 {
     unsigned int idx = entry - gdi_shared->Handles;
@@ -1283,7 +1281,6 @@ NTSTATUS gdi_init(void)
 
 NTSTATUS callbacks_init( void *args )
 {
-    user_callbacks = *(const struct user_callbacks **)args;
     *(const struct unix_funcs **)args = &unix_funcs;
     return 0;
 }
diff --git a/dlls/win32u/ntuser_private.h b/dlls/win32u/ntuser_private.h
index 69adad822a0..313382505d4 100644
--- a/dlls/win32u/ntuser_private.h
+++ b/dlls/win32u/ntuser_private.h
@@ -25,16 +25,6 @@
 #include "ntuser.h"
 #include "wine/list.h"
 
-struct dce;
-struct tagWND;
-
-struct hardware_msg_data;
-
-struct user_callbacks
-{
-    NTSTATUS (CDECL *try_finally)( NTSTATUS (CDECL *func)( void *), void *arg,
-                                   void (CALLBACK *finally_func)( BOOL ));
-};
 
 #define WM_SYSTIMER         0x0118
 #define WM_POPUPSYSTEMMENU  0x0313
diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c
index e8b55616f6a..8bb6b46397e 100644
--- a/dlls/win32u/sysparams.c
+++ b/dlls/win32u/sysparams.c
@@ -4953,9 +4953,6 @@ ULONG_PTR WINAPI NtUserCallOneParam( ULONG_PTR arg, ULONG code )
         default: user_check_not_lock(); return 0;
         }
 
-    case NtUserSetCallbacks:
-        return (UINT_PTR)InterlockedExchangePointer( (void **)&user_callbacks, (void *)arg );
-
     case NtUserSpyGetVKeyName:
         return (UINT_PTR)debugstr_vkey_name( arg );
 
diff --git a/dlls/win32u/win32u_private.h b/dlls/win32u/win32u_private.h
index 262d46d3d7c..bdc8235a831 100644
--- a/dlls/win32u/win32u_private.h
+++ b/dlls/win32u/win32u_private.h
@@ -32,8 +32,6 @@
 #include "wine/debug.h"
 #include "wine/server.h"
 
-extern const struct user_callbacks *user_callbacks DECLSPEC_HIDDEN;
-
 struct unix_funcs
 {
     /* win32u functions */
diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c
index fee1617ef10..a2ef9e72a06 100644
--- a/dlls/win32u/window.c
+++ b/dlls/win32u/window.c
@@ -3438,7 +3438,7 @@ BOOL set_window_pos( WINDOWPOS *winpos, int parent_x, int parent_y )
         /* child windows get WM_CHILDACTIVATE message */
         if ((get_window_long( winpos->hwnd, GWL_STYLE ) & (WS_CHILD | WS_POPUP)) == WS_CHILD)
             send_message( winpos->hwnd, WM_CHILDACTIVATE, 0, 0 );
-        else if (user_callbacks)
+        else
             set_foreground_window( winpos->hwnd, FALSE );
     }
 
diff --git a/include/ntuser.h b/include/ntuser.h
index 67058defb6f..59916d25d6d 100644
--- a/include/ntuser.h
+++ b/include/ntuser.h
@@ -924,7 +924,6 @@ enum
     NtUserGetDeskPattern,
     NtUserGetWinProcPtr,
     NtUserLock,
-    NtUserSetCallbacks,
     NtUserSpyGetVKeyName,
 };
 




More information about the wine-cvs mailing list