Zebediah Figura : ddraw: Forbid capturing a stateblock while recording.
Alexandre Julliard
julliard at winehq.org
Fri Apr 5 16:04:58 CDT 2019
Module: wine
Branch: master
Commit: 0da6f2a66a44e9bae5d724b59f54b58cb1359ff0
URL: https://source.winehq.org/git/wine.git/?a=commit;h=0da6f2a66a44e9bae5d724b59f54b58cb1359ff0
Author: Zebediah Figura <z.figura12 at gmail.com>
Date: Thu Apr 4 18:37:59 2019 -0500
ddraw: 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/ddraw/device.c | 6 ++++++
dlls/ddraw/tests/ddraw7.c | 2 +-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c
index 0ddf9a8..b471612 100644
--- a/dlls/ddraw/device.c
+++ b/dlls/ddraw/device.c
@@ -5882,6 +5882,12 @@ static HRESULT d3d_device7_CaptureStateBlock(IDirect3DDevice7 *iface, DWORD stat
TRACE("iface %p, stateblock %#x.\n", iface, stateblock);
wined3d_mutex_lock();
+ if (device->recording)
+ {
+ wined3d_mutex_unlock();
+ WARN("Trying to capture a stateblock while recording, returning D3DERR_INBEGINSTATEBLOCK.\n");
+ return D3DERR_INBEGINSTATEBLOCK;
+ }
wined3d_sb = ddraw_get_object(&device->handle_table, stateblock - 1, DDRAW_HANDLE_STATEBLOCK);
if (!wined3d_sb)
{
diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c
index ff73eea..61042e3 100644
--- a/dlls/ddraw/tests/ddraw7.c
+++ b/dlls/ddraw/tests/ddraw7.c
@@ -15869,7 +15869,7 @@ static void test_begin_end_state_block(void)
ok(hr == D3DERR_INBEGINSTATEBLOCK, "Got unexpected hr %#x.\n", hr);
hr = IDirect3DDevice7_CaptureStateBlock(device, stateblock);
- todo_wine ok(hr == D3DERR_INBEGINSTATEBLOCK, "Got unexpected hr %#x.\n", hr);
+ ok(hr == D3DERR_INBEGINSTATEBLOCK, "Got unexpected hr %#x.\n", hr);
hr = IDirect3DDevice7_CreateStateBlock(device, D3DSBT_ALL, &stateblock2);
todo_wine ok(hr == D3DERR_INBEGINSTATEBLOCK, "Got unexpected hr %#x.\n", hr);
More information about the wine-cvs
mailing list