mirror of
https://github.com/oxen-io/lokinet-control-panel.git
synced 2023-12-14 05:53:00 +01:00
brutally murder lokinet process
This commit is contained in:
parent
80a6ae4e7e
commit
e633727fc4
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue