d3d11: Return E_INVALIDARG from GetData() when "data" is NULL and "data_size" is non-zero.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Józef Kucia 2016-11-21 15:15:54 +01:00 committed by Alexandre Julliard
parent c0fb3fb9e1
commit d3c58df455
3 changed files with 7 additions and 1 deletions

View File

@ -298,6 +298,9 @@ static HRESULT STDMETHODCALLTYPE d3d10_query_GetData(ID3D10Query *iface, void *d
TRACE("iface %p, data %p, data_size %u, flags %#x.\n", iface, data, data_size, flags); TRACE("iface %p, data %p, data_size %u, flags %#x.\n", iface, data, data_size, flags);
if (!data && data_size)
return E_INVALIDARG;
wined3d_flags = wined3d_getdata_flags_from_d3d11_async_getdata_flags(flags); wined3d_flags = wined3d_getdata_flags_from_d3d11_async_getdata_flags(flags);
wined3d_mutex_lock(); wined3d_mutex_lock();

View File

@ -527,6 +527,9 @@ static HRESULT STDMETHODCALLTYPE d3d11_immediate_context_GetData(ID3D11DeviceCon
TRACE("iface %p, asynchronous %p, data %p, data_size %u, data_flags %#x.\n", TRACE("iface %p, asynchronous %p, data %p, data_size %u, data_flags %#x.\n",
iface, asynchronous, data, data_size, data_flags); iface, asynchronous, data, data_size, data_flags);
if (!data && data_size)
return E_INVALIDARG;
wined3d_flags = wined3d_getdata_flags_from_d3d11_async_getdata_flags(data_flags); wined3d_flags = wined3d_getdata_flags_from_d3d11_async_getdata_flags(data_flags);
wined3d_mutex_lock(); wined3d_mutex_lock();

View File

@ -4710,7 +4710,7 @@ static void test_occlusion_query(void)
hr = ID3D11DeviceContext_GetData(context, query, NULL, sizeof(DWORD), 0); hr = ID3D11DeviceContext_GetData(context, query, NULL, sizeof(DWORD), 0);
ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
hr = ID3D11DeviceContext_GetData(context, query, NULL, sizeof(data), 0); hr = ID3D11DeviceContext_GetData(context, query, NULL, sizeof(data), 0);
todo_wine ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
ID3D11DeviceContext_Begin(context, query); ID3D11DeviceContext_Begin(context, query);
ID3D11DeviceContext_End(context, query); ID3D11DeviceContext_End(context, query);