How to create suspended process from c# without P/Invoke?

[亡魂溺海] 提交于 2020-01-11 10:08:14

问题


WinAPI CreateProcess has the flag CREATE_SUSPENDED so it's possible to attach process to JobObject before it has done something and then to call ResumeThread for its main thread. The only that I found searching for a solution is this post written 11 years ago!


回答1:


The only way to do this is with CreateProcess. The .net Process class does not offer the functionality. Either p/invoke CreateProcess or use a mixed mode C++/CLI assembly to call the same.



来源:https://stackoverflow.com/questions/22570591/how-to-create-suspended-process-from-c-sharp-without-p-invoke

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