win32u: Move GetWindowDpiAwarenessContext from user32.
Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Huw Davies <huw@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
cc20ef3b3b
commit
7231632635
|
@ -2090,30 +2090,7 @@ BOOL WINAPI IsWindowUnicode( HWND hwnd )
|
|||
*/
|
||||
DPI_AWARENESS_CONTEXT WINAPI GetWindowDpiAwarenessContext( HWND hwnd )
|
||||
{
|
||||
WND *win;
|
||||
DPI_AWARENESS_CONTEXT ret = 0;
|
||||
|
||||
if (!(win = WIN_GetPtr( hwnd )))
|
||||
{
|
||||
SetLastError( ERROR_INVALID_WINDOW_HANDLE );
|
||||
return 0;
|
||||
}
|
||||
if (win == WND_DESKTOP) return DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE;
|
||||
if (win != WND_OTHER_PROCESS)
|
||||
{
|
||||
ret = ULongToHandle( win->dpi_awareness | 0x10 );
|
||||
WIN_ReleasePtr( win );
|
||||
}
|
||||
else
|
||||
{
|
||||
SERVER_START_REQ( get_window_info )
|
||||
{
|
||||
req->handle = wine_server_user_handle( hwnd );
|
||||
if (!wine_server_call_err( req )) ret = ULongToHandle( reply->awareness | 0x10 );
|
||||
}
|
||||
SERVER_END_REQ;
|
||||
}
|
||||
return ret;
|
||||
return (DPI_AWARENESS_CONTEXT)NtUserCallHwnd( hwnd, NtUserGetWindowDpiAwarenessContext );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -184,7 +184,7 @@ struct unix_funcs
|
|||
BOOL (WINAPI *pNtGdiUpdateColors)( HDC hdc );
|
||||
BOOL (WINAPI *pNtGdiWidenPath)( HDC hdc );
|
||||
HKL (WINAPI *pNtUserActivateKeyboardLayout)( HKL layout, UINT flags );
|
||||
DWORD (WINAPI *pNtUserCallHwnd)( HWND hwnd, DWORD code );
|
||||
ULONG_PTR (WINAPI *pNtUserCallHwnd)( HWND hwnd, DWORD code );
|
||||
ULONG_PTR (WINAPI *pNtUserCallHwndParam)( HWND hwnd, DWORD_PTR param, DWORD code );
|
||||
LRESULT (WINAPI *pNtUserCallNextHookEx)( HHOOK hhook, INT code, WPARAM wparam, LPARAM lparam );
|
||||
ULONG_PTR (WINAPI *pNtUserCallNoParam)( ULONG code );
|
||||
|
|
|
@ -679,6 +679,35 @@ static BOOL is_window_unicode( HWND hwnd )
|
|||
return ret;
|
||||
}
|
||||
|
||||
/* see GetWindowDpiAwarenessContext */
|
||||
static DPI_AWARENESS_CONTEXT get_window_dpi_awareness_context( HWND hwnd )
|
||||
{
|
||||
DPI_AWARENESS_CONTEXT ret = 0;
|
||||
WND *win;
|
||||
|
||||
if (!(win = get_win_ptr( hwnd )))
|
||||
{
|
||||
SetLastError( ERROR_INVALID_WINDOW_HANDLE );
|
||||
return 0;
|
||||
}
|
||||
if (win == WND_DESKTOP) return DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE;
|
||||
if (win != WND_OTHER_PROCESS)
|
||||
{
|
||||
ret = ULongToHandle( win->dpi_awareness | 0x10 );
|
||||
release_win_ptr( win );
|
||||
}
|
||||
else
|
||||
{
|
||||
SERVER_START_REQ( get_window_info )
|
||||
{
|
||||
req->handle = wine_server_user_handle( hwnd );
|
||||
if (!wine_server_call_err( req )) ret = ULongToHandle( reply->awareness | 0x10 );
|
||||
}
|
||||
SERVER_END_REQ;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
static LONG_PTR get_win_data( const void *ptr, UINT size )
|
||||
{
|
||||
if (size == sizeof(WORD))
|
||||
|
@ -1082,12 +1111,14 @@ BOOL WINAPI NtUserFlashWindowEx( FLASHWINFO *info )
|
|||
/*****************************************************************************
|
||||
* NtUserCallHwnd (win32u.@)
|
||||
*/
|
||||
DWORD WINAPI NtUserCallHwnd( HWND hwnd, DWORD code )
|
||||
ULONG_PTR WINAPI NtUserCallHwnd( HWND hwnd, DWORD code )
|
||||
{
|
||||
switch (code)
|
||||
{
|
||||
case NtUserGetParent:
|
||||
return HandleToUlong( get_parent( hwnd ));
|
||||
case NtUserGetWindowDpiAwarenessContext:
|
||||
return (ULONG_PTR)get_window_dpi_awareness_context( hwnd );
|
||||
case NtUserGetWindowTextLength:
|
||||
return get_server_window_text( hwnd, NULL, 0 );
|
||||
case NtUserIsWindow:
|
||||
|
|
|
@ -725,7 +725,7 @@ ULONG_PTR WINAPI NtUserCallTwoParam( ULONG_PTR arg1, ULONG_PTR arg2, ULONG code
|
|||
return unix_funcs->pNtUserCallTwoParam( arg1, arg2, code );
|
||||
}
|
||||
|
||||
DWORD WINAPI NtUserCallHwnd( HWND hwnd, DWORD code )
|
||||
ULONG_PTR WINAPI NtUserCallHwnd( HWND hwnd, DWORD code )
|
||||
{
|
||||
if (!unix_funcs) return 0;
|
||||
return unix_funcs->pNtUserCallHwnd( hwnd, code );
|
||||
|
|
|
@ -142,6 +142,7 @@ enum
|
|||
enum
|
||||
{
|
||||
NtUserGetParent,
|
||||
NtUserGetWindowDpiAwarenessContext,
|
||||
NtUserGetWindowTextLength,
|
||||
NtUserIsWindow,
|
||||
NtUserIsWindowUnicode,
|
||||
|
@ -254,7 +255,7 @@ BOOL WINAPI NtUserAddClipboardFormatListener( HWND hwnd );
|
|||
BOOL WINAPI NtUserAttachThreadInput( DWORD from, DWORD to, BOOL attach );
|
||||
NTSTATUS WINAPI NtUserBuildHwndList( HDESK desktop, ULONG unk2, ULONG unk3, ULONG unk4,
|
||||
ULONG thread_id, ULONG count, HWND *buffer, ULONG *size );
|
||||
DWORD WINAPI NtUserCallHwnd( HWND hwnd, DWORD code );
|
||||
ULONG_PTR WINAPI NtUserCallHwnd( HWND hwnd, DWORD code );
|
||||
ULONG_PTR WINAPI NtUserCallHwndParam( HWND hwnd, DWORD_PTR param, DWORD code );
|
||||
LRESULT WINAPI NtUserCallNextHookEx( HHOOK hhook, INT code, WPARAM wparam, LPARAM lparam );
|
||||
ULONG_PTR WINAPI NtUserCallNoParam( ULONG code );
|
||||
|
|
Loading…
Reference in New Issue