Exit code of a process terminated with Process.Kill() in C#

In have 2 processes, a parent process and a child process. The parent process controls the lifecycle of child process i.e. parent process launches the child process when it needs the child to do some work and also it kills the child when it is done with it. To kill the child process, parent process is using Process.Kill() and process.WaitForExit() APIs.

Questions: -

  1. I am observing that the exit code of the child process is always -1. Who is setting this exit code?

  2. How can I change this exit code?

5
задан Aseem Bansal 7 December 2010 в 18:54
поделиться