Post by Denis @ TheOfficePost by Gary ChansonPost by Denis @ TheOfficeI see that there is an option to OpenProcess for suspend/resume.
I do not see the SuspendProcess nor ResumeProcess call for it?
In the case that there is no such thing Is there a way to do the equivalent?
Call SuspendThread for each thread in the process.
--
- Gary Chanson (Windows SDK MVP)
- Abolish Public Schools
I see.
Should I suspend thread in a certain order?
Is there a way to locate the main thread?
There is no real concept of a main thread in Windows. When you enumerate
the threads, the first thread will typically be the first one created and is
probably what you might think of as the main thread.
There's no way to know if it matters what order you suspend them in. If
its critical that all threads get suspended at essentially the same time (keep
in mind that this doesn't really mean much in a multitasking environment, but
might in a multiprocessor environment), push up the priority of the thread
doing the suspending so that it won't get preempted while it's working.
--
- Gary Chanson (Windows SDK MVP)
- Abolish Public Schools