From 62852dc503c68e65849e3991533feac811074dc4 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Fri, 9 Dec 2022 12:48:35 +0100 Subject: [PATCH] win32u: Move SetProgmanWindow implementation from user32. --- dlls/user32/focus.c | 11 ++--------- dlls/win32u/input.c | 12 ++++++++++++ dlls/win32u/win32u_private.h | 1 + dlls/win32u/window.c | 3 +++ include/ntuser.h | 6 ++++++ 5 files changed, 24 insertions(+), 9 deletions(-) diff --git a/dlls/user32/focus.c b/dlls/user32/focus.c index 53802f98b1a..4d18c49214e 100644 --- a/dlls/user32/focus.c +++ b/dlls/user32/focus.c @@ -76,16 +76,9 @@ HWND WINAPI GetShellWindow(void) /*********************************************************************** * SetProgmanWindow (USER32.@) */ -HWND WINAPI SetProgmanWindow ( HWND hwnd ) +HWND WINAPI SetProgmanWindow( HWND hwnd ) { - SERVER_START_REQ(set_global_windows) - { - req->flags = SET_GLOBAL_PROGMAN_WINDOW; - req->progman_window = wine_server_user_handle( hwnd ); - if (wine_server_call_err( req )) hwnd = 0; - } - SERVER_END_REQ; - return hwnd; + return NtUserSetProgmanWindow( hwnd ); } diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c index 66fbd0746ae..783db67031a 100644 --- a/dlls/win32u/input.c +++ b/dlls/win32u/input.c @@ -2207,3 +2207,15 @@ BOOL WINAPI NtUserSetShellWindowEx( HWND shell, HWND list_view ) SERVER_END_REQ; return ret; } + +HWND set_progman_window( HWND hwnd ) +{ + SERVER_START_REQ(set_global_windows) + { + req->flags = SET_GLOBAL_PROGMAN_WINDOW; + req->progman_window = wine_server_user_handle( hwnd ); + if (wine_server_call_err( req )) hwnd = 0; + } + SERVER_END_REQ; + return hwnd; +} diff --git a/dlls/win32u/win32u_private.h b/dlls/win32u/win32u_private.h index 1fe2f80da61..fd29423cec5 100644 --- a/dlls/win32u/win32u_private.h +++ b/dlls/win32u/win32u_private.h @@ -277,6 +277,7 @@ extern BOOL set_capture_window( HWND hwnd, UINT gui_flags, HWND *prev_ret ) DECL extern BOOL set_caret_blink_time( unsigned int time ) DECLSPEC_HIDDEN; extern BOOL set_caret_pos( int x, int y ) DECLSPEC_HIDDEN; extern BOOL set_foreground_window( HWND hwnd, BOOL mouse ) DECLSPEC_HIDDEN; +extern HWND set_progman_window( HWND hwnd ) DECLSPEC_HIDDEN; extern void toggle_caret( HWND hwnd ) DECLSPEC_HIDDEN; extern void update_mouse_tracking_info( HWND hwnd ) DECLSPEC_HIDDEN; diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index 24931eab199..91baca39eaa 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -5429,6 +5429,9 @@ ULONG_PTR WINAPI NtUserCallHwnd( HWND hwnd, DWORD code ) case NtUserCallHwnd_SetForegroundWindow: return set_foreground_window( hwnd, FALSE ); + case NtUserCallHwnd_SetProgmanWindow: + return HandleToUlong( set_progman_window( hwnd )); + /* temporary exports */ case NtUserGetFullWindowHandle: return HandleToUlong( get_full_window_handle( hwnd )); diff --git a/include/ntuser.h b/include/ntuser.h index 7a44f4b0b15..19e8443475d 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -1175,6 +1175,7 @@ enum NtUserCallHwnd_IsWindowUnicode, NtUserCallHwnd_IsWindowVisible, NtUserCallHwnd_SetForegroundWindow, + NtUserCallHwnd_SetProgmanWindow, /* temporary exports */ NtUserGetFullWindowHandle, NtUserIsCurrehtProcessWindow, @@ -1272,6 +1273,11 @@ static inline BOOL NtUserSetForegroundWindow( HWND hwnd ) return NtUserCallHwnd( hwnd, NtUserCallHwnd_SetForegroundWindow ); } +static inline HWND NtUserSetProgmanWindow( HWND hwnd ) +{ + return UlongToHandle( NtUserCallHwnd( hwnd, NtUserCallHwnd_SetProgmanWindow )); +} + /* NtUserCallHwndParam codes, not compatible with Windows */ enum {