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

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


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

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

d3d8: Forbid capturing 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 381588f..4bd7578 100644
--- a/dlls/d3d8/device.c
+++ b/dlls/d3d8/device.c
@@ -1964,6 +1964,12 @@ static HRESULT WINAPI d3d8_device_CaptureStateBlock(IDirect3DDevice8 *iface, DWO
     TRACE("iface %p, token %#x.\n", iface, token);
 
     wined3d_mutex_lock();
+    if (device->recording)
+    {
+        wined3d_mutex_unlock();
+        WARN("Trying to capture stateblock while recording, returning D3DERR_INVALIDCALL.\n");
+        return D3DERR_INVALIDCALL;
+    }
     stateblock = d3d8_get_object(&device->handle_table, token - 1, D3D8_HANDLE_SB);
     if (!stateblock)
     {
diff --git a/dlls/d3d8/tests/device.c b/dlls/d3d8/tests/device.c
index fee73de..37f4c5c 100644
--- a/dlls/d3d8/tests/device.c
+++ b/dlls/d3d8/tests/device.c
@@ -7280,7 +7280,7 @@ static void test_begin_end_state_block(void)
     ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr);
 
     hr = IDirect3DDevice8_CaptureStateBlock(device, stateblock);
-    todo_wine ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr);
+    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);




More information about the wine-cvs mailing list