[2/6] ddraw: Introduce a function to convert a DDSURFACEDESC to a DDSURFACEDESC2 (try 2)

Stefan Dösinger stefan at codeweavers.com
Tue Aug 30 05:52:24 CDT 2011

Changes from try 1:
* Copy ddsCaps even if DDSD_CAPS is not set
* pass the unmodified DDSURFACEDESC structure to dump_surface_desc

Since the output of this function is read only by our code we don't need the 
memset. Unfortunately CreateSurface still has problems with that. It doesn't 
read any members that don't have their flag set(Except those convered by 
tests, like ddsCaps), but it copies some values into the surface's 
DDSURFACEDESC2, from where it can be passed back to the app via 
GetSurfaceDesc() or Lock(), which may read the values without checking for the 
DDSD_* flag. Note that this bug exists regardless of this patch in 

This patch makes it easier to clean up CreateSurface because the size checks 
can be removed. The plan is to fix CreateSurface and after that change the 
memset value to something like 0xff for catching remaining issues or remove 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-ddraw-Introduce-a-function-to-convert-a-DDSURFACEDES.patch
Type: text/x-patch
Size: 15002 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20110830/60f3111a/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20110830/60f3111a/attachment-0001.pgp>

More information about the wine-patches mailing list