From 894e20c470e62e839c8a70aea8a840f3cd00811e Mon Sep 17 00:00:00 2001 From: baldurk Date: Tue, 25 Apr 2023 11:36:24 +0100 Subject: [PATCH] Disallow querying for internal D3D interface. Closes #2923 * This interface does some undocumented things and then creates unwrapped resources, which can't be wrapped and hooked. Since the interface is not public it can't be wrapped safely, and must be blocked. --- renderdoc/driver/d3d11/d3d11_device.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/renderdoc/driver/d3d11/d3d11_device.cpp b/renderdoc/driver/d3d11/d3d11_device.cpp index 74dce8626..f185fa70b 100644 --- a/renderdoc/driver/d3d11/d3d11_device.cpp +++ b/renderdoc/driver/d3d11/d3d11_device.cpp @@ -575,6 +575,10 @@ HRESULT WrappedID3D11Device::QueryInterface(REFIID riid, void **ppvObject) static const GUID unwrappedID3D11InfoQueue__uuid = { 0x3fc4e618, 0x3f70, 0x452a, {0x8b, 0x8f, 0xa7, 0x3a, 0xcc, 0xb5, 0x8e, 0x3d}}; + // UUID for internal interface that breaks hooks {26C5DC23-E49C-4B0A-8F79-E7B1AC804D32} + static const GUID D3DInternal_uuid = { + 0x26c5dc23, 0xe49c, 0x4b0a, {0x8f, 0x79, 0xe7, 0xb1, 0xac, 0x80, 0x4d, 0x32}}; + HRESULT hr = S_OK; if(riid == __uuidof(IUnknown)) @@ -693,6 +697,12 @@ HRESULT WrappedID3D11Device::QueryInterface(REFIID riid, void **ppvObject) *ppvObject = NULL; return E_NOINTERFACE; } + else if(riid == D3DInternal_uuid) + { + RDCWARN("Trying to get internal unsupported D3D interface - not supported."); + *ppvObject = NULL; + return E_NOINTERFACE; + } else if(riid == __uuidof(ID3D11Device1)) { if(m_pDevice1)