Mercurial > trustbridge
comparison ui/processhelp_win.cpp @ 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 | 91dd38a71783 |
children | 175370634226 |
comparison
equal
deleted
inserted
replaced
607:e83589f1fd7f | 608:81a44b93229e |
---|---|
100 return pids; | 100 return pids; |
101 } | 101 } |
102 | 102 |
103 pids.clear(); | 103 pids.clear(); |
104 | 104 |
105 const QString processNameLower = processName.toLower().replace(".exe", ""); | |
106 const QString processNameExe = processNameLower + ".exe"; | |
107 | |
105 do { | 108 do { |
106 if (QString::fromWCharArray(pe32.szExeFile) == processName) { | 109 const QString exeFile = QString::fromWCharArray(pe32.szExeFile).toLower(); |
110 if (exeFile == processNameLower || exeFile == processNameExe) { | |
107 PSID user_sid = getProcessOwner(GetCurrentProcess()); | 111 PSID user_sid = getProcessOwner(GetCurrentProcess()); |
108 if (user_sid) { | 112 if (user_sid) { |
109 // Also check that we are the owner of that process | 113 // Also check that we are the owner of that process |
110 HANDLE hProcess = getProcessHandle(pe32.th32ProcessID); | 114 HANDLE hProcess = getProcessHandle(pe32.th32ProcessID); |
111 if (!hProcess) { | 115 if (!hProcess) { |