ddraw: Fix D3DEXECUTEDATA.dwSize handling.

Signed-off-by: Stefan Dösinger <stefan@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Stefan Dösinger 2018-04-05 12:59:13 +02:00 committed by Alexandre Julliard
parent 185d98bbfd
commit 6f5028337e
1 changed files with 8 additions and 3 deletions

View File

@ -610,6 +610,12 @@ static HRESULT WINAPI d3d_execute_buffer_SetExecuteData(IDirect3DExecuteBuffer *
TRACE("iface %p, data %p.\n", iface, data);
if (data->dwSize != sizeof(*data))
{
WARN("data->dwSize is %u, returning DDERR_INVALIDPARAMS.\n", data->dwSize);
return DDERR_INVALIDPARAMS;
}
/* Skip past previous vertex data. */
buffer->src_vertex_pos += buffer->data.dwVertexCount;
@ -693,12 +699,11 @@ static HRESULT WINAPI d3d_execute_buffer_SetExecuteData(IDirect3DExecuteBuffer *
static HRESULT WINAPI d3d_execute_buffer_GetExecuteData(IDirect3DExecuteBuffer *iface, D3DEXECUTEDATA *data)
{
struct d3d_execute_buffer *buffer = impl_from_IDirect3DExecuteBuffer(iface);
DWORD dwSize;
TRACE("iface %p, data %p.\n", iface, data);
dwSize = data->dwSize;
memcpy(data, &buffer->data, dwSize);
/* Tests show that dwSize is ignored. */
memcpy(data, &buffer->data, sizeof(*data));
if (TRACE_ON(ddraw))
{