Commit c440af11 authored by Alexandre Julliard's avatar Alexandre Julliard

user32: Support forcing the DPI awareness through the image file execution options.

parent c61c33ee
......@@ -219,11 +219,23 @@ static const WCHAR *get_default_desktop(void)
static void dpiaware_init(void)
{
WCHAR buffer[256];
DWORD option;
static const WCHAR dpiAwareW[] = {'d','p','i','A','w','a','r','e',0};
static const WCHAR dpiAwarenessW[] = {'d','p','i','A','w','a','r','e','n','e','s','s',0};
static const WCHAR namespace2005W[] = {'h','t','t','p',':','/','/','s','c','h','e','m','a','s','.','m','i','c','r','o','s','o','f','t','.','c','o','m','/','S','M','I','/','2','0','0','5','/','W','i','n','d','o','w','s','S','e','t','t','i','n','g','s',0};
static const WCHAR namespace2016W[] = {'h','t','t','p',':','/','/','s','c','h','e','m','a','s','.','m','i','c','r','o','s','o','f','t','.','c','o','m','/','S','M','I','/','2','0','1','6','/','W','i','n','d','o','w','s','S','e','t','t','i','n','g','s',0};
if (!LdrQueryImageFileExecutionOptions( &NtCurrentTeb()->Peb->ProcessParameters->ImagePathName,
dpiAwarenessW, REG_DWORD, &option, sizeof(option), NULL ))
{
TRACE( "got option %x\n", option );
if (option <= 2)
{
SetProcessDpiAwarenessContext( (DPI_AWARENESS_CONTEXT)~(ULONG_PTR)option );
return;
}
}
if (QueryActCtxSettingsW( 0, NULL, namespace2016W, dpiAwarenessW, buffer, ARRAY_SIZE(buffer), NULL ))
{
static const WCHAR unawareW[] = {'u','n','a','w','a','r','e',0};
......
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