Henri Verbeet : d3d8: Return D3DERR_INVALIDCALL when trying to delete an invalid pixel shader.

Alexandre Julliard julliard at winehq.org
Tue Dec 1 09:19:43 CST 2009


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

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Tue Dec  1 11:27:47 2009 +0100

d3d8: Return D3DERR_INVALIDCALL when trying to delete an invalid pixel shader.

It appears this is fixed on Vista/Win7 to be consistent with
DeleteVertexShader(). Match the more consistent behaviour of Vista/Win7 and
mark the previous behaviour as broken.

---

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

diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c
index 450a5ff..f390691 100644
--- a/dlls/d3d8/device.c
+++ b/dlls/d3d8/device.c
@@ -2316,7 +2316,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_DeletePixelShader(LPDIRECT3DDEVICE8 i
     {
         WARN("Invalid handle (%#x) passed.\n", pShader);
         wined3d_mutex_unlock();
-        return D3D_OK;
+        return D3DERR_INVALIDCALL;
     }
 
     IWineD3DDevice_GetPixelShader(This->WineD3DDevice, &cur);
diff --git a/dlls/d3d8/tests/device.c b/dlls/d3d8/tests/device.c
index 900fbb7..5e1f523 100644
--- a/dlls/d3d8/tests/device.c
+++ b/dlls/d3d8/tests/device.c
@@ -1084,9 +1084,9 @@ static void test_shader(void)
 
         /* Check for double delete. */
         hr = IDirect3DDevice8_DeletePixelShader(pDevice, hPixelShader2);
-        ok(hr == D3D_OK, "IDirect3DDevice8_DeletePixelShader returned %#08x\n", hr);
+        ok(hr == D3DERR_INVALIDCALL || broken(hr == D3D_OK), "IDirect3DDevice8_DeletePixelShader returned %#08x\n", hr);
         hr = IDirect3DDevice8_DeletePixelShader(pDevice, hPixelShader);
-        ok(hr == D3D_OK, "IDirect3DDevice8_DeletePixelShader returned %#08x\n", hr);
+        ok(hr == D3DERR_INVALIDCALL || broken(hr == D3D_OK), "IDirect3DDevice8_DeletePixelShader returned %#08x\n", hr);
     }
     else
     {




More information about the wine-cvs mailing list