Mercurial > trustbridge
changeset 608:81a44b93229e
Be more permissive with process names. Case insenstive and with suffix or not.
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Wed, 18 Jun 2014 11:22:15 +0200 |
parents | e83589f1fd7f |
children | 292c590ba9cb |
files | ui/processhelp_win.cpp |
diffstat | 1 files changed, 5 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- 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