winex11.drv: Set the size of returned DEVMODE to least common one as XP does

Robert Shearman rob at codeweavers.com
Sun May 4 11:00:01 CDT 2008


David Adam wrote:
> Hello
>
> >-    devmode->dmSize = sizeof(DEVMODEW);
> >-    devmode->dmSpecVersion = MAKEWORD(1,4);
> >-    devmode->dmDriverVersion = MAKEWORD(1,4);
> >+    devmode->dmSize = FIELD_OFFSET(DEVMODEW, dmICMMethod);
>
> >+    devmode->dmSpecVersion = DM_SPECVERSION;
> >+    devmode->dmDriverVersion = DM_SPECVERSION;
> Wouldn't it be better to write 
>   *devmode->dmDeviceName=*dev_name
> instead of
>
> >     memcpy(devmode->dmDeviceName, dev_name, sizeof(dev_name));
>   

You can't copy whole arrays using one dereference operator. The reason 
for this is that the dereference operator only returns the contents of 
the first element in the array.

-- 
Rob Shearman




More information about the wine-devel mailing list