From: Rémi Bernon rbernon@codeweavers.com
--- dlls/user32/win.c | 6 ++++-- dlls/win32u/dce.c | 2 +- dlls/win32u/defwnd.c | 6 +++--- dlls/win32u/input.c | 2 +- dlls/win32u/menu.c | 2 +- dlls/win32u/scroll.c | 6 +++--- dlls/win32u/win32u_private.h | 2 +- dlls/win32u/window.c | 23 ++++++++++++----------- dlls/wineandroid.drv/android.h | 1 + dlls/wineandroid.drv/init.c | 2 +- dlls/wineandroid.drv/window.c | 2 +- dlls/winemac.drv/window.c | 4 ++-- dlls/winevulkan/vulkan.c | 19 +++++++++++++++---- dlls/winex11.drv/event.c | 7 ++++--- dlls/winex11.drv/opengl.c | 2 +- dlls/winex11.drv/window.c | 5 ++--- dlls/winex11.drv/x11drv.h | 1 + dlls/wow64win/user.c | 16 ++++++++++++++++ include/ntuser.h | 20 ++++++++++++++------ 19 files changed, 84 insertions(+), 44 deletions(-)
diff --git a/dlls/user32/win.c b/dlls/user32/win.c index b17ae73d97f..2aa06b1dccb 100644 --- a/dlls/user32/win.c +++ b/dlls/user32/win.c @@ -673,7 +673,8 @@ void WINAPI SwitchToThisWindow( HWND hwnd, BOOL alt_tab ) */ BOOL WINAPI GetWindowRect( HWND hwnd, RECT *rect ) { - BOOL ret = NtUserGetWindowRect( hwnd, rect ); + UINT dpi = NTUSER_DPI_CONTEXT_GET_DPI( (UINT_PTR)GetThreadDpiAwarenessContext() ); + BOOL ret = NtUserGetWindowRect( hwnd, rect, dpi ); if (ret) TRACE( "hwnd %p %s\n", hwnd, wine_dbgstr_rect(rect) ); return ret; } @@ -715,7 +716,8 @@ int WINAPI GetWindowRgnBox( HWND hwnd, RECT *rect ) */ BOOL WINAPI GetClientRect( HWND hwnd, RECT *rect ) { - return NtUserGetClientRect( hwnd, rect ); + UINT dpi = NTUSER_DPI_CONTEXT_GET_DPI( (UINT_PTR)GetThreadDpiAwarenessContext() ); + return NtUserGetClientRect( hwnd, rect, dpi ); }
diff --git a/dlls/win32u/dce.c b/dlls/win32u/dce.c index 878e0153272..2ab154f6c7c 100644 --- a/dlls/win32u/dce.c +++ b/dlls/win32u/dce.c @@ -1651,7 +1651,7 @@ INT WINAPI NtUserScrollWindowEx( HWND hwnd, INT dx, INT dy, const RECT *rect, if (!is_window_drawable( hwnd, TRUE )) return ERROR; hwnd = get_full_window_handle( hwnd );
- get_client_rect( hwnd, &rc ); + get_client_rect( hwnd, &rc, get_thread_dpi() ); if (clip_rect) intersect_rect( &cliprc, &rc, clip_rect ); else cliprc = rc;
diff --git a/dlls/win32u/defwnd.c b/dlls/win32u/defwnd.c index 9524b1956cc..82241dff3f4 100644 --- a/dlls/win32u/defwnd.c +++ b/dlls/win32u/defwnd.c @@ -716,7 +716,7 @@ static void sys_command_size_move( HWND hwnd, WPARAM wparam ) if (style & WS_CHILD) { parent = get_parent( hwnd ); - get_client_rect( parent, &mouse_rect ); + get_client_rect( parent, &mouse_rect, get_thread_dpi() ); map_window_points( parent, 0, (POINT *)&mouse_rect, 2, dpi ); map_window_points( parent, 0, (POINT *)&sizing_rect, 2, dpi ); } @@ -2522,7 +2522,7 @@ LRESULT default_window_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, RECT rc; int x, y;
- get_client_rect( hwnd, &rc ); + get_client_rect( hwnd, &rc, get_thread_dpi() ); x = (rc.right - rc.left - get_system_metrics( SM_CXICON )) / 2; y = (rc.bottom - rc.top - get_system_metrics( SM_CYICON )) / 2; TRACE( "Painting class icon: vis rect=(%s)\n", wine_dbgstr_rect(&ps.rcPaint) ); @@ -2585,7 +2585,7 @@ LRESULT default_window_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, if (get_class_long( hwnd, GCL_STYLE, FALSE ) & CS_PARENTDC) { /* can't use GetClipBox with a parent DC or we fill the whole parent */ - get_client_rect( hwnd, &rect ); + get_client_rect( hwnd, &rect, get_thread_dpi() ); NtGdiTransformPoints( hdc, (POINT *)&rect, (POINT *)&rect, 1, NtGdiDPtoLP ); } else NtGdiGetAppClipBox( hdc, &rect ); diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c index cddcfd22081..ab3144dbb68 100644 --- a/dlls/win32u/input.c +++ b/dlls/win32u/input.c @@ -2512,7 +2512,7 @@ BOOL clip_fullscreen_window( HWND hwnd, BOOL reset ) /* maximized windows don't count as full screen */ if ((style & WS_MAXIMIZE) && (style & WS_CAPTION) == WS_CAPTION) return FALSE;
- if (!NtUserGetWindowRect( hwnd, &rect )) return FALSE; + if (!NtUserGetWindowRect( hwnd, &rect, get_thread_dpi() )) return FALSE; if (!NtUserIsWindowRectFullScreen( &rect )) return FALSE; if (is_captured_by_system()) return FALSE; if (NtGetTickCount() - thread_info->clipping_reset < 1000) return FALSE; diff --git a/dlls/win32u/menu.c b/dlls/win32u/menu.c index b57093256e2..05eb5445395 100644 --- a/dlls/win32u/menu.c +++ b/dlls/win32u/menu.c @@ -2837,7 +2837,7 @@ static void draw_popup_menu( HWND hwnd, HDC hdc, HMENU hmenu )
TRACE( "wnd=%p dc=%p menu=%p\n", hwnd, hdc, hmenu );
- get_client_rect( hwnd, &rect ); + get_client_rect( hwnd, &rect, get_thread_dpi() );
if (menu && menu->hbrBack) brush = menu->hbrBack; if ((prev_hrush = NtGdiSelectBrush( hdc, brush )) diff --git a/dlls/win32u/scroll.c b/dlls/win32u/scroll.c index f34fe80c7e6..da52a7a4fba 100644 --- a/dlls/win32u/scroll.c +++ b/dlls/win32u/scroll.c @@ -220,7 +220,7 @@ static BOOL get_scroll_bar_rect( HWND hwnd, int bar, RECT *rect, int *arrow_size break;
case SB_CTL: - get_client_rect( hwnd, rect ); + get_client_rect( hwnd, rect, get_thread_dpi() ); vertical = (win->dwStyle & SBS_VERT) != 0; break;
@@ -312,7 +312,7 @@ static void draw_scroll_bar( HWND hwnd, HDC hdc, int bar, enum SCROLL_HITTEST hi
if (bar == SB_CTL && get_window_long( hwnd, GWL_STYLE ) & (SBS_SIZEGRIP | SBS_SIZEBOX)) { - get_client_rect( hwnd, ¶ms.rect ); + get_client_rect( hwnd, ¶ms.rect, get_thread_dpi() ); params.arrow_size = 0; params.thumb_pos = 0; params.thumb_size = 0; @@ -580,7 +580,7 @@ void handle_scroll_event( HWND hwnd, int bar, UINT msg, POINT pt ) g_tracking_info.hit_test = hittest = SCROLL_THUMB; break; case WM_MOUSEMOVE: - get_client_rect( get_parent( get_parent( hwnd )), &rect ); + get_client_rect( get_parent( get_parent( hwnd )), &rect, get_thread_dpi() ); prev_pt = pt; break; case WM_LBUTTONUP: diff --git a/dlls/win32u/win32u_private.h b/dlls/win32u/win32u_private.h index 856779b3fa0..375054e5ed7 100644 --- a/dlls/win32u/win32u_private.h +++ b/dlls/win32u/win32u_private.h @@ -216,7 +216,7 @@ extern BOOL client_to_screen( HWND hwnd, POINT *pt ); extern void destroy_thread_windows(void); extern LRESULT destroy_window( HWND hwnd ); extern BOOL enable_window( HWND hwnd, BOOL enable ); -extern BOOL get_client_rect( HWND hwnd, RECT *rect ); +extern BOOL get_client_rect( HWND hwnd, RECT *rect, UINT dpi ); extern HWND get_desktop_window(void); extern UINT get_dpi_for_window( HWND hwnd ); extern HWND get_full_window_handle( HWND hwnd ); diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index a35f544d8bc..bbc5b33e6b2 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -1682,9 +1682,9 @@ BOOL get_window_rect( HWND hwnd, RECT *rect, UINT dpi ) }
/* see GetClientRect */ -BOOL get_client_rect( HWND hwnd, RECT *rect ) +BOOL get_client_rect( HWND hwnd, RECT *rect, UINT dpi ) { - return get_window_rects( hwnd, COORDS_CLIENT, NULL, rect, get_thread_dpi() ); + return get_window_rects( hwnd, COORDS_CLIENT, NULL, rect, dpi ); }
/* see GetWindowInfo */ @@ -2275,7 +2275,7 @@ HWND WINAPI NtUserChildWindowFromPointEx( HWND parent, LONG x, LONG y, UINT flag RECT rect; HWND ret;
- get_client_rect( parent, &rect ); + get_client_rect( parent, &rect, get_thread_dpi() ); if (!PtInRect( &rect, pt )) return 0; if (!(list = list_window_children( 0, parent, NULL, 0 ))) return parent;
@@ -3840,7 +3840,7 @@ MINMAXINFO get_min_max_info( HWND hwnd ) else adjusted_style = style;
- get_client_rect( NtUserGetAncestor( hwnd, GA_PARENT ), &rc ); + get_client_rect( NtUserGetAncestor( hwnd, GA_PARENT ), &rc, get_thread_dpi() ); adjust_window_rect( &rc, adjusted_style, (style & WS_POPUP) && get_menu( hwnd ), exstyle, get_system_dpi() );
xinc = -rc.left; @@ -3990,7 +3990,7 @@ static POINT get_minimized_pos( HWND hwnd, POINT pt ) get_monitor_info( monitor, &mon_info ); parent_rect = mon_info.rcWork; } - else get_client_rect( parent, &parent_rect ); + else get_client_rect( parent, &parent_rect, get_thread_dpi() );
if (pt.x >= parent_rect.left && (pt.x + get_system_metrics( SM_CXMINIMIZED ) < parent_rect.right) && pt.y >= parent_rect.top && (pt.y + get_system_metrics( SM_CYMINIMIZED ) < parent_rect.bottom)) @@ -4174,7 +4174,7 @@ static UINT arrange_iconic_windows( HWND parent ) get_monitor_info( monitor, &mon_info ); parent_rect = mon_info.rcWork; } - else get_client_rect( parent, &parent_rect ); + else get_client_rect( parent, &parent_rect, get_thread_dpi() );
pt = get_first_minimized_child_pos( &parent_rect, &metrics, width, height );
@@ -5501,9 +5501,6 @@ ULONG_PTR WINAPI NtUserCallHwndParam( HWND hwnd, DWORD_PTR param, DWORD code ) case NtUserCallHwndParam_GetClassWord: return get_class_word( hwnd, param );
- case NtUserCallHwndParam_GetClientRect: - return get_client_rect( hwnd, (RECT *)param ); - case NtUserCallHwndParam_GetScrollInfo: { struct get_scroll_info_params *params = (void *)param; @@ -5525,8 +5522,12 @@ ULONG_PTR WINAPI NtUserCallHwndParam( HWND hwnd, DWORD_PTR param, DWORD code ) case NtUserCallHwndParam_GetWindowLongPtrW: return get_window_long_ptr( hwnd, param, FALSE );
- case NtUserCallHwndParam_GetWindowRect: - return get_window_rect( hwnd, (RECT *)param, get_thread_dpi() ); + case NtUserCallHwndParam_GetWindowRects: + { + struct get_window_rects_params *params = (void *)param; + return params->client ? get_client_rect( hwnd, params->rect, params->dpi ) + : get_window_rect( hwnd, params->rect, params->dpi ); + }
case NtUserCallHwndParam_GetWindowRelative: return HandleToUlong( get_window_relative( hwnd, param )); diff --git a/dlls/wineandroid.drv/android.h b/dlls/wineandroid.drv/android.h index 2512976089b..9902170aa78 100644 --- a/dlls/wineandroid.drv/android.h +++ b/dlls/wineandroid.drv/android.h @@ -132,6 +132,7 @@ extern HWND get_capture_window(void); extern void init_monitors( int width, int height ); extern void set_screen_dpi( DWORD dpi ); extern void update_keyboard_lock_state( WORD vkey, UINT state ); +extern UINT get_win_monitor_dpi( HWND hwnd );
/* JNI entry points */ extern void desktop_changed( JNIEnv *env, jobject obj, jint width, jint height ); diff --git a/dlls/wineandroid.drv/init.c b/dlls/wineandroid.drv/init.c index 5b4ec59d2fa..5c6878413bc 100644 --- a/dlls/wineandroid.drv/init.c +++ b/dlls/wineandroid.drv/init.c @@ -77,7 +77,7 @@ void init_monitors( int width, int height ) monitor_rc_work = virtual_screen_rect;
if (!hwnd || !NtUserIsWindowVisible( hwnd )) return; - if (!NtUserGetWindowRect( hwnd, &rect )) return; + if (!NtUserGetWindowRect( hwnd, &rect, get_win_monitor_dpi( hwnd ) )) return; if (rect.top) monitor_rc_work.bottom = rect.top; else monitor_rc_work.top = rect.bottom; TRACE( "found tray %p %s work area %s\n", hwnd, diff --git a/dlls/wineandroid.drv/window.c b/dlls/wineandroid.drv/window.c index 2cdfafc9e6e..0a2dcd448e6 100644 --- a/dlls/wineandroid.drv/window.c +++ b/dlls/wineandroid.drv/window.c @@ -104,7 +104,7 @@ static BOOL intersect_rect( RECT *dst, const RECT *src1, const RECT *src2 ) /********************************************************************** * get_win_monitor_dpi */ -static UINT get_win_monitor_dpi( HWND hwnd ) +UINT get_win_monitor_dpi( HWND hwnd ) { return NtUserGetSystemDpiForProcess( NULL ); /* FIXME: get monitor dpi */ } diff --git a/dlls/winemac.drv/window.c b/dlls/winemac.drv/window.c index b75b5aca8c6..51b4def82bc 100644 --- a/dlls/winemac.drv/window.c +++ b/dlls/winemac.drv/window.c @@ -546,7 +546,7 @@ static void sync_window_min_max_info(HWND hwnd)
if (!macdrv_get_cocoa_window(hwnd, FALSE)) return;
- NtUserGetWindowRect(hwnd, &win_rect); + NtUserGetWindowRect(hwnd, &win_rect, get_win_monitor_dpi(hwnd)); minmax.ptReserved.x = win_rect.left; minmax.ptReserved.y = win_rect.top;
@@ -1352,7 +1352,7 @@ static LRESULT move_window(HWND hwnd, WPARAM wparam) else captionHeight = 0;
- NtUserGetWindowRect(hwnd, &origRect); + NtUserGetWindowRect(hwnd, &origRect, get_win_monitor_dpi(hwnd)); movedRect = origRect;
if (!hittest) diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c index e7d00813a42..f6e06bcc085 100644 --- a/dlls/winevulkan/vulkan.c +++ b/dlls/winevulkan/vulkan.c @@ -37,6 +37,16 @@ static PFN_vkCreateInstance p_vkCreateInstance; static PFN_vkEnumerateInstanceVersion p_vkEnumerateInstanceVersion; static PFN_vkEnumerateInstanceExtensionProperties p_vkEnumerateInstanceExtensionProperties;
+ +/********************************************************************** + * get_win_monitor_dpi + */ +static UINT get_win_monitor_dpi( HWND hwnd ) +{ + return NtUserGetSystemDpiForProcess( NULL ); /* FIXME: get monitor dpi */ +} + + static int window_surface_compare(const void *key, const struct rb_entry *entry) { const struct wine_surface *surface = RB_ENTRY_VALUE(entry, struct wine_surface, window_entry); @@ -1643,7 +1653,7 @@ VkResult wine_vkAcquireNextImage2KHR(VkDevice device_handle, const VkAcquireNext acquire_info_host.swapchain = swapchain->host_swapchain; res = device->funcs.p_vkAcquireNextImage2KHR(device->host_device, &acquire_info_host, image_index);
- if (res == VK_SUCCESS && NtUserGetClientRect(surface->hwnd, &client_rect) && + if (res == VK_SUCCESS && NtUserGetClientRect(surface->hwnd, &client_rect, get_win_monitor_dpi(surface->hwnd)) && !extents_equals(&swapchain->extents, &client_rect)) { WARN("Swapchain size %dx%d does not match client rect %s, returning VK_SUBOPTIMAL_KHR\n", @@ -1666,7 +1676,7 @@ VkResult wine_vkAcquireNextImageKHR(VkDevice device_handle, VkSwapchainKHR swapc res = device->funcs.p_vkAcquireNextImageKHR(device->host_device, swapchain->host_swapchain, timeout, semaphore, fence, image_index);
- if (res == VK_SUCCESS && NtUserGetClientRect(surface->hwnd, &client_rect) && + if (res == VK_SUCCESS && NtUserGetClientRect(surface->hwnd, &client_rect, get_win_monitor_dpi(surface->hwnd)) && !extents_equals(&swapchain->extents, &client_rect)) { WARN("Swapchain size %dx%d does not match client rect %s, returning VK_SUBOPTIMAL_KHR\n", @@ -1774,7 +1784,7 @@ VkResult wine_vkQueuePresentKHR(VkQueue queue_handle, const VkPresentInfoKHR *pr RECT client_rect;
if (swapchain_res < VK_SUCCESS) continue; - if (!NtUserGetClientRect(surface->hwnd, &client_rect)) + if (!NtUserGetClientRect(surface->hwnd, &client_rect, get_win_monitor_dpi(surface->hwnd))) { WARN("Swapchain window %p is invalid, returning VK_ERROR_OUT_OF_DATE_KHR\n", surface->hwnd); if (present_info->pResults) present_info->pResults[i] = VK_ERROR_OUT_OF_DATE_KHR; @@ -2136,7 +2146,8 @@ static void adjust_surface_capabilities(struct wine_instance *instance, struct w capabilities->maxImageCount = max(capabilities->minImageCount, 16);
/* Update the image extents to match what the Win32 WSI would provide. */ - NtUserGetClientRect(surface->hwnd, &client_rect); + /* FIXME: handle DPI scaling, somehow */ + NtUserGetClientRect(surface->hwnd, &client_rect, get_win_monitor_dpi(surface->hwnd)); capabilities->minImageExtent.width = client_rect.right - client_rect.left; capabilities->minImageExtent.height = client_rect.bottom - client_rect.top; capabilities->maxImageExtent.width = client_rect.right - client_rect.left; diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index 2bc80cea5e9..7ba3be8d95e 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -536,7 +536,7 @@ static inline BOOL can_activate_window( HWND hwnd ) if (style & WS_MINIMIZE) return FALSE; if (NtUserGetWindowLongW( hwnd, GWL_EXSTYLE ) & WS_EX_NOACTIVATE) return FALSE; if (hwnd == NtUserGetDesktopWindow()) return FALSE; - if (NtUserGetWindowRect( hwnd, &rect ) && IsRectEmpty( &rect )) return FALSE; + if (NtUserGetWindowRect( hwnd, &rect, get_win_monitor_dpi( hwnd ) ) && IsRectEmpty( &rect )) return FALSE; return !(style & WS_DISABLED); }
@@ -1405,11 +1405,12 @@ void X11DRV_SetFocus( HWND hwnd )
static HWND find_drop_window( HWND hQueryWnd, LPPOINT lpPt ) { + UINT dpi = get_win_monitor_dpi( hQueryWnd ); RECT tempRect;
if (!NtUserIsWindowEnabled(hQueryWnd)) return 0;
- NtUserGetWindowRect(hQueryWnd, &tempRect); + NtUserGetWindowRect( hQueryWnd, &tempRect, dpi );
if(!PtInRect(&tempRect, *lpPt)) return 0;
@@ -1417,7 +1418,7 @@ static HWND find_drop_window( HWND hQueryWnd, LPPOINT lpPt ) { POINT pt = *lpPt; NtUserScreenToClient( hQueryWnd, &pt ); - NtUserGetClientRect( hQueryWnd, &tempRect ); + NtUserGetClientRect( hQueryWnd, &tempRect, dpi );
if (PtInRect( &tempRect, pt)) { diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c index 8ab3e3474d3..09105a8c842 100644 --- a/dlls/winex11.drv/opengl.c +++ b/dlls/winex11.drv/opengl.c @@ -1316,7 +1316,7 @@ static struct gl_drawable *create_gl_drawable( HWND hwnd, const struct glx_pixel RECT rect; int width, height;
- NtUserGetClientRect( hwnd, &rect ); + NtUserGetClientRect( hwnd, &rect, get_win_monitor_dpi( hwnd ) ); width = min( max( 1, rect.right ), 65535 ); height = min( max( 1, rect.bottom ), 65535 );
diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index a96c70b887b..31a0ca20874 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -116,7 +116,7 @@ static pthread_mutex_t win_data_mutex = PTHREAD_MUTEX_INITIALIZER; /********************************************************************** * get_win_monitor_dpi */ -static UINT get_win_monitor_dpi( HWND hwnd ) +UINT get_win_monitor_dpi( HWND hwnd ) { return NtUserGetSystemDpiForProcess( NULL ); /* FIXME: get monitor dpi */ } @@ -179,7 +179,6 @@ static void remove_startup_notification(Display *display, Window window) } }
- static BOOL is_managed( HWND hwnd ) { struct x11drv_win_data *data = get_win_data( hwnd ); @@ -1693,7 +1692,7 @@ Window create_client_window( HWND hwnd, const XVisualInfo *visual, Colormap colo HWND parent = NtUserGetAncestor( hwnd, GA_PARENT ); if (parent == NtUserGetDesktopWindow() || NtUserGetAncestor( parent, GA_PARENT )) return 0; if (!(data = alloc_win_data( thread_init_display(), hwnd ))) return 0; - NtUserGetClientRect( hwnd, &data->client_rect ); + NtUserGetClientRect( hwnd, &data->client_rect, get_win_monitor_dpi( hwnd ) ); data->window_rect = data->whole_rect = data->client_rect; }
diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 2a326b07a4c..f1cfb596b19 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -671,6 +671,7 @@ extern XContext winContext; /* X context to associate an X cursor to a Win32 cursor handle */ extern XContext cursor_context;
+extern UINT get_win_monitor_dpi( HWND hwnd ); extern BOOL is_current_process_focused(void); extern void X11DRV_SetFocus( HWND hwnd ); extern void set_window_cursor( Window window, HCURSOR handle ); diff --git a/dlls/wow64win/user.c b/dlls/wow64win/user.c index 33d4d786714..35bcbdf6c3e 100644 --- a/dlls/wow64win/user.c +++ b/dlls/wow64win/user.c @@ -1694,6 +1694,22 @@ NTSTATUS WINAPI wow64_NtUserCallHwndParam( UINT *args ) return NtUserCallHwndParam( hwnd, (UINT_PTR)&info, code ); }
+ case NtUserCallHwndParam_GetWindowRects: + { + struct + { + ULONG rect; + BOOL client; + UINT dpi; + } *params32 = UlongToPtr( param ); + struct get_window_rects_params params; + + params.rect = UlongToPtr( params32->rect ); + params.client = params32->client; + params.dpi = params32->dpi; + return NtUserCallHwndParam( hwnd, (UINT_PTR)¶ms, code ); + } + case NtUserCallHwndParam_MapWindowPoints: { struct diff --git a/include/ntuser.h b/include/ntuser.h index f26bce82806..fd955e44f7b 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -1253,14 +1253,13 @@ enum NtUserCallHwndParam_GetClassLongPtrA, NtUserCallHwndParam_GetClassLongPtrW, NtUserCallHwndParam_GetClassWord, - NtUserCallHwndParam_GetClientRect, NtUserCallHwndParam_GetScrollInfo, NtUserCallHwndParam_GetWindowInfo, NtUserCallHwndParam_GetWindowLongA, NtUserCallHwndParam_GetWindowLongW, NtUserCallHwndParam_GetWindowLongPtrA, NtUserCallHwndParam_GetWindowLongPtrW, - NtUserCallHwndParam_GetWindowRect, + NtUserCallHwndParam_GetWindowRects, NtUserCallHwndParam_GetWindowRelative, NtUserCallHwndParam_GetWindowThread, NtUserCallHwndParam_GetWindowWord, @@ -1279,6 +1278,13 @@ enum NtUserSetWindowStyle, };
+struct get_window_rects_params +{ + RECT *rect; + BOOL client; + UINT dpi; +}; + static inline BOOL NtUserClientToScreen( HWND hwnd, POINT *pt ) { return NtUserCallHwndParam( hwnd, (UINT_PTR)pt, NtUserCallHwndParam_ClientToScreen ); @@ -1319,9 +1325,10 @@ static inline WORD NtUserGetClassWord( HWND hwnd, INT offset ) return NtUserCallHwndParam( hwnd, offset, NtUserCallHwndParam_GetClassWord ); }
-static inline BOOL NtUserGetClientRect( HWND hwnd, RECT *rect ) +static inline BOOL NtUserGetClientRect( HWND hwnd, RECT *rect, UINT dpi ) { - return NtUserCallHwndParam( hwnd, (UINT_PTR)rect, NtUserCallHwndParam_GetClientRect ); + struct get_window_rects_params params = {.rect = rect, .client = TRUE, .dpi = dpi}; + return NtUserCallHwndParam( hwnd, (UINT_PTR)¶ms, NtUserCallHwndParam_GetWindowRects ); }
struct get_scroll_info_params @@ -1361,9 +1368,10 @@ static inline LONG NtUserGetWindowLongW( HWND hwnd, INT offset ) return NtUserCallHwndParam( hwnd, offset, NtUserCallHwndParam_GetWindowLongW ); }
-static inline BOOL NtUserGetWindowRect( HWND hwnd, RECT *rect ) +static inline BOOL NtUserGetWindowRect( HWND hwnd, RECT *rect, UINT dpi ) { - return NtUserCallHwndParam( hwnd, (UINT_PTR)rect, NtUserCallHwndParam_GetWindowRect ); + struct get_window_rects_params params = {.rect = rect, .client = FALSE, .dpi = dpi}; + return NtUserCallHwndParam( hwnd, (UINT_PTR)¶ms, NtUserCallHwndParam_GetWindowRects ); }
static inline HWND NtUserGetWindowRelative( HWND hwnd, UINT rel )