Module: wine Branch: master Commit: 67c3fff7cdcbceb80368ed6b6501978aeed41fff URL: https://gitlab.winehq.org/wine/wine/-/commit/67c3fff7cdcbceb80368ed6b6501978...
Author: Jacek Caban jacek@codeweavers.com Date: Fri Dec 9 12:36:22 2022 +0100
win32u: Move GetShellWindow implementation from user32.
---
dlls/user32/focus.c | 12 +----------- dlls/win32u/input.c | 15 +++++++++++++++ dlls/win32u/sysparams.c | 3 +++ dlls/win32u/win32u_private.h | 1 + include/ntuser.h | 6 ++++++ 5 files changed, 26 insertions(+), 11 deletions(-)
diff --git a/dlls/user32/focus.c b/dlls/user32/focus.c index 2d15aa9c6e7..e79f6f68dc2 100644 --- a/dlls/user32/focus.c +++ b/dlls/user32/focus.c @@ -112,17 +112,7 @@ BOOL WINAPI SetShellWindow(HWND hwndShell) */ HWND WINAPI GetShellWindow(void) { - HWND hwndShell = 0; - - SERVER_START_REQ(set_global_windows) - { - req->flags = 0; - if (!wine_server_call_err(req)) - hwndShell = wine_server_ptr_handle( reply->old_shell_window ); - } - SERVER_END_REQ; - - return hwndShell; + return NtUserGetShellWindow(); }
diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c index 75230e961e0..fb87d6395d3 100644 --- a/dlls/win32u/input.c +++ b/dlls/win32u/input.c @@ -2150,3 +2150,18 @@ void toggle_caret( HWND hwnd )
if (ret && !hidden) display_caret( hwnd, &r ); } + +HWND get_shell_window(void) +{ + HWND hwnd = 0; + + SERVER_START_REQ(set_global_windows) + { + req->flags = 0; + if (!wine_server_call_err(req)) + hwnd = wine_server_ptr_handle( reply->old_shell_window ); + } + SERVER_END_REQ; + + return hwnd; +} diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index 5854e000fea..89be3bbc6ed 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -5437,6 +5437,9 @@ ULONG_PTR WINAPI NtUserCallNoParam( ULONG code ) case NtUserCallNoParam_GetProcessDefaultLayout: return process_layout;
+ case NtUserCallNoParam_GetShellWindow: + return HandleToUlong( get_shell_window() ); + case NtUserCallNoParam_ReleaseCapture: return release_capture();
diff --git a/dlls/win32u/win32u_private.h b/dlls/win32u/win32u_private.h index 8fc00cf3296..1fe2f80da61 100644 --- a/dlls/win32u/win32u_private.h +++ b/dlls/win32u/win32u_private.h @@ -271,6 +271,7 @@ extern HWND get_capture(void) DECLSPEC_HIDDEN; extern BOOL get_cursor_pos( POINT *pt ) DECLSPEC_HIDDEN; extern HWND get_focus(void) DECLSPEC_HIDDEN; extern DWORD get_input_state(void) DECLSPEC_HIDDEN; +extern HWND get_shell_window(void) DECLSPEC_HIDDEN; extern BOOL WINAPI release_capture(void) DECLSPEC_HIDDEN; extern BOOL set_capture_window( HWND hwnd, UINT gui_flags, HWND *prev_ret ) DECLSPEC_HIDDEN; extern BOOL set_caret_blink_time( unsigned int time ) DECLSPEC_HIDDEN; diff --git a/include/ntuser.h b/include/ntuser.h index 5b2b24a7f33..94d5326fc6e 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -910,6 +910,7 @@ enum NtUserCallNoParam_GetDialogBaseUnits, NtUserCallNoParam_GetInputState, NtUserCallNoParam_GetProcessDefaultLayout, + NtUserCallNoParam_GetShellWindow, NtUserCallNoParam_ReleaseCapture, /* temporary exports */ NtUserExitingThread, @@ -941,6 +942,11 @@ static inline DWORD NtUserGetProcessDefaultLayout(void) return NtUserCallNoParam( NtUserCallNoParam_GetProcessDefaultLayout ); }
+static inline HWND NtUserGetShellWindow(void) +{ + return UlongToHandle( NtUserCallNoParam( NtUserCallNoParam_GetShellWindow )); +} + static inline BOOL NtUserReleaseCapture(void) { return NtUserCallNoParam( NtUserCallNoParam_ReleaseCapture );