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

Alexandre Julliard julliard at winehq.org
Mon Apr 2 16:32:52 CDT 2018


Module: wine
Branch: master
Commit: c440af11bd53afda74635be679c89e1014c4fe81
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=c440af11bd53afda74635be679c89e1014c4fe81

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon Apr  2 11:19:17 2018 +0200

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

Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/user32/user_main.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/dlls/user32/user_main.c b/dlls/user32/user_main.c
index 057c7aa..418359a 100644
--- a/dlls/user32/user_main.c
+++ b/dlls/user32/user_main.c
@@ -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};




More information about the wine-cvs mailing list