Module: wine Branch: master Commit: 1879a17ec444f0b47d78f141896e7ce9b6f007f0 URL: https://source.winehq.org/git/wine.git/?a=commit;h=1879a17ec444f0b47d78f1418...
Author: Zebediah Figura z.figura12@gmail.com Date: Thu Apr 4 18:38:00 2019 -0500
ddraw: Forbid creating a stateblock while recording.
Signed-off-by: Zebediah Figura z.figura12@gmail.com Signed-off-by: Henri Verbeet hverbeet@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/ddraw/device.c | 7 +++++++ dlls/ddraw/tests/ddraw7.c | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c index b471612..003ce1d 100644 --- a/dlls/ddraw/device.c +++ b/dlls/ddraw/device.c @@ -6018,6 +6018,13 @@ static HRESULT d3d_device7_CreateStateBlock(IDirect3DDevice7 *iface,
wined3d_mutex_lock();
+ if (device->recording) + { + wined3d_mutex_unlock(); + WARN("Trying to apply a stateblock while recording, returning D3DERR_INBEGINSTATEBLOCK.\n"); + return D3DERR_INBEGINSTATEBLOCK; + } + /* The D3DSTATEBLOCKTYPE enum is fine here. */ hr = wined3d_stateblock_create(device->wined3d_device, type, &wined3d_sb); if (FAILED(hr)) diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c index 61042e3..5f066a6 100644 --- a/dlls/ddraw/tests/ddraw7.c +++ b/dlls/ddraw/tests/ddraw7.c @@ -15872,7 +15872,7 @@ static void test_begin_end_state_block(void) 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); + ok(hr == D3DERR_INBEGINSTATEBLOCK, "Got unexpected hr %#x.\n", hr);
hr = IDirect3DDevice7_GetRenderState(device, D3DRENDERSTATE_LIGHTING, &value); ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);