Skip to content

Commit

Permalink
Overlay, OverlayClient: add PID and process name diagnostics to 'Dead…
Browse files Browse the repository at this point in the history
… client detected' notice.
  • Loading branch information
mkrautz committed Nov 4, 2014
1 parent 09f6813 commit fd782c3
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/mumble/Overlay.cpp
Expand Up @@ -314,7 +314,7 @@ void Overlay::updateOverlay() {

foreach(OverlayClient *oc, qlClients) {
if (! oc->update()) {
qWarning() << "Overlay: Dead client detected";
qWarning() << "Overlay: Dead client detected. PID" << oc->uiPid << oc->qsProcessName;
qlClients.removeAll(oc);
oc->scheduleDelete();
break;
Expand Down
12 changes: 12 additions & 0 deletions src/mumble/OverlayClient.cpp
Expand Up @@ -479,6 +479,18 @@ void OverlayClient::readyRead() {

OverlayMsgPid *omp = & omMsg.omp;
uiPid = omp->pid;
#ifdef Q_OS_WIN
HANDLE h = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, (DWORD)uiPid);
if (h) {
wchar_t buf[MAX_PATH];
if (GetModuleFileNameEx(h, 0, buf, MAX_PATH) != 0) {
qsExecutablePath = QString::fromWCharArray(buf);
}
CloseHandle(h);
}
#else
qsExecutablePath = QLatin1String("Unknown");
#endif
}
break;
case OVERLAY_MSGTYPE_FPS: {
Expand Down
5 changes: 4 additions & 1 deletion src/mumble/OverlayClient.h
Expand Up @@ -63,8 +63,11 @@ class OverlayClient : public QObject {
QGraphicsPixmapItem *qgpiFPS;
QGraphicsPixmapItem *qgpiTime;

/// The process ID of the processing displaying an overlay.
/// The process ID of the process this OverlayClient is connected to.
quint64 uiPid;
/// The path to the executable of the process that this OverlayClient is connected to.
QString qsExecutablePath;

QGraphicsScene qgs;
OverlayUserGroup ougUsers;

Expand Down
2 changes: 1 addition & 1 deletion src/mumble/mumble.pro
Expand Up @@ -325,7 +325,7 @@ win32 {
}
HEADERS *= GlobalShortcut_win.h TaskList.h
SOURCES *= GlobalShortcut_win.cpp TextToSpeech_win.cpp Overlay_win.cpp SharedMemory_win.cpp Log_win.cpp os_win.cpp TaskList.cpp ../../overlay/HardHook.cpp ../../overlay/ods.cpp
LIBS *= -ldxguid -ldinput8 -lsapi -lole32 -lws2_32 -ladvapi32 -lwintrust -ldbghelp -llibsndfile-1 -lshell32 -lshlwapi -luser32 -lgdi32
LIBS *= -ldxguid -ldinput8 -lsapi -lole32 -lws2_32 -ladvapi32 -lwintrust -ldbghelp -llibsndfile-1 -lshell32 -lshlwapi -luser32 -lgdi32 -lpsapi
LIBS *= -ldelayimp -delayload:speex.dll -delayload:shell32.dll

DEFINES *= WIN32
Expand Down
1 change: 1 addition & 0 deletions src/mumble/mumble_pch.hpp
Expand Up @@ -106,6 +106,7 @@
#include <delayimp.h>
#include <shlobj.h>
#include <tlhelp32.h>
#include <psapi.h>
#ifndef Q_CC_INTEL
#include <math.h>
#define lroundf(x) ( static_cast<long int>( (x) + ((x) >= 0.0f ? 0.5f : -0.5f) ) )
Expand Down

0 comments on commit fd782c3

Please sign in to comment.