gfx: hook no longer crashes
This commit is contained in:
parent
3158f60709
commit
1a507f77e7
@ -192,7 +192,7 @@ HRESULT WINAPI CreateDXGIFactory2(UINT flags, REFIID riid, void **factory)
|
|||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
hr = hook_factory(riid, factory);
|
//hr = hook_factory(riid, factory);
|
||||||
|
|
||||||
if (FAILED(hr)) {
|
if (FAILED(hr)) {
|
||||||
return hr;
|
return hr;
|
||||||
@ -206,15 +206,12 @@ static HRESULT hook_factory(REFIID riid, void **factory)
|
|||||||
struct com_proxy *proxy;
|
struct com_proxy *proxy;
|
||||||
IDXGIFactory *api_0;
|
IDXGIFactory *api_0;
|
||||||
IDXGIFactory1 *api_1;
|
IDXGIFactory1 *api_1;
|
||||||
IDXGIFactory2 *api_2;
|
|
||||||
IDXGIFactoryVtbl *vtbl_0;
|
IDXGIFactoryVtbl *vtbl_0;
|
||||||
IDXGIFactory1Vtbl *vtbl_1;
|
IDXGIFactory1Vtbl *vtbl_1;
|
||||||
IDXGIFactory2Vtbl *vtbl_2;
|
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
api_0 = NULL;
|
api_0 = NULL;
|
||||||
api_1 = NULL;
|
api_1 = NULL;
|
||||||
api_2 = NULL;
|
|
||||||
|
|
||||||
dprintf("DXGI: hook_factory\n");
|
dprintf("DXGI: hook_factory\n");
|
||||||
|
|
||||||
@ -245,20 +242,6 @@ static HRESULT hook_factory(REFIID riid, void **factory)
|
|||||||
vtbl_1 = proxy->vptr;
|
vtbl_1 = proxy->vptr;
|
||||||
vtbl_1->CreateSwapChain = my_IDXGIFactory1_CreateSwapChain;
|
vtbl_1->CreateSwapChain = my_IDXGIFactory1_CreateSwapChain;
|
||||||
|
|
||||||
*factory = proxy;
|
|
||||||
} else if (memcmp(riid, &IID_IDXGIFactory2, sizeof(*riid)) == 0) {
|
|
||||||
api_2 = *factory;
|
|
||||||
hr = com_proxy_wrap(&proxy, api_2, sizeof(*api_2->lpVtbl));
|
|
||||||
|
|
||||||
if (FAILED(hr)) {
|
|
||||||
dprintf("DXGI: com_proxy_wrap returned %x\n", (int) hr);
|
|
||||||
|
|
||||||
goto fail;
|
|
||||||
}
|
|
||||||
|
|
||||||
vtbl_2 = proxy->vptr;
|
|
||||||
vtbl_2->CreateSwapChain = my_IDXGIFactory2_CreateSwapChain;
|
|
||||||
|
|
||||||
*factory = proxy;
|
*factory = proxy;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -272,9 +255,6 @@ fail:
|
|||||||
if (api_1 != NULL) {
|
if (api_1 != NULL) {
|
||||||
IDXGIFactory1_Release(api_1);
|
IDXGIFactory1_Release(api_1);
|
||||||
}
|
}
|
||||||
if (api_2 != NULL) {
|
|
||||||
IDXGIFactory2_Release(api_2);
|
|
||||||
}
|
|
||||||
|
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user