Restart the process
-
Hello, I have a problem in my C program code. I want to restart or recreate a process which was suspended and its state was saved in a binary file and then terminated. Now i want to recreate/restart it using its previous state. I tried to use the functions below but it seems the functions do not work. Help me please, part of my code:
case 6://restarting the process lpBaseAddress = 0; hProcess = mbi.BaseAddress; SetThreadContext( hThread, lpContext ); WriteProcessMemory( hProcess, // handle to process whose memory is written to lpBaseAddress, // address to start writing to lpBuffer, // pointer to buffer to write data to nSize, // number of bytes to write lpNumberOfBytesWritten // actual number of bytes written ); ResumeThread(pi.hThread);// identifies thread to restart GetLastError(); break;
what am i missing here, or i have to call the createprocess() function again? oam -
Hello, I have a problem in my C program code. I want to restart or recreate a process which was suspended and its state was saved in a binary file and then terminated. Now i want to recreate/restart it using its previous state. I tried to use the functions below but it seems the functions do not work. Help me please, part of my code:
case 6://restarting the process lpBaseAddress = 0; hProcess = mbi.BaseAddress; SetThreadContext( hThread, lpContext ); WriteProcessMemory( hProcess, // handle to process whose memory is written to lpBaseAddress, // address to start writing to lpBuffer, // pointer to buffer to write data to nSize, // number of bytes to write lpNumberOfBytesWritten // actual number of bytes written ); ResumeThread(pi.hThread);// identifies thread to restart GetLastError(); break;
what am i missing here, or i have to call the createprocess() function again? oamSee you said you terminated the process. Then how can you resume it ? Only Suspended process can Resumed. Not Terminated Process. You should not terminate it.Just Suspend it.
-
See you said you terminated the process. Then how can you resume it ? Only Suspended process can Resumed. Not Terminated Process. You should not terminate it.Just Suspend it.
In process migration, there should be a way of restarting a suspended process(check pointed process) in the other machine on the network. Ifact i want to used the saved process information like baseaddress, context e.t.c after it was suspended. So there should be a possible way. But the big question how???? oam