Add super hacky fix for even more hacky horrible internal MS code

This commit is contained in:
baldurk
2017-02-21 15:17:14 +00:00
parent 05d0ce2c55
commit e55b9d044b
+10 -1
View File
@@ -1182,7 +1182,16 @@ public:
/* [annotation][out] */
__out IDXGIAdapter1 **ppAdapter)
{
HRESULT ret = m_pReal1->EnumAdapters1(Adapter, ppAdapter);
IDXGIFactory1 *factory = m_pReal1;
if(m_pReal1 == NULL)
{
// see comment in RefCountDXGIObject::HandleWrap for IDXGIFactory
RDCWARN("Calling EnumAdapters1 with no IDXGIFactory1 - assuming weird internal call");
factory = (IDXGIFactory1 *)m_pReal;
}
HRESULT ret = factory->EnumAdapters1(Adapter, ppAdapter);
if(SUCCEEDED(ret))
*ppAdapter = (IDXGIAdapter1 *)(new WrappedIDXGIAdapter3(*ppAdapter));
return ret;