19 Mar
2019
19 Mar
'19
12:41 a.m.
Hello,
I've been having these 2 implemented in psutil for a long time. On
POSIX these are convenience functions using os.kill() + SIGSTOP /
SIGCONT (the same as CTRL+Z / "fg"). On Windows they use undocumented
NtSuspendProcess and NtResumeProcess Windows APIs available since XP.
The same approach is used by ProcessHacker and - I suppose -
pssupend.exe, both from Sysinternals team. It must be noted that there
are 3 different ways to do this on Windows
(https://stackoverflow.com/a/11010508/376587) but
NtSuspend/ResumeProcess appears to be the best choice. Possible use
case:
<