Commit 6cba2285 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

ddraw: Reject creating primary surfaces with DDSCAPS_TEXTURE.

parent a9afc935
......@@ -5627,13 +5627,21 @@ HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_
if ((desc->ddsCaps.dwCaps & DDSCAPS_ALLOCONLOAD) || !desc->lpSurface)
desc->dwFlags &= ~DDSD_LPSURFACE;
if ((desc->ddsCaps.dwCaps & (DDSCAPS_FLIP | DDSCAPS_PRIMARYSURFACE))
== (DDSCAPS_FLIP | DDSCAPS_PRIMARYSURFACE)
&& !(ddraw->cooperative_level & DDSCL_EXCLUSIVE))
if (desc->ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE)
{
WARN("Tried to create a flippable primary surface without DDSCL_EXCLUSIVE.\n");
HeapFree(GetProcessHeap(), 0, texture);
return DDERR_NOEXCLUSIVEMODE;
if (desc->ddsCaps.dwCaps & DDSCAPS_TEXTURE)
{
WARN("Tried to create a primary surface with DDSCAPS_TEXTURE.\n");
HeapFree(GetProcessHeap(), 0, texture);
return DDERR_INVALIDCAPS;
}
if ((desc->ddsCaps.dwCaps & DDSCAPS_FLIP) && !(ddraw->cooperative_level & DDSCL_EXCLUSIVE))
{
WARN("Tried to create a flippable primary surface without DDSCL_EXCLUSIVE.\n");
HeapFree(GetProcessHeap(), 0, texture);
return DDERR_NOEXCLUSIVEMODE;
}
}
/* This is a special case in ddrawex, but not allowed in ddraw. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment