Henri Verbeet : ddraw: Don't depend on IWineD3DDevice_CreateSurface() not touching the surface parameter on failure.

Alexandre Julliard julliard at winehq.org
Fri Dec 18 10:49:06 CST 2009


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

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Thu Dec 17 19:14:32 2009 +0100

ddraw: Don't depend on IWineD3DDevice_CreateSurface() not touching the surface parameter on failure.

The reason it actually fails is because of ddraw trying to create surface of
type "SURFACE_UNKNOWN". Stefan should have a patch for that.

---

 dlls/ddraw/ddraw.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c
index 46fd729..527f448 100644
--- a/dlls/ddraw/ddraw.c
+++ b/dlls/ddraw/ddraw.c
@@ -1655,9 +1655,11 @@ IDirectDrawImpl_RecreateSurfacesCallback(IDirectDrawSurface7 *surf,
             TRUE /* Lockable */, FALSE /* Discard */, surfImpl->mipmap_level, &surfImpl->WineD3DSurface, Usage, Pool,
             MultiSampleType, MultiSampleQuality, This->ImplType, Parent, &ddraw_null_wined3d_parent_ops);
     IUnknown_Release(Parent);
-
-    if(hr != D3D_OK)
+    if (FAILED(hr))
+    {
+        surfImpl->WineD3DSurface = wineD3DSurface;
         return hr;
+    }
 
     IWineD3DSurface_SetClipper(surfImpl->WineD3DSurface, clipper);
 




More information about the wine-cvs mailing list