Zebediah Figura : d3d8: Forbid creating a stateblock while recording.

Alexandre Julliard julliard at winehq.org
Thu Apr 4 15:38:09 CDT 2019


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

Author: Zebediah Figura <z.figura12 at gmail.com>
Date:   Wed Apr  3 21:18:44 2019 -0500

d3d8: Forbid creating a stateblock while recording.

Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/d3d8/device.c       | 6 ++++++
 dlls/d3d8/tests/device.c | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c
index 4bd7578..4eb44e2 100644
--- a/dlls/d3d8/device.c
+++ b/dlls/d3d8/device.c
@@ -2027,6 +2027,12 @@ static HRESULT WINAPI d3d8_device_CreateStateBlock(IDirect3DDevice8 *iface,
     }
 
     wined3d_mutex_lock();
+    if (device->recording)
+    {
+        wined3d_mutex_unlock();
+        WARN("Trying to create a stateblock while recording, returning D3DERR_INVALIDCALL.\n");
+        return D3DERR_INVALIDCALL;
+    }
     hr = wined3d_stateblock_create(device->wined3d_device, (enum wined3d_stateblock_type)type, &stateblock);
     if (FAILED(hr))
     {
diff --git a/dlls/d3d8/tests/device.c b/dlls/d3d8/tests/device.c
index 37f4c5c..af58789 100644
--- a/dlls/d3d8/tests/device.c
+++ b/dlls/d3d8/tests/device.c
@@ -7283,7 +7283,7 @@ static void test_begin_end_state_block(void)
     ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr);
 
     hr = IDirect3DDevice8_CreateStateBlock(device, D3DSBT_ALL, &stateblock2);
-    todo_wine ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr);
+    ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr);
 
     hr = IDirect3DDevice8_GetRenderState(device, D3DRS_LIGHTING, &value);
     ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);




More information about the wine-cvs mailing list