diff options
author | Kissaki <kissaki@gmx.de> | 2013-06-17 01:09:20 +0400 |
---|---|---|
committer | Kissaki <kissaki@gmx.de> | 2013-06-17 01:56:45 +0400 |
commit | 3865e8cab080875e44dd6e15cc64d2f3e55706d8 (patch) | |
tree | f2fe5f945394eea368940a3be505cc38f4f3da04 /overlay | |
parent | 04b344dc42fb07804489f4629286207743eb3b80 (diff) |
Overlay: Code comments
Diffstat (limited to 'overlay')
-rw-r--r-- | overlay/d3d9.cpp | 3 | ||||
-rw-r--r-- | overlay/lib.cpp | 1 | ||||
-rw-r--r-- | overlay/lib.h | 3 |
3 files changed, 6 insertions, 1 deletions
diff --git a/overlay/d3d9.cpp b/overlay/d3d9.cpp index 2d06fc291..68362b8be 100644 --- a/overlay/d3d9.cpp +++ b/overlay/d3d9.cpp @@ -779,7 +779,7 @@ void hookD3D9(HMODULE hD3D, bool preonly) { if (d3dd->iOffsetCreateEx) HookCreateRawEx((voidFunc)(raw + d3dd->iOffsetCreateEx)); } else if (! preonly) { - ods("D3D9: Interface changed, can't rawpatch"); + ods("D3D9: Interface changed, can't rawpatch."); pDirect3DCreate9 d3dcreate9 = reinterpret_cast<pDirect3DCreate9>(GetProcAddress(hD3D, "Direct3DCreate9")); if (d3dcreate9) { @@ -831,6 +831,7 @@ extern "C" __declspec(dllexport) void __cdecl PrepareD3D9() { char buffb[2048]; GetModuleFileName(hD3D, d3dd->cFileName, 2048); + pDirect3DCreate9 d3dc9 = reinterpret_cast<pDirect3DCreate9>(GetProcAddress(hD3D, "Direct3DCreate9")); if (! d3dc9) { ods("D3D9: Library without Direct3DCreate9"); diff --git a/overlay/lib.cpp b/overlay/lib.cpp index de7a3ab17..f43d598a3 100644 --- a/overlay/lib.cpp +++ b/overlay/lib.cpp @@ -677,6 +677,7 @@ extern "C" BOOL WINAPI DllMain(HINSTANCE, DWORD fdwReason, LPVOID) { if (! bMumble) { + // Hook our own LoadLibrary functions so we notice when a new library (like the d3d ones) is loaded. hhLoad.setup(reinterpret_cast<voidFunc>(LoadLibraryA), reinterpret_cast<voidFunc>(MyLoadLibrary)); hhLoadW.setup(reinterpret_cast<voidFunc>(LoadLibraryW), reinterpret_cast<voidFunc>(MyLoadLibraryW)); hhFree.setup(reinterpret_cast<voidFunc>(FreeLibrary), reinterpret_cast<voidFunc>(MyFreeLibrary)); diff --git a/overlay/lib.h b/overlay/lib.h index 0410cb998..43321b03b 100644 --- a/overlay/lib.h +++ b/overlay/lib.h @@ -52,8 +52,11 @@ using namespace std; void __cdecl ods(const char *format, ...); struct Direct3D9Data { + // Offset from module address to Create method. int iOffsetCreate; + // Offset from module address to CreateEx method. int iOffsetCreateEx; + // Filename of the module. char cFileName[2048]; }; |