Skip to content
Permalink
Browse files

Overlay, OverlayClient: add PID and process name diagnostics to 'Dead…

… client detected' notice.
  • Loading branch information...
mkrautz committed Nov 2, 2014
1 parent 09f6813 commit fd782c3cb24235be2337b71f1e411240c4c112f1
Showing with 19 additions and 3 deletions.
  1. +1 −1 src/mumble/Overlay.cpp
  2. +12 −0 src/mumble/OverlayClient.cpp
  3. +4 −1 src/mumble/OverlayClient.h
  4. +1 −1 src/mumble/mumble.pro
  5. +1 −0 src/mumble/mumble_pch.hpp
@@ -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;
@@ -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: {
@@ -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;

@@ -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
@@ -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) ) )

0 comments on commit fd782c3

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