[PATCH 6/7] d3d11: Always initialize out shader pointer in CreateDomainShader().
Nikolay Sivov
wine at gitlab.winehq.org
Fri May 27 07:23:37 CDT 2022
From: Nikolay Sivov <nsivov at codeweavers.com>
---
dlls/d3d11/device.c | 2 ++
dlls/d3d11/tests/d3d11.c | 7 +++++++
2 files changed, 9 insertions(+)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c
index 286874af993..b73df94b50c 100644
--- a/dlls/d3d11/device.c
+++ b/dlls/d3d11/device.c
@@ -3592,6 +3592,8 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CreateDomainShader(ID3D11Device2 *
TRACE("iface %p, byte_code %p, byte_code_length %Iu, class_linkage %p, shader %p.\n",
iface, byte_code, byte_code_length, class_linkage, shader);
+ *shader = NULL;
+
if (class_linkage)
FIXME("Class linkage is not implemented yet.\n");
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c
index 690f468e6cf..06cb2bc4273 100644
--- a/dlls/d3d11/tests/d3d11.c
+++ b/dlls/d3d11/tests/d3d11.c
@@ -4824,6 +4824,7 @@ static void test_create_shader(const D3D_FEATURE_LEVEL feature_level)
ID3D11Device *device, *tmp;
ID3D11GeometryShader *gs;
ID3D11VertexShader *vs;
+ ID3D11DomainShader *ds;
ID3D11PixelShader *ps;
ID3D11HullShader *hs;
HRESULT hr;
@@ -5007,6 +5008,12 @@ static void test_create_shader(const D3D_FEATURE_LEVEL feature_level)
ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr);
ok(!hs, "Unexpected pointer %p.\n", hs);
+ /* Domain shader */
+ ds = (void *)0xdeadbeef;
+ hr = ID3D11Device_CreateDomainShader(device, gs_4_0, sizeof(gs_4_0), NULL, &ds);
+ ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr);
+ ok(!ds, "Unexpected pointer %p.\n", ds);
+
refcount = ID3D11Device_Release(device);
ok(!refcount, "Device has %lu references left.\n", refcount);
}
--
GitLab
https://gitlab.winehq.org/wine/wine/-/merge_requests/141
More information about the wine-devel
mailing list