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

Dmitry Timoshkov dmitry at codeweavers.com
Tue Jun 24 02:56:48 CDT 2008


"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.

> +    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.

-- 
Dmitry.



More information about the wine-devel mailing list