diff options
author | Mikkel Krautz <mikkel@krautz.dk> | 2014-11-02 23:34:05 +0300 |
---|---|---|
committer | Mikkel Krautz <mikkel@krautz.dk> | 2014-11-04 21:04:07 +0300 |
commit | fd782c3cb24235be2337b71f1e411240c4c112f1 (patch) | |
tree | 33a9d7a82336ea3840f3da93d1f09a1f94952dae | |
parent | 09f681350195a92925e3e61af52c172133caaa06 (diff) |
Overlay, OverlayClient: add PID and process name diagnostics to 'Dead client detected' notice.
-rw-r--r-- | src/mumble/Overlay.cpp | 2 | ||||
-rw-r--r-- | src/mumble/OverlayClient.cpp | 12 | ||||
-rw-r--r-- | src/mumble/OverlayClient.h | 5 | ||||
-rw-r--r-- | src/mumble/mumble.pro | 2 | ||||
-rw-r--r-- | src/mumble/mumble_pch.hpp | 1 |
5 files changed, 19 insertions, 3 deletions
diff --git a/src/mumble/Overlay.cpp b/src/mumble/Overlay.cpp index df5a1df8c..7a820ebf5 100644 --- a/src/mumble/Overlay.cpp +++ b/src/mumble/Overlay.cpp @@ -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; diff --git a/src/mumble/OverlayClient.cpp b/src/mumble/OverlayClient.cpp index c78a01067..ff54a4d5c 100644 --- a/src/mumble/OverlayClient.cpp +++ b/src/mumble/OverlayClient.cpp @@ -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: { diff --git a/src/mumble/OverlayClient.h b/src/mumble/OverlayClient.h index d8fa0b865..f1dd32ccc 100644 --- a/src/mumble/OverlayClient.h +++ b/src/mumble/OverlayClient.h @@ -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; diff --git a/src/mumble/mumble.pro b/src/mumble/mumble.pro index 94bc8eed6..ceedb62d1 100644 --- a/src/mumble/mumble.pro +++ b/src/mumble/mumble.pro @@ -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 diff --git a/src/mumble/mumble_pch.hpp b/src/mumble/mumble_pch.hpp index 87d13c8fa..318a4477b 100644 --- a/src/mumble/mumble_pch.hpp +++ b/src/mumble/mumble_pch.hpp @@ -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) ) ) |