[PATCH 4/5] d3d8: Return D3DERR_INVALIDCALL when trying to delete an invalid pixel shader.
Henri Verbeet
hverbeet at codeweavers.com
Tue Dec 1 04:27:47 CST 2009
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
{
--
1.6.4.4
More information about the wine-patches
mailing list