Henri Verbeet : ddraw: Reject creating primary surfaces with DDSCAPS_TEXTURE.

Alexandre Julliard julliard at winehq.org
Wed Dec 4 14:43:35 CST 2013


Module: wine
Branch: master
Commit: 6cba2285bc9bc5adeed3f4300d4a23c3e23c56a8
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=6cba2285bc9bc5adeed3f4300d4a23c3e23c56a8

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Wed Dec  4 09:49:37 2013 +0100

ddraw: Reject creating primary surfaces with DDSCAPS_TEXTURE.

---

 dlls/ddraw/surface.c |   20 ++++++++++++++------
 1 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c
index 9d570e4..79d5b31 100644
--- a/dlls/ddraw/surface.c
+++ b/dlls/ddraw/surface.c
@@ -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. */




More information about the wine-cvs mailing list