Re: [Python-ideas] Add subprocess.Popen suspend() and resume()

2019-03-24 Thread eryk sun
On 3/24/19, Giampaolo Rodola' wrote: > On Wed, Mar 20, 2019 at 11:19 PM eryk sun wrote: > >> This code repeatedly calls PsGetNextProcessThread to walk the >> non-terminated threads of the process in creation order (based on a >> linked list in the process object) and suspends each thread via >>

Re: [Python-ideas] Add subprocess.Popen suspend() and resume()

2019-03-24 Thread Giampaolo Rodola'
On Wed, Mar 20, 2019 at 11:19 PM eryk sun wrote: > > On 3/18/19, Giampaolo Rodola' wrote: > > > > 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

Re: [Python-ideas] Add subprocess.Popen suspend() and resume()

2019-03-24 Thread Gregory P. Smith
I don't think this belongs in subprocess. It isn't related to processes creation. A module on PyPI with the Windows code would make more sense. On Wed, Mar 20, 2019 at 3:19 PM eryk sun wrote: > On 3/18/19, Giampaolo Rodola' wrote: > > > > I've been having these 2 implemented in psutil for a

Re: [Python-ideas] Add subprocess.Popen suspend() and resume()

2019-03-20 Thread eryk sun
On 3/18/19, Giampaolo Rodola' wrote: > > 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 >

Re: [Python-ideas] Add subprocess.Popen suspend() and resume()

2019-03-18 Thread Antoine Pitrou
Seems reasonable to me. Regards Antoine. On Mon, 18 Mar 2019 16:41:34 +0100 "Giampaolo Rodola'" wrote: > 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

[Python-ideas] Add subprocess.Popen suspend() and resume()

2019-03-18 Thread Giampaolo Rodola'
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