d3d10_1: Check parameter in ID3D10Device1 CreateShaderResourceView1.
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
7b0f376282
commit
21f46b8fed
|
@ -371,6 +371,9 @@ static void test_create_shader_resource_view(void)
|
|||
U(srv_desc).Buffer.ElementOffset = 0;
|
||||
U(srv_desc).Buffer.ElementWidth = 64;
|
||||
|
||||
hr = ID3D10Device1_CreateShaderResourceView1(device, NULL, &srv_desc, &srview);
|
||||
ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
expected_refcount = get_refcount((IUnknown *)device) + 1;
|
||||
hr = ID3D10Device1_CreateShaderResourceView1(device, (ID3D10Resource *)buffer, &srv_desc, &srview);
|
||||
ok(SUCCEEDED(hr), "Failed to create a shader resource view, hr %#x\n", hr);
|
||||
|
|
|
@ -4551,6 +4551,9 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreateShaderResourceView1(ID3D10De
|
|||
|
||||
TRACE("iface %p, resource %p, desc %p, view %p.\n", iface, resource, desc, view);
|
||||
|
||||
if (!resource)
|
||||
return E_INVALIDARG;
|
||||
|
||||
if (FAILED(hr = ID3D10Resource_QueryInterface(resource, &IID_ID3D11Resource, (void **)&d3d11_resource)))
|
||||
{
|
||||
ERR("Resource does not implement ID3D11Resource.\n");
|
||||
|
|
Loading…
Reference in New Issue