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

win32u: Implement NtUserGetSystemDpiForProcess.

parent aab62429
......@@ -1197,7 +1197,6 @@ static DWORD_ENTRY( FONTSMOOTHINGORIENTATION, FE_FONTSMOOTHINGORIENTATIONRGB, DE
static DWORD_ENTRY( FONTSMOOTHINGTYPE, FE_FONTSMOOTHINGSTANDARD, DESKTOP_KEY, L"FontSmoothingType" );
static DWORD_ENTRY( FOREGROUNDFLASHCOUNT, 3, DESKTOP_KEY, L"ForegroundFlashCount" );
static DWORD_ENTRY( FOREGROUNDLOCKTIMEOUT, 0, DESKTOP_KEY, L"ForegroundLockTimeout" );
static DWORD_ENTRY( LOGPIXELS, 0, DESKTOP_KEY, L"LogPixels" );
static DWORD_ENTRY( MOUSECLICKLOCKTIME, 1200, DESKTOP_KEY, L"ClickLockTime" );
static DWORD_ENTRY( AUDIODESC_LOCALE, 0, AUDIODESC_KEY, L"Locale" );
......@@ -1356,19 +1355,7 @@ void SYSPARAMS_Init(void)
RegCloseKey( key );
get_dword_entry( (union sysparam_all_entry *)&entry_LOGPIXELS, 0, &system_dpi, 0 );
if (!system_dpi) /* check fallback key */
{
if (!RegOpenKeyW( HKEY_CURRENT_CONFIG, L"Software\\Fonts", &key ))
{
DWORD type, size = sizeof(system_dpi);
if (RegQueryValueExW( key, L"LogPixels", NULL, &type, (void *)&system_dpi, &size ) ||
type != REG_DWORD)
system_dpi = 0;
RegCloseKey( key );
}
}
if (!system_dpi) system_dpi = USER_DEFAULT_SCREEN_DPI;
system_dpi = NtUserGetSystemDpiForProcess( NULL );
/* FIXME: what do the DpiScalingVer flags mean? */
get_dword_entry( (union sysparam_all_entry *)&entry_DPISCALINGVER, 0, &dpi_scaling, 0 );
......
......@@ -608,11 +608,11 @@ HKEY reg_open_hkcu_key( const char *name )
return reg_open_key( hkcu_key, nameW, asciiz_to_unicode( nameW, name ) - sizeof(WCHAR) );
}
void set_reg_value( HKEY hkey, const WCHAR *name, UINT type, const void *value, DWORD count )
BOOL set_reg_value( HKEY hkey, const WCHAR *name, UINT type, const void *value, DWORD count )
{
unsigned int name_size = name ? lstrlenW( name ) * sizeof(WCHAR) : 0;
UNICODE_STRING nameW = { name_size, name_size, (WCHAR *)name };
NtSetValueKey( hkey, &nameW, 0, type, value, count );
return !NtSetValueKey( hkey, &nameW, 0, type, value, count );
}
void set_reg_ascii_value( HKEY hkey, const char *name, const char *value )
......@@ -661,7 +661,7 @@ static BOOL reg_enum_value( HKEY hkey, unsigned int index, KEY_VALUE_FULL_INFORM
return TRUE;
}
static void reg_delete_value( HKEY hkey, const WCHAR *name )
void reg_delete_value( HKEY hkey, const WCHAR *name )
{
unsigned int name_size = lstrlenW( name ) * sizeof(WCHAR);
UNICODE_STRING nameW = { name_size, name_size, (WCHAR *)name };
......
......@@ -123,6 +123,7 @@ static void * const syscalls[] =
NtUserGetProcessDpiAwarenessContext,
NtUserGetProcessWindowStation,
NtUserGetProp,
NtUserGetSystemDpiForProcess,
NtUserGetThreadDesktop,
NtUserOpenDesktop,
NtUserOpenInputDesktop,
......
......@@ -993,7 +993,7 @@
@ stub NtUserGetResizeDCompositionSynchronizationObject
@ stub NtUserGetScrollBarInfo
@ stub NtUserGetSharedWindowData
@ stub NtUserGetSystemDpiForProcess
@ stdcall -syscall NtUserGetSystemDpiForProcess(long)
@ stub NtUserGetSystemMenu
@ stdcall -syscall NtUserGetThreadDesktop(long)
@ stub NtUserGetThreadState
......
......@@ -258,9 +258,10 @@ extern ULONG query_reg_value( HKEY hkey, const WCHAR *name,
extern ULONG query_reg_ascii_value( HKEY hkey, const char *name,
KEY_VALUE_PARTIAL_INFORMATION *info, ULONG size ) DECLSPEC_HIDDEN;
extern void set_reg_ascii_value( HKEY hkey, const char *name, const char *value ) DECLSPEC_HIDDEN;
extern void set_reg_value( HKEY hkey, const WCHAR *name, UINT type, const void *value,
extern BOOL set_reg_value( HKEY hkey, const WCHAR *name, UINT type, const void *value,
DWORD count ) DECLSPEC_HIDDEN;
extern BOOL reg_delete_tree( HKEY parent, const WCHAR *name, ULONG name_len ) DECLSPEC_HIDDEN;
extern void reg_delete_value( HKEY hkey, const WCHAR *name ) DECLSPEC_HIDDEN;
extern HKEY hkcu_key DECLSPEC_HIDDEN;
......
......@@ -110,6 +110,7 @@
SYSCALL_ENTRY( NtUserGetProcessDpiAwarenessContext ) \
SYSCALL_ENTRY( NtUserGetProcessWindowStation ) \
SYSCALL_ENTRY( NtUserGetProp ) \
SYSCALL_ENTRY( NtUserGetSystemDpiForProcess ) \
SYSCALL_ENTRY( NtUserGetThreadDesktop ) \
SYSCALL_ENTRY( NtUserOpenDesktop ) \
SYSCALL_ENTRY( NtUserOpenInputDesktop ) \
......
......@@ -308,3 +308,10 @@ NTSTATUS WINAPI wow64_NtUserGetProcessDpiAwarenessContext( UINT *args )
return NtUserGetProcessDpiAwarenessContext( process );
}
NTSTATUS WINAPI wow64_NtUserGetSystemDpiForProcess( UINT *args )
{
HANDLE process = get_handle( &args );
return NtUserGetSystemDpiForProcess( process );
}
......@@ -131,6 +131,7 @@ INT WINAPI NtUserGetPriorityClipboardFormat( UINT *list, INT count );
HWINSTA WINAPI NtUserGetProcessWindowStation(void);
HANDLE WINAPI NtUserGetProp( HWND hwnd, const WCHAR *str );
ULONG WINAPI NtUserGetProcessDpiAwarenessContext( HANDLE process );
ULONG WINAPI NtUserGetSystemDpiForProcess( HANDLE process );
HDESK WINAPI NtUserGetThreadDesktop( DWORD thread );
BOOL WINAPI NtUserGetUpdatedClipboardFormats( UINT *formats, UINT size, UINT *out_size );
BOOL WINAPI NtUserIsClipboardFormatAvailable( UINT format );
......
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