How to pause / resume any external process under Windows?

后端 未结 6 1455
粉色の甜心
粉色の甜心 2020-12-16 19:56

I am looking for different ways to pause and resume programmatically a particular process via its process ID under Windows XP.

Process suspend/resume tool does it wi

6条回答
  •  别那么骄傲
    2020-12-16 20:22

    If you "debug the debugger" (for instance, using logger.exe to trace all API calls made by windbg.exe), it appears that the debugger uses SuspendThread()/ResumeThread() to suspend all of the threads in the process being debugged.

    PsSuspend may use a different way of suspending processes (I'm not sure), but it is still possible to hang other processes: if the process you're suspending is holding a shared synchronization object that is needed by another process, you may block that other process from making any progress. If both programs are well-written, they should recover when you resume the one that you suspended, but not all programs are well-written. And if this causes your program that is doing the suspending to hang, then you have a deadlock.

提交回复
热议问题