brutally murder lokinet process

This commit is contained in:
Rick V 2020-03-04 11:56:16 -06:00
parent 80a6ae4e7e
commit e633727fc4
No known key found for this signature in database
GPG key ID: C0EDC8723FDC3465

View file

@ -39,30 +39,24 @@ bool WindowsLokinetProcessManager::doStartLokinetProcess()
bool WindowsLokinetProcessManager::doStopLokinetProcess()
{
// cmd: taskkill /T /IM lokinet.exe
QStringList args = { "/T", "/IM", "lokinet.exe" };
int result = QProcess::execute("taskkill", args);
if (result)
{
qDebug("Failed to taskkill lokinet: %d", result);
return false;
}
return true;
// not supported on this platform
return false;
}
bool WindowsLokinetProcessManager::doForciblyStopLokinetProcess()
{
// cmd: taskkill /F /PID [pid]
int p;
doGetProcessPid(p);
QStringList args = { "/F", "/PID", QString::number(p,10) };
int result = QProcess::execute("taskkill", args);
if (result)
{
qDebug("Failed to taskkill /F lokinet: %d", result);
HANDLE lokinetProcess;
if (doGetProcessPid(p))
lokinetProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, (DWORD)p);
else
return false;
if (TerminateProcess(lokinetProcess, 0))
return true;
else
return false;
}
return true;
}