Module: wine Branch: master Commit: f5c82753298ec76be0e32884859ee5cc9b516326 URL: https://gitlab.winehq.org/wine/wine/-/commit/f5c82753298ec76be0e32884859ee5c...
Author: Jacek Caban jacek@codeweavers.com Date: Thu Dec 8 01:08:25 2022 +0100
win32u: Move NtUserGetInternalWindowPos implementation from user32.
---
dlls/user32/user32.spec | 2 +- dlls/user32/winpos.c | 19 ------------------- dlls/win32u/syscall.c | 1 + dlls/win32u/win32u.spec | 2 +- dlls/win32u/window.c | 14 ++++++++++++++ dlls/wow64win/syscall.h | 1 + dlls/wow64win/user.c | 9 +++++++++ include/ntuser.h | 1 + 8 files changed, 28 insertions(+), 21 deletions(-)
diff --git a/dlls/user32/user32.spec b/dlls/user32/user32.spec index 6f827144935..a53d02cd064 100644 --- a/dlls/user32/user32.spec +++ b/dlls/user32/user32.spec @@ -314,7 +314,7 @@ @ stdcall GetIconInfoExW(long ptr) @ stub GetInputDesktop @ stdcall GetInputState() -@ stdcall GetInternalWindowPos(long ptr ptr) +@ stdcall GetInternalWindowPos(long ptr ptr) NtUserGetInternalWindowPos @ stdcall GetKBCodePage() @ stdcall GetKeyNameTextA(long ptr long) @ stdcall GetKeyNameTextW(long ptr long) NtUserGetKeyNameText diff --git a/dlls/user32/winpos.c b/dlls/user32/winpos.c index 00f82c33538..6e2c892f2b7 100644 --- a/dlls/user32/winpos.c +++ b/dlls/user32/winpos.c @@ -195,25 +195,6 @@ BOOL WINAPI BringWindowToTop( HWND hwnd ) }
-/*********************************************************************** - * GetInternalWindowPos (USER32.@) - */ -UINT WINAPI GetInternalWindowPos( HWND hwnd, LPRECT rectWnd, - LPPOINT ptIcon ) -{ - WINDOWPLACEMENT wndpl; - - wndpl.length = sizeof(wndpl); - if (NtUserGetWindowPlacement( hwnd, &wndpl )) - { - if (rectWnd) *rectWnd = wndpl.rcNormalPosition; - if (ptIcon) *ptIcon = wndpl.ptMinPosition; - return wndpl.showCmd; - } - return 0; -} - - /*********************************************************************** * AnimateWindow (USER32.@) * Shows/Hides a window with an animation diff --git a/dlls/win32u/syscall.c b/dlls/win32u/syscall.c index 6aacfa47f2b..6c59c91b5b0 100644 --- a/dlls/win32u/syscall.c +++ b/dlls/win32u/syscall.c @@ -178,6 +178,7 @@ static void * const syscalls[] = NtUserGetGUIThreadInfo, NtUserGetIconInfo, NtUserGetIconSize, + NtUserGetInternalWindowPos, NtUserGetKeyNameText, NtUserGetKeyState, NtUserGetKeyboardLayout, diff --git a/dlls/win32u/win32u.spec b/dlls/win32u/win32u.spec index e2d84238008..1ffcfcaef5a 100644 --- a/dlls/win32u/win32u.spec +++ b/dlls/win32u/win32u.spec @@ -943,7 +943,7 @@ @ stub NtUserGetInteractiveControlDeviceInfo @ stub NtUserGetInteractiveControlInfo @ stub NtUserGetInteractiveCtrlSupportedWaveforms -@ stub NtUserGetInternalWindowPos +@ stdcall -syscall NtUserGetInternalWindowPos(long ptr ptr) @ stdcall -syscall NtUserGetKeyNameText(long ptr long) @ stdcall -syscall NtUserGetKeyState(long) @ stdcall -syscall NtUserGetKeyboardLayout(long) diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index 5074f255fd8..24931eab199 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -2495,6 +2495,20 @@ static void make_rect_onscreen( RECT *rect ) } }
+/*********************************************************************** + * NtUserGetInternalWindowPos (win32u.@) + */ +UINT WINAPI NtUserGetInternalWindowPos( HWND hwnd, RECT *rect, POINT *pt ) +{ + WINDOWPLACEMENT placement; + + placement.length = sizeof(placement); + if (!NtUserGetWindowPlacement( hwnd, &placement )) return 0; + if (rect) *rect = placement.rcNormalPosition; + if (pt) *pt = placement.ptMinPosition; + return placement.showCmd; +} + /* make sure the specified point is visible on screen */ static void make_point_onscreen( POINT *pt ) { diff --git a/dlls/wow64win/syscall.h b/dlls/wow64win/syscall.h index 1730b6a1f60..24e52a2a476 100644 --- a/dlls/wow64win/syscall.h +++ b/dlls/wow64win/syscall.h @@ -164,6 +164,7 @@ SYSCALL_ENTRY( NtUserGetGUIThreadInfo ) \ SYSCALL_ENTRY( NtUserGetIconInfo ) \ SYSCALL_ENTRY( NtUserGetIconSize ) \ + SYSCALL_ENTRY( NtUserGetInternalWindowPos ) \ SYSCALL_ENTRY( NtUserGetKeyNameText ) \ SYSCALL_ENTRY( NtUserGetKeyState ) \ SYSCALL_ENTRY( NtUserGetKeyboardLayout ) \ diff --git a/dlls/wow64win/user.c b/dlls/wow64win/user.c index 831ee2e84fc..c8354e6b04a 100644 --- a/dlls/wow64win/user.c +++ b/dlls/wow64win/user.c @@ -2050,6 +2050,15 @@ NTSTATUS WINAPI wow64_NtUserGetIconSize( UINT *args ) return NtUserGetIconSize( handle, step, width, height ); }
+NTSTATUS WINAPI wow64_NtUserGetInternalWindowPos( UINT *args ) +{ + HWND hwnd = get_handle( &args ); + RECT *rect = get_ptr( &args ); + POINT *pt = get_ptr( &args ); + + return NtUserGetInternalWindowPos( hwnd, rect, pt ); +} + NTSTATUS WINAPI wow64_NtUserGetKeyNameText( UINT *args ) { LONG lparam = get_ulong( &args ); diff --git a/include/ntuser.h b/include/ntuser.h index 34e7f5240e7..2ca383c6e69 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -744,6 +744,7 @@ BOOL WINAPI NtUserGetGUIThreadInfo( DWORD id, GUITHREADINFO *info ); BOOL WINAPI NtUserGetIconInfo( HICON icon, ICONINFO *info, UNICODE_STRING *module, UNICODE_STRING *res_name, DWORD *bpp, LONG unk ); BOOL WINAPI NtUserGetIconSize( HICON handle, UINT step, LONG *width, LONG *height ); +UINT WINAPI NtUserGetInternalWindowPos( HWND hwnd, RECT *rect, POINT *pt ); INT WINAPI NtUserGetKeyNameText( LONG lparam, WCHAR *buffer, INT size ); SHORT WINAPI NtUserGetKeyState( INT vkey ); HKL WINAPI NtUserGetKeyboardLayout( DWORD thread_id );