| 131 | } |
| 132 | |
| 133 | HRESULT STDMETHODCALLTYPE Direct3DDevice9::QueryInterface(REFIID riid, void **ppvObj) |
| 134 | { |
| 135 | if (ppvObj == nullptr) |
| 136 | return E_POINTER; |
| 137 | |
| 138 | if (check_and_upgrade_interface(riid)) |
| 139 | { |
| 140 | AddRef(); |
| 141 | *ppvObj = this; |
| 142 | return S_OK; |
| 143 | } |
| 144 | |
| 145 | // Interface ID to query the original object from a proxy object |
| 146 | if (riid == IID_UnwrappedObject) |
| 147 | { |
| 148 | _orig->AddRef(); |
| 149 | *ppvObj = _orig; |
| 150 | return S_OK; |
| 151 | } |
| 152 | |
| 153 | if (riid == __uuidof(IDirect3DDevice9On12)) |
| 154 | { |
| 155 | if (_d3d9on12_device != nullptr) |
| 156 | return _d3d9on12_device->QueryInterface(riid, ppvObj); |
| 157 | } |
| 158 | |
| 159 | // Unimplemented interfaces: |
| 160 | // IDirect3DDevice9Video {26DC4561-A1EE-4ae7-96DA-118A36C0EC95} |
| 161 | |
| 162 | return _orig->QueryInterface(riid, ppvObj); |
| 163 | } |
| 164 | ULONG STDMETHODCALLTYPE Direct3DDevice9::AddRef() |
| 165 | { |
| 166 | _orig->AddRef(); |