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@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2022-02-17 15:42:01 +01:00 committed by Alexandre Julliard
parent cc0ad23d73
commit 2353ef9bd5
2 changed files with 5 additions and 22 deletions

View file

@ -1,7 +1,7 @@
EXTRADEFS = -D_GDI32_
MODULE = gdi32.dll
IMPORTLIB = gdi32
IMPORTS = advapi32 win32u
IMPORTS = user32 advapi32 win32u
DELAYIMPORTS = setupapi
C_SRCS = \

View file

@ -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;
}