Commit 2353ef9b authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

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: 's avatarJacek Caban <jacek@codeweavers.com> Signed-off-by: 's avatarHuw Davies <huw@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent cc0ad23d
EXTRADEFS = -D_GDI32_
MODULE = gdi32.dll
IMPORTLIB = gdi32
IMPORTS = advapi32 win32u
IMPORTS = user32 advapi32 win32u
DELAYIMPORTS = setupapi
C_SRCS = \
......
......@@ -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;
}
......
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