Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/d3d10core/tests/d3d10core.c | 2 ++ dlls/d3d11/device.c | 4 ++++ dlls/d3d11/tests/d3d11.c | 2 ++ 3 files changed, 8 insertions(+)
diff --git a/dlls/d3d10core/tests/d3d10core.c b/dlls/d3d10core/tests/d3d10core.c index f8dcbb8cb47..a5f7f4202d5 100644 --- a/dlls/d3d10core/tests/d3d10core.c +++ b/dlls/d3d10core/tests/d3d10core.c @@ -2678,9 +2678,11 @@ static void test_create_depthstencil_view(void) hr = ID3D10Device_CreateTexture2D(device, &texture_desc, NULL, &texture); ok(SUCCEEDED(hr), "Test %u: Failed to create 2d texture, hr %#x.\n", i, hr);
+ dsview = (void *)0xdeadbeef; get_dsv_desc(&dsv_desc, &invalid_desc_tests[i].dsv_desc); hr = ID3D10Device_CreateDepthStencilView(device, (ID3D10Resource *)texture, &dsv_desc, &dsview); ok(hr == E_INVALIDARG, "Test %u: Got unexpected hr %#x.\n", i, hr); + ok(!dsview, "Unexpected pointer %p.\n", dsview);
ID3D10Texture2D_Release(texture); } diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 7e5acc11824..92d4533b105 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -3440,6 +3440,8 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CreateDepthStencilView(ID3D11Devic
TRACE("iface %p, resource %p, desc %p, view %p.\n", iface, resource, desc, view);
+ *view = NULL; + if (FAILED(hr = d3d_depthstencil_view_create(device, resource, desc, &object))) return hr;
@@ -6103,6 +6105,8 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreateDepthStencilView(ID3D10Devic
TRACE("iface %p, resource %p, desc %p, view %p.\n", iface, resource, desc, view);
+ *view = NULL; + if (desc) { d3d11_desc.Format = desc->Format; diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index ec385a92f50..93f0aa896e8 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -3788,9 +3788,11 @@ static void test_create_depthstencil_view(void) hr = ID3D11Device_CreateTexture2D(device, &texture_desc, NULL, &texture); ok(SUCCEEDED(hr), "Test %u: Failed to create 2d texture, hr %#x.\n", i, hr);
+ dsview = (void *)0xdeadbeef; get_dsv_desc(&dsv_desc, &invalid_desc_tests[i].dsv_desc); hr = ID3D11Device_CreateDepthStencilView(device, (ID3D11Resource *)texture, &dsv_desc, &dsview); ok(hr == E_INVALIDARG, "Test %u: Got unexpected hr %#x.\n", i, hr); + ok(!dsview, "Unexpected pointer %p.\n", dsview);
ID3D11Texture2D_Release(texture); }