ddraw: Assign to structs instead of using memcpy

Stefan Dösinger stefan at codeweavers.com
Tue Feb 19 09:52:13 CST 2008

Am Sonntag, 17. Februar 2008 01:38:50 schrieb Andrew Talbot:
> And I presume that if the underlying struct tags 
> are different between two similar types, then the compiler would warn of
> type incompatibility if such an assignment were attempted.
Not quite. You can have a DDSURFACEDESC2 *ddsd pointer, with ddsd->dwSize == 
sizeof(DDSURFACEDESC). Then you have in binary a DDSURFACEDESC *, not a 
DDSURFACEDESC2 *. The compiler won't see that, since the type is determined 
at runtime.

(Don't blame me, Microsoft invented that)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://www.winehq.org/pipermail/wine-devel/attachments/20080219/82384838/attachment.pgp 

More information about the wine-devel mailing list