From dd6c79594b59923fdb2d8a2cef5e59701005b51c Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Mon, 11 Mar 2024 20:16:00 +1100 Subject: [PATCH] [host] d12: check for failure to obtain d3d12 functions --- host/platform/Windows/capture/D12/d12.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/host/platform/Windows/capture/D12/d12.c b/host/platform/Windows/capture/D12/d12.c index 1651e505..a5488ec8 100644 --- a/host/platform/Windows/capture/D12/d12.c +++ b/host/platform/Windows/capture/D12/d12.c @@ -206,6 +206,16 @@ static bool d12_create( (typeof(DX12.D3D12SerializeVersionedRootSignature)) GetProcAddress(this->d3d12, "D3D12SerializeVersionedRootSignature"); + if (!DX12.D3D12CreateDevice || + !DX12.D3D12GetDebugInterface || + !DX12.D3D12SerializeVersionedRootSignature) + { + DEBUG_ERROR("Failed to get required exports from d3d12.dll"); + CloseHandle(this->d3d12); + free(this); + return false; + } + this->getPointerBufferFn = getPointerBufferFn; this->postPointerBufferFn = postPointerBufferFn;