I have created a process and now i want to suspend its thread and later resume it. If possible i will even read its memory and save it in a text file. How to do that, i have DWORD SuspendThread(HANDLE ) frm MSDN

Here is my code:


//Program that creates a process
//This program assumes that numbers.exe is in the PATH!

int main(int argc, char **argv)
PROCESS_INFORMATION pi; /* filled in by CreateProcess */
STARTUPINFO si; /* startup info for the new process*/
/* print out our process ID */
printf("Process %d reporting for creation
/* Get startup info for current process, we will use this
as the startup info for the new process as well... */

/* Call CreateProcess, telling it to run an exe file
with lots of defaults... (the NULLs mean "use defaults")
umbers.exe" -L",

CreateProcess(NULL, /* lpApplicationName */
"numbers.exe", /* lpCommandLine assumes to use curent process directory*/
NULL, /* lpsaProcess */
NULL, /* lpsaThread */
FALSE, /* bInheritHandles */
CREATE_NEW_CONSOLE, /* dwCreationFlags */
NULL, /* lpEnvironment */
NULL, /* lpCurDir */
&si, /* lpStartupInfo */
&pi /* lpProcInfo */

/* print out the new process iD and quit
(does not wait for new process to exit!)
printf("New Process ID: %d ",pi.dwProcessId);
printf("has started

// DWORD SuspendThread(HANDLE /*hThread*/
// );
// GetLastError(void);


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!