Skip to content
Permalink
Browse files

Overlay: Var init, comment, error loggin.

  • Loading branch information...
Kissaki committed Apr 21, 2013
1 parent d74b5b0 commit 04b344dc42fb07804489f4629286207743eb3b80
Showing with 12 additions and 5 deletions.
  1. +2 −0 overlay/d3d9.cpp
  2. +2 −1 overlay/lib.cpp
  3. +8 −4 src/mumble/Overlay_win.cpp
@@ -772,6 +772,8 @@ void hookD3D9(HMODULE hD3D, bool preonly) {
// Can we use the prepatch data?
GetModuleFileName(hD3D, procname, procnamesize);
if (_stricmp(d3dd->cFileName, procname) == 0) {
// The module seems to match the one we prepared d3dd for.

unsigned char *raw = (unsigned char *) hD3D;
HookCreateRaw((voidFunc)(raw + d3dd->iOffsetCreate));
if (d3dd->iOffsetCreateEx)
@@ -508,6 +508,7 @@ extern "C" __declspec(dllexport) unsigned int __cdecl GetOverlayMagicVersion() {
extern "C" BOOL WINAPI DllMain(HINSTANCE, DWORD fdwReason, LPVOID) {
char procname[1024+64];
GetModuleFileNameA(NULL, procname, 1024);

switch (fdwReason) {
case DLL_PROCESS_ATTACH: {
Mutex::init();
@@ -521,7 +522,7 @@ extern "C" BOOL WINAPI DllMain(HINSTANCE, DWORD fdwReason, LPVOID) {
} else {
DWORD buffsize = MAX_PATH * 20; // Initial buffer size for registry operation

bool usewhitelist;
bool usewhitelist = false;
HKEY key = NULL;

char *buffer = new char[buffsize];
@@ -44,12 +44,12 @@ typedef void (__cdecl *PrepDXGIProc)();
extern "C" __declspec(dllexport) void mumbleSelfDetection() {};

OverlayPrivateWin::OverlayPrivateWin(QObject *p) : OverlayPrivate(p) {
QString path=QString::fromLatin1("%1/mumble_ol.dll").arg(qApp->applicationDirPath());

qlOverlay = new QLibrary(this);
hpInstall = NULL;
hpRemove = NULL;
qlOverlay = new QLibrary(this);

QString path = QString::fromLatin1("%1/mumble_ol.dll").arg(qApp->applicationDirPath());
qlOverlay->setFileName(path);
if (! qlOverlay->load()) {
QMessageBox::critical(NULL, QLatin1String("Mumble"), tr("Failed to load overlay library. This means either that:\n"
@@ -60,11 +60,15 @@ OverlayPrivateWin::OverlayPrivateWin(QObject *p) : OverlayPrivate(p) {
}

GetOverlayMagicVersionProc gompvp = (GetOverlayMagicVersionProc)qlOverlay->resolve("GetOverlayMagicVersion");
if (! gompvp)
if (! gompvp) {
qWarning("The overlay librarys overlay protocol version could not be verified. Overlay will not be enabled.");
return;
}

if (gompvp() != OVERLAY_MAGIC_NUMBER)
if (gompvp() != OVERLAY_MAGIC_NUMBER) {
qWarning("Client overlay protocol version does not match the overlay library one. Overlay will not be enabled.");
return;
}

hpInstall = (HooksProc)qlOverlay->resolve("InstallHooks");
hpRemove = (HooksProc)qlOverlay->resolve("RemoveHooks");

0 comments on commit 04b344d

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