Skip to content
Permalink
Browse files

Overlay: Code comments

  • Loading branch information...
Kissaki committed Jun 16, 2013
1 parent 04b344d commit 3865e8cab080875e44dd6e15cc64d2f3e55706d8
Showing with 6 additions and 1 deletion.
  1. +2 −1 overlay/d3d9.cpp
  2. +1 −0 overlay/lib.cpp
  3. +3 −0 overlay/lib.h
@@ -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");
@@ -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));
@@ -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];
};

0 comments on commit 3865e8c

Please sign in to comment.
You can’t perform that action at this time.