Commit 72316326 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

win32u: Move GetWindowDpiAwarenessContext from user32.

parent cc20ef3b
...@@ -2090,30 +2090,7 @@ BOOL WINAPI IsWindowUnicode( HWND hwnd ) ...@@ -2090,30 +2090,7 @@ BOOL WINAPI IsWindowUnicode( HWND hwnd )
*/ */
DPI_AWARENESS_CONTEXT WINAPI GetWindowDpiAwarenessContext( HWND hwnd ) DPI_AWARENESS_CONTEXT WINAPI GetWindowDpiAwarenessContext( HWND hwnd )
{ {
WND *win; return (DPI_AWARENESS_CONTEXT)NtUserCallHwnd( hwnd, NtUserGetWindowDpiAwarenessContext );
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;
} }
......
...@@ -184,7 +184,7 @@ struct unix_funcs ...@@ -184,7 +184,7 @@ struct unix_funcs
BOOL (WINAPI *pNtGdiUpdateColors)( HDC hdc ); BOOL (WINAPI *pNtGdiUpdateColors)( HDC hdc );
BOOL (WINAPI *pNtGdiWidenPath)( HDC hdc ); BOOL (WINAPI *pNtGdiWidenPath)( HDC hdc );
HKL (WINAPI *pNtUserActivateKeyboardLayout)( HKL layout, UINT flags ); 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 ); ULONG_PTR (WINAPI *pNtUserCallHwndParam)( HWND hwnd, DWORD_PTR param, DWORD code );
LRESULT (WINAPI *pNtUserCallNextHookEx)( HHOOK hhook, INT code, WPARAM wparam, LPARAM lparam ); LRESULT (WINAPI *pNtUserCallNextHookEx)( HHOOK hhook, INT code, WPARAM wparam, LPARAM lparam );
ULONG_PTR (WINAPI *pNtUserCallNoParam)( ULONG code ); ULONG_PTR (WINAPI *pNtUserCallNoParam)( ULONG code );
......
...@@ -679,6 +679,35 @@ static BOOL is_window_unicode( HWND hwnd ) ...@@ -679,6 +679,35 @@ static BOOL is_window_unicode( HWND hwnd )
return ret; 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 ) static LONG_PTR get_win_data( const void *ptr, UINT size )
{ {
if (size == sizeof(WORD)) if (size == sizeof(WORD))
...@@ -1082,12 +1111,14 @@ BOOL WINAPI NtUserFlashWindowEx( FLASHWINFO *info ) ...@@ -1082,12 +1111,14 @@ BOOL WINAPI NtUserFlashWindowEx( FLASHWINFO *info )
/***************************************************************************** /*****************************************************************************
* NtUserCallHwnd (win32u.@) * NtUserCallHwnd (win32u.@)
*/ */
DWORD WINAPI NtUserCallHwnd( HWND hwnd, DWORD code ) ULONG_PTR WINAPI NtUserCallHwnd( HWND hwnd, DWORD code )
{ {
switch (code) switch (code)
{ {
case NtUserGetParent: case NtUserGetParent:
return HandleToUlong( get_parent( hwnd )); return HandleToUlong( get_parent( hwnd ));
case NtUserGetWindowDpiAwarenessContext:
return (ULONG_PTR)get_window_dpi_awareness_context( hwnd );
case NtUserGetWindowTextLength: case NtUserGetWindowTextLength:
return get_server_window_text( hwnd, NULL, 0 ); return get_server_window_text( hwnd, NULL, 0 );
case NtUserIsWindow: case NtUserIsWindow:
......
...@@ -725,7 +725,7 @@ ULONG_PTR WINAPI NtUserCallTwoParam( ULONG_PTR arg1, ULONG_PTR arg2, ULONG code ...@@ -725,7 +725,7 @@ ULONG_PTR WINAPI NtUserCallTwoParam( ULONG_PTR arg1, ULONG_PTR arg2, ULONG code
return unix_funcs->pNtUserCallTwoParam( arg1, arg2, 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; if (!unix_funcs) return 0;
return unix_funcs->pNtUserCallHwnd( hwnd, code ); return unix_funcs->pNtUserCallHwnd( hwnd, code );
......
...@@ -142,6 +142,7 @@ enum ...@@ -142,6 +142,7 @@ enum
enum enum
{ {
NtUserGetParent, NtUserGetParent,
NtUserGetWindowDpiAwarenessContext,
NtUserGetWindowTextLength, NtUserGetWindowTextLength,
NtUserIsWindow, NtUserIsWindow,
NtUserIsWindowUnicode, NtUserIsWindowUnicode,
...@@ -254,7 +255,7 @@ BOOL WINAPI NtUserAddClipboardFormatListener( HWND hwnd ); ...@@ -254,7 +255,7 @@ BOOL WINAPI NtUserAddClipboardFormatListener( HWND hwnd );
BOOL WINAPI NtUserAttachThreadInput( DWORD from, DWORD to, BOOL attach ); BOOL WINAPI NtUserAttachThreadInput( DWORD from, DWORD to, BOOL attach );
NTSTATUS WINAPI NtUserBuildHwndList( HDESK desktop, ULONG unk2, ULONG unk3, ULONG unk4, NTSTATUS WINAPI NtUserBuildHwndList( HDESK desktop, ULONG unk2, ULONG unk3, ULONG unk4,
ULONG thread_id, ULONG count, HWND *buffer, ULONG *size ); 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 ); ULONG_PTR WINAPI NtUserCallHwndParam( HWND hwnd, DWORD_PTR param, DWORD code );
LRESULT WINAPI NtUserCallNextHookEx( HHOOK hhook, INT code, WPARAM wparam, LPARAM lparam ); LRESULT WINAPI NtUserCallNextHookEx( HHOOK hhook, INT code, WPARAM wparam, LPARAM lparam );
ULONG_PTR WINAPI NtUserCallNoParam( ULONG code ); ULONG_PTR WINAPI NtUserCallNoParam( ULONG code );
......
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