Discussion:
How about suspendProcess
(too old to reply)
Denis @ TheOffice
2006-06-12 20:23:05 UTC
Permalink
I 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?


Denis
Gary Chanson
2006-06-13 00:46:47 UTC
Permalink
Post by Denis @ TheOffice
I 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
Denis @ TheOffice
2006-06-13 14:54:32 UTC
Permalink
Post by Gary Chanson
Post by Denis @ TheOffice
I 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?

Denis
Gary Chanson
2006-06-13 18:41:57 UTC
Permalink
Post by Denis @ TheOffice
Post by Gary Chanson
Post by Denis @ TheOffice
I 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
Ben Voigt
2006-06-14 23:37:05 UTC
Permalink
Post by Denis @ TheOffice
Post by Denis @ TheOffice
Post by Gary Chanson
Post by Denis @ TheOffice
I 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?
Post by Denis @ TheOffice
Post by Gary Chanson
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.
You could sort them based on the priority of the threads being suspended...
suspend the lowest priority threads first, since that's either essentially a
no-op (a higher priority thread is runnable), or suspends the entire app (if
every higher priority thread is blocking). Or suspend the highest priority
threads first, since those are likely to be watchdog monitors which might
kill the entire process if you get it wrong.
Post by Denis @ TheOffice
--
- Gary Chanson (Windows SDK MVP)
- Abolish Public Schools
Loading...