MCPcopy Create free account
hub / github.com/WinDurango/WinDurango / QueryInterface

Method QueryInterface

projects/WinDurango.D3D11X/src/ID3D11Device.cpp:19–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17//
18// IUnknown
19//
20template <abi_t ABI> HRESULT D3D11DeviceX<ABI>::QueryInterface(REFIID riid, void **ppvObject)
21{
22 if (riid == xcom::guid_of<gfx::ID3D11Device>() || riid == xcom::guid_of<gfx::ID3D11Device1>() ||
23 riid == xcom::guid_of<gfx::ID3D11Device2>() || riid == xcom::guid_of<gfx::ID3D11DeviceX>() ||
24 riid == xcom::guid_of<gfx::ID3D11PerformanceDeviceX>())
25 {
26 *ppvObject = this;
27 AddRef();
28 return S_OK;
29 }
30
31 if (riid == xcom::guid_of<gfx::IDXGIDevice>() || riid == xcom::guid_of<gfx::IDXGIDevice1>() ||
32 riid == xcom::guid_of<gfx::IDXGIDevice2>())
33 {
34 m_pFunction->QueryInterface(__uuidof(IDXGIDevice2), ppvObject);
35 *ppvObject = new DXGIDevice2<ABI>(static_cast<IDXGIDevice2 *>(*ppvObject));
36 return S_OK;
37 }
38
39 if (riid == xcom::guid_of<xbox::IGraphicsUnwrap>())
40 {
41 *ppvObject = m_pFunction;
42 return S_OK;
43 }
44
45 if (riid == __uuidof(ID3D11InfoQueue))
46 {
47 *ppvObject = nullptr;
48 return E_NOINTERFACE;
49 }
50
51 if (riid == __uuidof(ID3D12Device))
52 {
53 *ppvObject = nullptr;
54 return E_NOINTERFACE;
55 }
56
57 *ppvObject = nullptr;
58 return E_NOINTERFACE;
59}
60
61template <abi_t ABI> ULONG D3D11DeviceX<ABI>::AddRef()
62{

Callers 5

CreateDeferredContextMethod · 0.45
GetImmediateContextMethod · 0.45

Calls 1

AddRefFunction · 0.85

Tested by

no test coverage detected