I am creating a child process with creatprocess api. And I created a job object and assigned this child process to jobobject.
Now, if I kill my parent process, the child process will also end. But if I paused the parent process, the child process does not pause or continue execution.
is it possible to pause the child process when the parent process is paused?
Delphi code that I used to create the process
Function ExecuteProcess(EXE : String) : THandle; Var SI : TStartupInfo; PI : TProcessInformation; Begin Result := INVALID_HANDLE_VALUE; FillChar(SI,SizeOf(SI),0); SI.cb := SizeOf(SI); If CreateProcess(nil,PChar('.\'+EXE),nil,nil,False,CREATE_SUSPENDED, nil,nil,SI,PI) Then Begin ResumeThread(PI.hThread); CloseHandle(PI.hThread); Result := PI.hProcess; End Else ShowMessage('CreateProcess failed: '+ SysErrorMessage(GetLastError)); End;
source share