[2/2] gdi32: implementation of CreateFontIndirectEx (fix for13064) (resent)

Nikolay Sivov bunglehead at gmail.com
Tue Jun 24 03:16:42 CDT 2008


Dmitry Timoshkov wrote:
> "Nikolay Sivov" <bunglehead at gmail.com> wrote:
>
>> +/*********************************************************************** 
>>
>> + *           CreateFontIndirectExA   (GDI32.@)
>> + */
>> +HFONT WINAPI CreateFontIndirectExA( const ENUMLOGFONTEXDVA *plf )
>> +{
>> +    if(!plf)  return NULL;
>> +
>> +    return CreateFontIndirectA(&(plf->elfEnumLogfontEx.elfLogFont));
>> +}
>> +
>> +/*********************************************************************** 
>>
>> + *           CreateFontIndirectExW   (GDI32.@)
>> + */
>> +HFONT WINAPI CreateFontIndirectExW( const ENUMLOGFONTEXDVW *plf )
>> +{
>> +    if(!plf)  return NULL;
>> +
>> +    return CreateFontIndirectW(&(plf->elfEnumLogfontEx.elfLogFont));
>> +}
>
> You neither removed the 'if(!plf)' check, nor added a test or an 
> explanation
> for this.
Here I don't follow you. If I want to access elfEnumLogfontEx field 
through pointer,
so should I check this pointer first? I thought it's obvious or maybe 
there're different things
we are talking about?
Could you explain please..

>> +    if(!pCreateFontIndirectExA)
>> +        skip("CreateFontIndirectExA not implemeted on this 
>> platform\n");
>> +    else
>> +    {
>> +        memcpy(&lfex.elfEnumLogfontEx.elfLogFont, &lf, sizeof(lf));
>> +        hfont = create_font_ex("Arial", &lfex);
>> +        DeleteObject(hfont);
>> +    }    
>
> Presumably CreateFontIndirectEx uses the whole ENUMLOGFONTEXDVA 
> structure,
> not just LOGFONT, so you need to fully initialize it.
>
> Also please remove trailing line spaces.
Here I'm fully agreed. Full initialization should be made, I thought 
only about LOGFONT part..



More information about the wine-devel mailing list