1
0
mirror of synced 2024-11-24 05:50:12 +01:00

gfx: hook no longer crashes

This commit is contained in:
Hay1tsme 2023-01-04 14:25:21 -05:00
parent 3158f60709
commit 1a507f77e7
2 changed files with 2 additions and 22 deletions

View File

@ -91,4 +91,4 @@ BOOL WINAPI DllMain(HMODULE mod, DWORD cause, void *ctx)
}
return SUCCEEDED(hr);
}
}

View File

@ -192,7 +192,7 @@ HRESULT WINAPI CreateDXGIFactory2(UINT flags, REFIID riid, void **factory)
return hr;
}
hr = hook_factory(riid, factory);
//hr = hook_factory(riid, factory);
if (FAILED(hr)) {
return hr;
@ -206,15 +206,12 @@ static HRESULT hook_factory(REFIID riid, void **factory)
struct com_proxy *proxy;
IDXGIFactory *api_0;
IDXGIFactory1 *api_1;
IDXGIFactory2 *api_2;
IDXGIFactoryVtbl *vtbl_0;
IDXGIFactory1Vtbl *vtbl_1;
IDXGIFactory2Vtbl *vtbl_2;
HRESULT hr;
api_0 = NULL;
api_1 = NULL;
api_2 = NULL;
dprintf("DXGI: hook_factory\n");
@ -245,20 +242,6 @@ static HRESULT hook_factory(REFIID riid, void **factory)
vtbl_1 = proxy->vptr;
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;
}
@ -272,9 +255,6 @@ fail:
if (api_1 != NULL) {
IDXGIFactory1_Release(api_1);
}
if (api_2 != NULL) {
IDXGIFactory2_Release(api_2);
}
return hr;
}