gdi32: Add a GdiConvertToDevmodeW test, make it pass under Wine

Robert Shearman rob at codeweavers.com
Tue Dec 18 09:08:32 CST 2007


Dmitry Timoshkov wrote:
>      DEVMODEW *dmW;
>      WORD dmW_size;
>  
> -    dmW_size = dmA->dmSize + CCHDEVICENAME;
> -    if (dmA->dmSize >= (const char *)dmA->dmFormName - (const char *)dmA + CCHFORMNAME)
> +    dmW_size = dmA->dmSize;
> +    if (dmW_size > sizeof(DEVMODEA))
> +        dmW_size = sizeof(DEVMODEA);
>   

Shouldn't this be sizeof(DEVMODEW)?

> +
> +    dmW_size += CCHDEVICENAME;
>   

Shouldn't this be CCDEVICENAME * sizeof(WCHAR)?

> +    if (dmA->dmSize >= FIELD_OFFSET(DEVMODEA, dmFormName) + CCHFORMNAME)
>          dmW_size += CCHFORMNAME; 
>   

Shouldn't this be CCHFORMNAME * sizeof(WCHAR)?

-- 
Rob Shearman




More information about the wine-devel mailing list