// Note: If the process is still running, this will auto kill it unless you started the process with
// STARTPROCESS_NOAUTOKILL.
virtualvoidRelease()=0;
// Kill the running process. You still must call IProcess::Release to free the resources.
virtualvoidAbort()=0;
// Returns true if a process is complete
virtualboolIsComplete()=0;
// Waits until a process is complete.
// Returns the return value from the process.
virtualintWaitUntilComplete()=0;
// Write to the process' stdin.
// This blocks until the process has read it.
virtualintWriteStdin(char*pBuf,intnBufLen)=0;
// Get stuff to read the outputs.
virtualIPipeRead*GetStdout()=0;
virtualIPipeRead*GetStderr()=0;// NOTE: Only valid if you used STARTPROCESS_SEPARATE_STDERR.
// Returns the exit code for the process. Doesn't work unless the process is complete.
// Returns -1 on error or if the process isn't complete.
virtualintGetExitCode()=0;
};
// Flags to IProcessUtils::StartProcess.
#define STARTPROCESS_CONNECTSTDPIPES 0x01 // Necessary to use the stdin/stdout/stderr io functions.
#define STARTPROCESS_SHARE_CONSOLE 0x02 // The process writes directly to your console. The pipe objects returned by
// IProcess::GetStdout and GetStderr won't do anything.
#define STARTPROCESS_SEPARATE_STDERR 0x04 // Rather than having to read stdout and stderr to get the output, the default is to put the stderr output into stdout.
// This flag can change that behavior so you can get that output separately.
// Warning: There may be deadlock problems with this, specifically in CProcessPipeRead::GetActualProcessOutput if
// it's blocked reading stdout's pipe but the process is blocked waiting for us to flush stderr's pipe first.
// To fully support that case, we'd need threads, overlapped IO, or a more careful (and slower) GetActualProcessOutput call
// that bounces between the two pipes and never stalls.
//
// You can also get around this on the client side by reading the pipes from threads.
#define STARTPROCESS_NOAUTOKILL 0x08 // Prevents the process from being auto-terminated in IProcess::Release()
// or when IProcessUtils' Shutdown function is called.
#define STARTPROCESS_FATPIPES 0x10 // Use I/O pipes larger than the default size for processes that do lots of stdio