[PATCH 4 of 6] Be more permissive with process names. Case insenstive and with suffix or not

Wald Commits scm-commit at wald.intevation.org
Wed Jun 18 14:41:32 CEST 2014


# HG changeset patch
# User Andre Heinecke <andre.heinecke at intevation.de>
# Date 1403083335 -7200
# Node ID 81a44b93229e039c87545591d0a7f782d5a1e3fe
# Parent  e83589f1fd7f5945d0761b42c05d5ac3b499e95c
Be more permissive with process names. Case insenstive and with suffix or not.

diff -r e83589f1fd7f -r 81a44b93229e ui/processhelp_win.cpp
--- a/ui/processhelp_win.cpp	Wed Jun 18 11:21:13 2014 +0200
+++ b/ui/processhelp_win.cpp	Wed Jun 18 11:22:15 2014 +0200
@@ -102,8 +102,12 @@
 
     pids.clear();
 
+    const QString processNameLower = processName.toLower().replace(".exe", "");
+    const QString processNameExe = processNameLower + ".exe";
+
     do {
-        if (QString::fromWCharArray(pe32.szExeFile) == processName) {
+        const QString exeFile = QString::fromWCharArray(pe32.szExeFile).toLower();
+        if (exeFile == processNameLower || exeFile == processNameExe) {
             PSID user_sid = getProcessOwner(GetCurrentProcess());
             if (user_sid) {
                 // Also check that we are the owner of that process


More information about the Trustbridge-commits mailing list