ddraw: Move the primary surface validation from CreateSurface() to ddraw_surface_create_texture().

This commit is contained in:
Henri Verbeet 2013-11-27 11:04:51 +01:00 committed by Alexandre Julliard
parent 2105b4493f
commit 3139249a2e
2 changed files with 7 additions and 6 deletions

View file

@ -2863,12 +2863,6 @@ static HRESULT CreateSurface(struct ddraw *ddraw, DDSURFACEDESC2 *DDSD,
return DDERR_NOEXCLUSIVEMODE;
}
if((DDSD->ddsCaps.dwCaps & (DDSCAPS_BACKBUFFER | DDSCAPS_PRIMARYSURFACE)) == (DDSCAPS_BACKBUFFER | DDSCAPS_PRIMARYSURFACE))
{
WARN("Application wanted to create back buffer primary surface\n");
return DDERR_INVALIDCAPS;
}
/* Modify some flags */
copy_to_surfacedesc2(&desc2, DDSD);

View file

@ -5608,6 +5608,13 @@ HRESULT ddraw_surface_create_texture(struct ddraw *ddraw, DDSURFACEDESC2 *desc,
DDRAW_dump_surface_desc(desc);
}
if ((desc->ddsCaps.dwCaps & (DDSCAPS_BACKBUFFER | DDSCAPS_PRIMARYSURFACE))
== (DDSCAPS_BACKBUFFER | DDSCAPS_PRIMARYSURFACE))
{
WARN("Tried to create a back buffer surface.\n");
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))