ddraw: Get rid of the DDSCAPS_BACKBUFFER validation in ddraw_surface_create().

All callers except ddraw1_CreateSurface() already have a stricter check
themselves.
This commit is contained in:
Henri Verbeet 2013-12-02 12:07:36 +01:00 committed by Alexandre Julliard
parent d56b7c2016
commit 8a9fdb567e
2 changed files with 8 additions and 8 deletions

View File

@ -2924,6 +2924,14 @@ static HRESULT WINAPI ddraw1_CreateSurface(IDirectDraw *iface,
/* Remove front buffer flag, this causes failure in v7, and its added to normal
* primaries anyway. */
surface_desc->ddsCaps.dwCaps &= ~DDSCAPS_FRONTBUFFER;
if ((surface_desc->ddsCaps.dwCaps & (DDSCAPS_PRIMARYSURFACE | DDSCAPS_BACKBUFFER))
== (DDSCAPS_PRIMARYSURFACE | DDSCAPS_BACKBUFFER))
{
WARN("Application tried to create an explicit front or back buffer.\n");
wined3d_mutex_unlock();
return DDERR_INVALIDCAPS;
}
DDSD_to_DDSD2(surface_desc, &surface_desc2);
hr = ddraw_surface_create(ddraw, &surface_desc2, &impl, outer_unknown, 1);
wined3d_mutex_unlock();

View File

@ -5640,14 +5640,6 @@ HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_
return DDERR_NOEXCLUSIVEMODE;
}
if ((desc->ddsCaps.dwCaps & (DDSCAPS_BACKBUFFER | DDSCAPS_PRIMARYSURFACE))
== (DDSCAPS_BACKBUFFER | DDSCAPS_PRIMARYSURFACE))
{
WARN("Tried to create a back buffer surface.\n");
HeapFree(GetProcessHeap(), 0, texture);
return DDERR_INVALIDCAPS;
}
/* This is a special case in ddrawex, but not allowed in ddraw. */
if ((desc->ddsCaps.dwCaps & (DDSCAPS_VIDEOMEMORY | DDSCAPS_SYSTEMMEMORY))
== (DDSCAPS_VIDEOMEMORY | DDSCAPS_SYSTEMMEMORY))