![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Professional Programmer
Join Date: Feb 2005
Posts: 343
Rep Power: 4
![]() |
suspending a process in windows
Is there a windows system function that will let me suspend a process? Like pause and resume it? If not is there another way this can be done? Thanks.
|
|
|
|
|
|
#2 |
|
Newbie
Join Date: Jul 2008
Posts: 2
Rep Power: 0
![]() |
Re: suspending a process in windows
reffer http://msdn.microsoft.com/en-us/libr...45(VS.85).aspx
The main problem is: there is no SuspendProcess API function. And there is no documented or safe way of doing this. The only simple way of doing this is via SuspendThread/ResumeThread. This pair of API functions allows you to suspend and resume a thread. More than that, for the sake of safety, they maintain an internal "suspend count'. Each time you call SuspendThread, it increments this counter. ResumeThread, on the other hand, decreases this counter. If this was not done this way, the caller of SuspendThread would have no way of knowing how to restore the original state of the thread. Calling ResumeThread after calling SuspendThread effectively restores the original thread's state. Knowing this, it is very straightforward suspending a process: it is just a matter of listing all the threads on a process, opening a handle for each of them and calling SuspendThread. The resuming is done the same way. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Windows XP Activation Loop... | Ghost | Coder's Corner Lounge | 3 | Jan 24th, 2008 3:28 PM |
| Inspecting process' memory on Windows | magnus.therning | C | 7 | Jul 26th, 2006 12:11 PM |
| Suspending another process in win32 | coder0xff | C++ | 4 | May 28th, 2006 11:33 AM |
| Process injection | jayme | C++ | 3 | Jan 28th, 2006 6:05 AM |
| Windows Hook on Win9x system | dc2000 | C++ | 0 | Jul 4th, 2005 5:27 PM |