[resend]gdi32 : Completes WidenPath implementation

Alexandre Julliard julliard at winehq.org
Fri Apr 20 06:07:04 CDT 2007


Laurent Vromman <laurent at vromman.org> writes:

>      elp = HeapAlloc( GetProcessHeap(), 0, size );
> -
> +    lp = HeapAlloc( GetProcessHeap(), 0, sizeof(LOGPEN));
>      GetObjectW( dc->hPen, size, elp );
> +
> +    obj_type = GetObjectType(dc->hPen);
> +    if(obj_type == OBJ_PEN) {
> +        memcpy(lp, elp, sizeof(LOGPEN));
> +        penStyle = lp->lopnStyle;
> +    }
> +    else if(obj_type == OBJ_EXTPEN) {
> +        penStyle = elp->elpPenStyle;
> +    }
> +    else {
> +        SetLastError(ERROR_CAN_NOT_COMPLETE);
> +        return FALSE;
> +    }

There's no reason to make a copy of the structure, a typecast would
work just as well. Also you are leaking memory here.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list