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:
parent
cc0ad23d73
commit
2353ef9bd5
|
@ -1,7 +1,7 @@
|
|||
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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue