Commit 952affea authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

win32u: Allow passing simple LOGFONTW to NtGdiHfontCreate.

parent fdd7f315
......@@ -4478,26 +4478,35 @@ UINT WINAPI NtGdiGetTextCharsetInfo( HDC hdc, FONTSIGNATURE *fs, DWORD flags )
/***********************************************************************
* NtGdiHfontCreate (win32u.@)
*/
HFONT WINAPI NtGdiHfontCreate( const ENUMLOGFONTEXDVW *penumex, ULONG size, ULONG type,
HFONT WINAPI NtGdiHfontCreate( const void *logfont, ULONG size, ULONG type,
ULONG flags, void *data )
{
HFONT hFont;
FONTOBJ *fontPtr;
const LOGFONTW *plf;
if (!penumex) return 0;
if (!logfont) return 0;
if (penumex->elfEnumLogfontEx.elfFullName[0] ||
penumex->elfEnumLogfontEx.elfStyle[0] ||
penumex->elfEnumLogfontEx.elfScript[0])
if (size == sizeof(ENUMLOGFONTEXDVW) || size == sizeof(ENUMLOGFONTEXW))
{
FIXME("some fields ignored. fullname=%s, style=%s, script=%s\n",
debugstr_w(penumex->elfEnumLogfontEx.elfFullName),
debugstr_w(penumex->elfEnumLogfontEx.elfStyle),
debugstr_w(penumex->elfEnumLogfontEx.elfScript));
const ENUMLOGFONTEXW *lfex = logfont;
if (lfex->elfFullName[0] || lfex->elfStyle[0] || lfex->elfScript[0])
{
FIXME( "some fields ignored. fullname=%s, style=%s, script=%s\n",
debugstr_w( lfex->elfFullName ), debugstr_w( lfex->elfStyle ),
debugstr_w( lfex->elfScript ));
}
plf = &lfex->elfLogFont;
}
else if (size != sizeof(LOGFONTW))
{
SetLastError( ERROR_INVALID_PARAMETER );
return 0;
}
else plf = logfont;
plf = &penumex->elfEnumLogfontEx.elfLogFont;
if (!(fontPtr = malloc( sizeof(*fontPtr) ))) return 0;
fontPtr->logfont = *plf;
......
......@@ -403,13 +403,13 @@ NTSTATUS WINAPI wow64_NtGdiSetTextJustification( UINT *args )
NTSTATUS WINAPI wow64_NtGdiHfontCreate( UINT *args )
{
const ENUMLOGFONTEXDVW *enumex = get_ptr( &args );
const void *logfont = get_ptr( &args );
ULONG unk2 = get_ulong( &args );
ULONG unk3 = get_ulong( &args );
ULONG unk4 = get_ulong( &args );
void *data = get_ptr( &args );
return HandleToUlong( NtGdiHfontCreate( enumex, unk2, unk3, unk4, data ));
return HandleToUlong( NtGdiHfontCreate( logfont, unk2, unk3, unk4, data ));
}
NTSTATUS WINAPI wow64_NtGdiGetFontFileData( UINT *args )
......
......@@ -371,7 +371,7 @@ BOOL WINAPI NtGdiGetTextMetricsW( HDC hdc, TEXTMETRICW *metrics, ULONG flags
BOOL WINAPI NtGdiGetTransform( HDC hdc, DWORD which, XFORM *xform );
BOOL WINAPI NtGdiGradientFill( HDC hdc, TRIVERTEX *vert_array, ULONG nvert,
void *grad_array, ULONG ngrad, ULONG mode );
HFONT WINAPI NtGdiHfontCreate( const ENUMLOGFONTEXDVW *enumex, ULONG unk2, ULONG unk3,
HFONT WINAPI NtGdiHfontCreate( const void *logfont, ULONG unk2, ULONG unk3,
ULONG unk4, void *data );
DWORD WINAPI NtGdiInitSpool(void);
INT WINAPI NtGdiIntersectClipRect( HDC hdc, INT left, INT top, INT right, INT bottom );
......
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