[PATCH] ddraw: Avoid break in __TRY blocks.

Alex Henrie alexhenrie24 at gmail.com
Wed Feb 15 00:53:20 CST 2017


I've now run numerous tests on DirectDraw.

The following conditions do not result in an attempted write to the
surface pointer:
- Null surface descriptor (returns E_INVALIDARG)
- Wrong surface descriptor size (returns E_INVALIDARG)
- Unset cooperative level (returns DDERR_NOCOOPERATIVELEVELSET)

The following conditions do result in an attempted write to the surface pointer:
- Tried to create explicit frontbuffer (returns DDERR_INVALIDCAPS if
NULL was written to the surface pointer and E_INVALIDARG if the write
failed)
- Requested surface with zero width or zero height (returns E_INVALIDARG)

None of the above conditions increments the IDirectDraw7 refcount.

So, we can try to write NULL to the surface pointer before the
explicit frontbuffer/backbuffer and zero width/height checks, and that
should give us behavior that is indistinguishable from Windows.

-Alex



More information about the wine-devel mailing list