Commit 0da6f2a6 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

ddraw: Forbid capturing a stateblock while recording.

parent 5fd14a4e
......@@ -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)
{
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment