Commit 352e24dc authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

win32u: Move NtUserLogicalToPerMonitorDPIPhysicalPoint implementation from user32.

parent fd382909
...@@ -692,14 +692,6 @@ static POINT map_dpi_point( POINT pt, UINT dpi_from, UINT dpi_to ) ...@@ -692,14 +692,6 @@ static POINT map_dpi_point( POINT pt, UINT dpi_from, UINT dpi_to )
} }
/********************************************************************** /**********************************************************************
* 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 * point_phys_to_win_dpi
*/ */
static POINT point_phys_to_win_dpi( HWND hwnd, POINT pt ) static POINT point_phys_to_win_dpi( HWND hwnd, POINT pt )
...@@ -880,19 +872,6 @@ DPI_AWARENESS_CONTEXT WINAPI SetThreadDpiAwarenessContext( DPI_AWARENESS_CONTEXT ...@@ -880,19 +872,6 @@ DPI_AWARENESS_CONTEXT WINAPI SetThreadDpiAwarenessContext( DPI_AWARENESS_CONTEXT
} }
/********************************************************************** /**********************************************************************
* 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.@) * PhysicalToLogicalPointForPerMonitorDPI (USER32.@)
*/ */
BOOL WINAPI PhysicalToLogicalPointForPerMonitorDPI( HWND hwnd, POINT *pt ) BOOL WINAPI PhysicalToLogicalPointForPerMonitorDPI( HWND hwnd, POINT *pt )
......
...@@ -513,7 +513,7 @@ ...@@ -513,7 +513,7 @@
@ stdcall LockWindowUpdate(long) NtUserLockWindowUpdate @ stdcall LockWindowUpdate(long) NtUserLockWindowUpdate
@ stdcall LockWorkStation() @ stdcall LockWorkStation()
@ stdcall LogicalToPhysicalPoint(long ptr) @ stdcall LogicalToPhysicalPoint(long ptr)
@ stdcall LogicalToPhysicalPointForPerMonitorDPI(long ptr) @ stdcall LogicalToPhysicalPointForPerMonitorDPI(long ptr) NtUserLogicalToPerMonitorDPIPhysicalPoint
@ stdcall LookupIconIdFromDirectory(ptr long) @ stdcall LookupIconIdFromDirectory(ptr long)
@ stdcall LookupIconIdFromDirectoryEx(ptr long long long long) @ stdcall LookupIconIdFromDirectoryEx(ptr long long long long)
@ stub MBToWCSEx @ stub MBToWCSEx
......
...@@ -218,6 +218,7 @@ static void * const syscalls[] = ...@@ -218,6 +218,7 @@ static void * const syscalls[] =
NtUserIsClipboardFormatAvailable, NtUserIsClipboardFormatAvailable,
NtUserKillTimer, NtUserKillTimer,
NtUserLockWindowUpdate, NtUserLockWindowUpdate,
NtUserLogicalToPerMonitorDPIPhysicalPoint,
NtUserMapVirtualKeyEx, NtUserMapVirtualKeyEx,
NtUserMenuItemFromPoint, NtUserMenuItemFromPoint,
NtUserMessageCall, NtUserMessageCall,
......
...@@ -1721,6 +1721,14 @@ POINT map_dpi_point( POINT pt, UINT dpi_from, UINT dpi_to ) ...@@ -1721,6 +1721,14 @@ POINT map_dpi_point( POINT pt, UINT dpi_from, UINT dpi_to )
} }
/********************************************************************** /**********************************************************************
* 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 * point_phys_to_win_dpi
*/ */
POINT point_phys_to_win_dpi( HWND hwnd, POINT pt ) POINT point_phys_to_win_dpi( HWND hwnd, POINT pt )
...@@ -2440,6 +2448,19 @@ BOOL WINAPI NtUserGetDpiForMonitor( HMONITOR monitor, UINT type, UINT *x, UINT * ...@@ -2440,6 +2448,19 @@ BOOL WINAPI NtUserGetDpiForMonitor( HMONITOR monitor, UINT type, UINT *x, UINT *
return TRUE; 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 */ /* retrieve the cached base keys for a given entry */
static BOOL get_base_keys( enum parameter_key index, HKEY *base_key, HKEY *volatile_key ) static BOOL get_base_keys( enum parameter_key index, HKEY *base_key, HKEY *volatile_key )
{ {
......
...@@ -1067,7 +1067,7 @@ ...@@ -1067,7 +1067,7 @@
@ stub NtUserLockWindowStation @ stub NtUserLockWindowStation
@ stdcall -syscall NtUserLockWindowUpdate(long) @ stdcall -syscall NtUserLockWindowUpdate(long)
@ stub NtUserLockWorkStation @ stub NtUserLockWorkStation
@ stub NtUserLogicalToPerMonitorDPIPhysicalPoint @ stdcall -syscall NtUserLogicalToPerMonitorDPIPhysicalPoint(long ptr)
@ stub NtUserLogicalToPhysicalDpiPointForWindow @ stub NtUserLogicalToPhysicalDpiPointForWindow
@ stub NtUserLogicalToPhysicalPoint @ stub NtUserLogicalToPhysicalPoint
@ stub NtUserMNDragLeave @ stub NtUserMNDragLeave
......
...@@ -204,6 +204,7 @@ ...@@ -204,6 +204,7 @@
SYSCALL_ENTRY( NtUserIsClipboardFormatAvailable ) \ SYSCALL_ENTRY( NtUserIsClipboardFormatAvailable ) \
SYSCALL_ENTRY( NtUserKillTimer ) \ SYSCALL_ENTRY( NtUserKillTimer ) \
SYSCALL_ENTRY( NtUserLockWindowUpdate ) \ SYSCALL_ENTRY( NtUserLockWindowUpdate ) \
SYSCALL_ENTRY( NtUserLogicalToPerMonitorDPIPhysicalPoint ) \
SYSCALL_ENTRY( NtUserMapVirtualKeyEx ) \ SYSCALL_ENTRY( NtUserMapVirtualKeyEx ) \
SYSCALL_ENTRY( NtUserMenuItemFromPoint ) \ SYSCALL_ENTRY( NtUserMenuItemFromPoint ) \
SYSCALL_ENTRY( NtUserMessageCall ) \ SYSCALL_ENTRY( NtUserMessageCall ) \
......
...@@ -2665,6 +2665,14 @@ NTSTATUS WINAPI wow64_NtUserLockWindowUpdate( UINT *args ) ...@@ -2665,6 +2665,14 @@ NTSTATUS WINAPI wow64_NtUserLockWindowUpdate( UINT *args )
return NtUserLockWindowUpdate( hwnd ); 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 ) NTSTATUS WINAPI wow64_NtUserMapVirtualKeyEx( UINT *args )
{ {
UINT code = get_ulong( &args ); UINT code = get_ulong( &args );
......
...@@ -773,6 +773,7 @@ BOOL WINAPI NtUserInvalidateRect( HWND hwnd, const RECT *rect, BOOL erase ); ...@@ -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 NtUserInvalidateRgn( HWND hwnd, HRGN hrgn, BOOL erase );
BOOL WINAPI NtUserKillTimer( HWND hwnd, UINT_PTR id ); BOOL WINAPI NtUserKillTimer( HWND hwnd, UINT_PTR id );
BOOL WINAPI NtUserLockWindowUpdate( HWND hwnd ); BOOL WINAPI NtUserLockWindowUpdate( HWND hwnd );
BOOL WINAPI NtUserLogicalToPerMonitorDPIPhysicalPoint( HWND hwnd, POINT *pt );
UINT WINAPI NtUserMapVirtualKeyEx( UINT code, UINT type, HKL layout ); UINT WINAPI NtUserMapVirtualKeyEx( UINT code, UINT type, HKL layout );
INT WINAPI NtUserMenuItemFromPoint( HWND hwnd, HMENU handle, int x, int y ); INT WINAPI NtUserMenuItemFromPoint( HWND hwnd, HMENU handle, int x, int y );
LRESULT WINAPI NtUserMessageCall( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, LRESULT WINAPI NtUserMessageCall( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment