diff options
author | Kissaki <kissaki@gmx.de> | 2013-05-16 01:50:22 +0400 |
---|---|---|
committer | Kissaki <kissaki@gmx.de> | 2013-06-17 02:03:20 +0400 |
commit | b07053241ab25e7f29c5d798118e93d55507d574 (patch) | |
tree | 4b8541ff27019af3384a1bd5cb4f8d00c188fd6e /overlay | |
parent | 1182fc26cb7c0c9452bd0b677ac0a34cd6d843e6 (diff) |
Overlay: Fix address offset
Diffstat (limited to 'overlay')
-rw-r--r-- | overlay/d3d9.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/overlay/d3d9.cpp b/overlay/d3d9.cpp index 7d7a80373..b424e3833 100644 --- a/overlay/d3d9.cpp +++ b/overlay/d3d9.cpp @@ -843,6 +843,9 @@ void hookD3D9(HMODULE hD3D, bool preonly) { } else { ods("D3D9: Library without Direct3DCreate9?"); } + + //TODO: hook for Direct3DCreate9Ex + // pDirect3DCreate9Ex d3dcreate9ex = reinterpret_cast<pDirect3DCreate9Ex>(GetProcAddress(hD3D, "Direct3DCreate9Ex")); } else { bHooked = false; } @@ -937,8 +940,11 @@ extern "C" __declspec(dllexport) void __cdecl PrepareD3D9() { if (id3d9) { void ***vtbl = (void ***) id3d9; // vtable offset: CreateDeviceEx is 20th method (0 based 19th) - // in IDirect3D9Ex. See d3d9.h of win-/D3D-API. - void *pCreateEx = (*vtbl)[19]; + // in IDirect3D9Ex as declared in d3d9.h of win-/D3D-API, + // but is actually the 21th. TODO: How come? + // CreateDeviceEx defines one less method before-hand than + // CreateDevice. Maybe that one comes in anyway? + void *pCreateEx = (*vtbl)[20]; if (!IsFnInModule(d3dd->cFileName, (const char*)pCreateEx, "CreateDeviceEx")) { ods("D3D9: CreateDeviceEx is not in D3D9 library"); |