Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51195 Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/d3d10core/tests/d3d10core.c | 4 ++++ dlls/d3d11/device.c | 4 ++++ dlls/d3d11/tests/d3d11.c | 4 ++++ 3 files changed, 12 insertions(+)
diff --git a/dlls/d3d10core/tests/d3d10core.c b/dlls/d3d10core/tests/d3d10core.c index d7fc9efa901..ca12f185ec5 100644 --- a/dlls/d3d10core/tests/d3d10core.c +++ b/dlls/d3d10core/tests/d3d10core.c @@ -2939,8 +2939,10 @@ static void test_create_rendertarget_view(void)
if (!enable_debug_layer) { + rtview = (void *)0xdeadbeef; hr = ID3D10Device_CreateRenderTargetView(device, NULL, &rtv_desc, &rtview); ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + ok(!rtview, "Unexpected pointer %p.\n", rtview); }
expected_refcount = get_refcount(device) + 1; @@ -3057,8 +3059,10 @@ static void test_create_rendertarget_view(void) }
get_rtv_desc(&rtv_desc, &invalid_desc_tests[i].rtv_desc); + rtview = (void *)0xdeadbeef; hr = ID3D10Device_CreateRenderTargetView(device, texture, &rtv_desc, &rtview); ok(hr == E_INVALIDARG, "Test %u: Got unexpected hr %#x.\n", i, hr); + ok(!rtview, "Unexpected pointer %p.\n", rtview);
ID3D10Resource_Release(texture); } diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 546449037ce..626e4889708 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -3334,6 +3334,8 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CreateRenderTargetView(ID3D11Devic
TRACE("iface %p, resource %p, desc %p, view %p.\n", iface, resource, desc, view);
+ *view = NULL; + if (!resource) return E_INVALIDARG;
@@ -5957,6 +5959,8 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreateRenderTargetView(ID3D10Devic
TRACE("iface %p, resource %p, desc %p, view %p.\n", iface, resource, desc, view);
+ *view = NULL; + if (!resource) return E_INVALIDARG;
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index a76e5fa1295..b8fa462dc39 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -4050,8 +4050,10 @@ static void test_create_rendertarget_view(void)
if (!enable_debug_layer) { + rtview = (void *)0xdeadbeef; hr = ID3D11Device_CreateRenderTargetView(device, NULL, &rtv_desc, &rtview); ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + ok(!rtview, "Unexpected pointer %p.\n", rtview); }
expected_refcount = get_refcount(device) + 1; @@ -4168,8 +4170,10 @@ static void test_create_rendertarget_view(void) }
get_rtv_desc(&rtv_desc, &invalid_desc_tests[i].rtv_desc); + rtview = (void *)0xdeadbeef; hr = ID3D11Device_CreateRenderTargetView(device, texture, &rtv_desc, &rtview); ok(hr == E_INVALIDARG, "Test %u: Got unexpected hr %#x.\n", i, hr); + ok(!rtview, "Unexpected pointer %p.\n", rtview);
ID3D11Resource_Release(texture); }