Handle querying for ID3D12Pageable on interfaces that support it

This commit is contained in:
baldurk
2019-06-13 14:01:37 +01:00
parent 0bef9cb973
commit 6adaa4dd09
+30 -5
View File
@@ -129,14 +129,17 @@ public:
AddRef();
return S_OK;
}
if(riid == __uuidof(NestedType))
else if(riid == __uuidof(NestedType))
{
*ppvObject = (NestedType *)this;
AddRef();
return S_OK;
}
if(riid == __uuidof(NestedType1) && m_pReal)
else if(riid == __uuidof(NestedType1))
{
if(!m_pReal)
return E_NOINTERFACE;
// check that the real interface supports this
NestedType1 *dummy = NULL;
HRESULT check = m_pReal->QueryInterface(riid, (void **)&dummy);
@@ -150,8 +153,11 @@ public:
AddRef();
return S_OK;
}
if(riid == __uuidof(NestedType2) && m_pReal)
else if(riid == __uuidof(NestedType2))
{
if(!m_pReal)
return E_NOINTERFACE;
// check that the real interface supports this
NestedType2 *dummy = NULL;
HRESULT check = m_pReal->QueryInterface(riid, (void **)&dummy);
@@ -165,13 +171,32 @@ public:
AddRef();
return S_OK;
}
if(riid == __uuidof(ID3D12Object))
else if(riid == __uuidof(ID3D12Pageable))
{
// not all child classes support this, so check it on the real interface
if(!m_pReal)
return E_NOINTERFACE;
// check that the real interface supports this
ID3D12Pageable *dummy = NULL;
HRESULT check = m_pReal->QueryInterface(riid, (void **)&dummy);
SAFE_RELEASE(dummy);
if(FAILED(check))
return check;
*ppvObject = (ID3D12Pageable *)this;
AddRef();
return S_OK;
}
else if(riid == __uuidof(ID3D12Object))
{
*ppvObject = (ID3D12DeviceChild *)this;
AddRef();
return S_OK;
}
if(riid == __uuidof(ID3D12DeviceChild))
else if(riid == __uuidof(ID3D12DeviceChild))
{
*ppvObject = (ID3D12DeviceChild *)this;
AddRef();