d3d8: GetDepthStencilSurface returns D3DERR_NOTFOUND when no depth stencil is present

Henri Verbeet hverbeet at codeweavers.com
Wed Sep 10 04:08:58 CDT 2008


---
 dlls/d3d8/device.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c
index a81bf78..e877456 100644
--- a/dlls/d3d8/device.c
+++ b/dlls/d3d8/device.c
@@ -853,16 +853,17 @@ static HRESULT  WINAPI  IDirect3DDevice8Impl_GetDepthStencilSurface(LPDIRECT3DDE
 
     EnterCriticalSection(&d3d8_cs);
     hr=IWineD3DDevice_GetDepthStencilSurface(This->WineD3DDevice,&pZStencilSurface);
-    if(hr == D3D_OK && pZStencilSurface != NULL){
+    if (hr == WINED3D_OK) {
         IWineD3DSurface_GetParent(pZStencilSurface,(IUnknown**)ppZStencilSurface);
         IWineD3DSurface_Release(pZStencilSurface);
     }else{
-        FIXME("Call to IWineD3DDevice_GetDepthStencilSurface failed\n");
+        if (hr != WINED3DERR_NOTFOUND)
+                FIXME("Call to IWineD3DDevice_GetDepthStencilSurface failed with 0x%08x\n", hr);
         *ppZStencilSurface = NULL;
     }
     LeaveCriticalSection(&d3d8_cs);
 
-    return D3D_OK;
+    return hr;
 }
 
 static HRESULT WINAPI IDirect3DDevice8Impl_BeginScene(LPDIRECT3DDEVICE8 iface) {
-- 
1.5.6.4



--------------090909080602060407050707--



More information about the wine-patches mailing list