win32u: Move NtUserLogicalToPerMonitorDPIPhysicalPoint implementation from user32.

This commit is contained in:
Jacek Caban 2022-08-26 11:31:52 +02:00 committed by Alexandre Julliard
parent fd38290918
commit 352e24dcdf
8 changed files with 34 additions and 23 deletions

View file

@ -691,14 +691,6 @@ static POINT map_dpi_point( POINT pt, UINT dpi_from, UINT dpi_to )
return pt;
}
/**********************************************************************
* point_win_to_phys_dpi
*/
static POINT point_win_to_phys_dpi( HWND hwnd, POINT pt )
{
return map_dpi_point( pt, GetDpiForWindow( hwnd ), get_win_monitor_dpi( hwnd ) );
}
/**********************************************************************
* point_phys_to_win_dpi
*/
@ -879,19 +871,6 @@ DPI_AWARENESS_CONTEXT WINAPI SetThreadDpiAwarenessContext( DPI_AWARENESS_CONTEXT
return ULongToHandle( prev );
}
/**********************************************************************
* LogicalToPhysicalPointForPerMonitorDPI (USER32.@)
*/
BOOL WINAPI LogicalToPhysicalPointForPerMonitorDPI( HWND hwnd, POINT *pt )
{
RECT rect;
if (!GetWindowRect( hwnd, &rect )) return FALSE;
if (pt->x < rect.left || pt->y < rect.top || pt->x > rect.right || pt->y > rect.bottom) return FALSE;
*pt = point_win_to_phys_dpi( hwnd, *pt );
return TRUE;
}
/**********************************************************************
* PhysicalToLogicalPointForPerMonitorDPI (USER32.@)
*/

View file

@ -513,7 +513,7 @@
@ stdcall LockWindowUpdate(long) NtUserLockWindowUpdate
@ stdcall LockWorkStation()
@ stdcall LogicalToPhysicalPoint(long ptr)
@ stdcall LogicalToPhysicalPointForPerMonitorDPI(long ptr)
@ stdcall LogicalToPhysicalPointForPerMonitorDPI(long ptr) NtUserLogicalToPerMonitorDPIPhysicalPoint
@ stdcall LookupIconIdFromDirectory(ptr long)
@ stdcall LookupIconIdFromDirectoryEx(ptr long long long long)
@ stub MBToWCSEx

View file

@ -218,6 +218,7 @@ static void * const syscalls[] =
NtUserIsClipboardFormatAvailable,
NtUserKillTimer,
NtUserLockWindowUpdate,
NtUserLogicalToPerMonitorDPIPhysicalPoint,
NtUserMapVirtualKeyEx,
NtUserMenuItemFromPoint,
NtUserMessageCall,

View file

@ -1720,6 +1720,14 @@ POINT map_dpi_point( POINT pt, UINT dpi_from, UINT dpi_to )
return pt;
}
/**********************************************************************
* point_win_to_phys_dpi
*/
static POINT point_win_to_phys_dpi( HWND hwnd, POINT pt )
{
return map_dpi_point( pt, get_dpi_for_window( hwnd ), get_win_monitor_dpi( hwnd ) );
}
/**********************************************************************
* point_phys_to_win_dpi
*/
@ -2440,6 +2448,19 @@ BOOL WINAPI NtUserGetDpiForMonitor( HMONITOR monitor, UINT type, UINT *x, UINT *
return TRUE;
}
/**********************************************************************
* LogicalToPhysicalPointForPerMonitorDPI (win32u.@)
*/
BOOL WINAPI NtUserLogicalToPerMonitorDPIPhysicalPoint( HWND hwnd, POINT *pt )
{
RECT rect;
if (!get_window_rect( hwnd, &rect, get_thread_dpi() )) return FALSE;
if (pt->x < rect.left || pt->y < rect.top || pt->x > rect.right || pt->y > rect.bottom) return FALSE;
*pt = point_win_to_phys_dpi( hwnd, *pt );
return TRUE;
}
/* retrieve the cached base keys for a given entry */
static BOOL get_base_keys( enum parameter_key index, HKEY *base_key, HKEY *volatile_key )
{

View file

@ -1067,7 +1067,7 @@
@ stub NtUserLockWindowStation
@ stdcall -syscall NtUserLockWindowUpdate(long)
@ stub NtUserLockWorkStation
@ stub NtUserLogicalToPerMonitorDPIPhysicalPoint
@ stdcall -syscall NtUserLogicalToPerMonitorDPIPhysicalPoint(long ptr)
@ stub NtUserLogicalToPhysicalDpiPointForWindow
@ stub NtUserLogicalToPhysicalPoint
@ stub NtUserMNDragLeave

View file

@ -204,6 +204,7 @@
SYSCALL_ENTRY( NtUserIsClipboardFormatAvailable ) \
SYSCALL_ENTRY( NtUserKillTimer ) \
SYSCALL_ENTRY( NtUserLockWindowUpdate ) \
SYSCALL_ENTRY( NtUserLogicalToPerMonitorDPIPhysicalPoint ) \
SYSCALL_ENTRY( NtUserMapVirtualKeyEx ) \
SYSCALL_ENTRY( NtUserMenuItemFromPoint ) \
SYSCALL_ENTRY( NtUserMessageCall ) \

View file

@ -2665,6 +2665,14 @@ NTSTATUS WINAPI wow64_NtUserLockWindowUpdate( UINT *args )
return NtUserLockWindowUpdate( hwnd );
}
NTSTATUS WINAPI wow64_NtUserLogicalToPerMonitorDPIPhysicalPoint( UINT *args )
{
HWND hwnd = get_handle( &args );
POINT *pt = get_ptr( &args );
return NtUserLogicalToPerMonitorDPIPhysicalPoint( hwnd, pt );
}
NTSTATUS WINAPI wow64_NtUserMapVirtualKeyEx( UINT *args )
{
UINT code = get_ulong( &args );

View file

@ -773,6 +773,7 @@ BOOL WINAPI NtUserInvalidateRect( HWND hwnd, const RECT *rect, BOOL erase );
BOOL WINAPI NtUserInvalidateRgn( HWND hwnd, HRGN hrgn, BOOL erase );
BOOL WINAPI NtUserKillTimer( HWND hwnd, UINT_PTR id );
BOOL WINAPI NtUserLockWindowUpdate( HWND hwnd );
BOOL WINAPI NtUserLogicalToPerMonitorDPIPhysicalPoint( HWND hwnd, POINT *pt );
UINT WINAPI NtUserMapVirtualKeyEx( UINT code, UINT type, HKL layout );
INT WINAPI NtUserMenuItemFromPoint( HWND hwnd, HMENU handle, int x, int y );
LRESULT WINAPI NtUserMessageCall( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam,