Windows: Atomically suspend an entire process?

冷暖自知 提交于 2019-12-06 02:01:16
John

Undocumented function NtSuspendProcess in ntdll.dll sounds like what you are looking for. Sysinternals pssuspend and process explorer both make use of this.

The usual caveats about undocumented functions apply.

This answer has some more details: How can I freeze the execution of a program?

Actually thats exactly what MiniDumpWriteDump appears to do - it individually suspends all threads in the process (except for the calling thread) before it creates a dump.

This alone shouldn't cause a deadlock or unexpected behaviour, although obviously its probably best to do this from a separate process.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!