What Killed My Process and Why

What killed my process and why?

If the user or sysadmin did not kill the program the kernel may have. The kernel would only kill a process under exceptional circumstances such as extreme resource starvation (think mem+swap exhaustion).

How to find out who killed the process?

You can not prevent your process from being killed (see this question and this article) and there is no way to know who killed the process.

Kill my process if the other process is killed

    SHELLEXECUTEINFO ShExecInfo = { 0 };
ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
ShExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
ShExecInfo.hwnd = NULL;
ShExecInfo.lpVerb = NULL;
ShExecInfo.lpFile = exeFile.c_str();
ShExecInfo.lpParameters = "";
ShExecInfo.lpDirectory = NULL;
ShExecInfo.nShow = SW_SHOW;
ShExecInfo.hInstApp = NULL;
ShellExecuteEx(&ShExecInfo);
ShowWindow(SW_HIDE);
WaitForSingleObject(ShExecInfo.hProcess, INFINITE);
EndDialog(0);


Related Topics



Leave a reply



Submit