Jacek Caban : gdi32: Link directly to user32.

Alexandre Julliard julliard at winehq.org
Thu Feb 17 15:33:59 CST 2022


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

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Thu Feb 17 15:42:01 2022 +0100

gdi32: Link directly to user32.

On Windows, loading gdi32.dll causes user32.dll to be loaded. It's
important for win32u, which is not fully functional until user32 sets
KernelCallbackTable.

Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/gdi32/Makefile.in |  2 +-
 dlls/gdi32/objects.c   | 25 ++++---------------------
 2 files changed, 5 insertions(+), 22 deletions(-)

diff --git a/dlls/gdi32/Makefile.in b/dlls/gdi32/Makefile.in
index 3e0495f877b..ce877995ee2 100644
--- a/dlls/gdi32/Makefile.in
+++ b/dlls/gdi32/Makefile.in
@@ -1,7 +1,7 @@
 EXTRADEFS = -D_GDI32_
 MODULE    = gdi32.dll
 IMPORTLIB = gdi32
-IMPORTS   = advapi32 win32u
+IMPORTS   = user32 advapi32 win32u
 DELAYIMPORTS = setupapi
 
 C_SRCS = \
diff --git a/dlls/gdi32/objects.c b/dlls/gdi32/objects.c
index f578543b937..0260027a484 100644
--- a/dlls/gdi32/objects.c
+++ b/dlls/gdi32/objects.c
@@ -415,23 +415,6 @@ HGDIOBJ WINAPI GetCurrentObject( HDC hdc, UINT type )
     return NtGdiGetDCObject( hdc, obj_type );
 }
 
-/******************************************************************************
- *              get_system_dpi
- *
- * Get the system DPI, based on the DPI awareness mode.
- */
-static DWORD get_system_dpi(void)
-{
-    static UINT (WINAPI *pGetDpiForSystem)(void);
-
-    if (!pGetDpiForSystem)
-    {
-        HMODULE user = GetModuleHandleW( L"user32.dll" );
-        if (user) pGetDpiForSystem = (void *)GetProcAddress( user, "GetDpiForSystem" );
-    }
-    return pGetDpiForSystem ? pGetDpiForSystem() : 96;
-}
-
 /***********************************************************************
  *           GetStockObject    (GDI32.@)
  */
@@ -443,16 +426,16 @@ HGDIOBJ WINAPI GetStockObject( INT obj )
     switch (obj)
     {
     case OEM_FIXED_FONT:
-        if (get_system_dpi() != 96) obj = 9;
+        if (GetDpiForSystem() != 96) obj = 9;
         break;
     case SYSTEM_FONT:
-        if (get_system_dpi() != 96) obj = STOCK_LAST + 2;
+        if (GetDpiForSystem() != 96) obj = STOCK_LAST + 2;
         break;
     case SYSTEM_FIXED_FONT:
-        if (get_system_dpi() != 96) obj = STOCK_LAST + 3;
+        if (GetDpiForSystem() != 96) obj = STOCK_LAST + 3;
         break;
     case DEFAULT_GUI_FONT:
-        if (get_system_dpi() != 96) obj = STOCK_LAST + 4;
+        if (GetDpiForSystem() != 96) obj = STOCK_LAST + 4;
         break;
     }
 




More information about the wine-cvs mailing list