00001 //execute another program 00002 00003 class Process : public SystemCode { 00004 private: 00005 int hProcess, hThread; //linux:hProcess=pid, hThread=ignored 00006 PTR FullEnvironment; //used if AppendEnvironment == TRUE 00007 BOOL HoldOutBuffer; //do not free OutBuffer in Close() 00008 uint32 GetEnvironmentSize(char *e); 00009 public: 00010 char *CurrentPath; //Current Path (optional) [linux:ignored] 00011 char *Environment; //Double-NULL terminated string (optional) 00012 BOOL AppendEnvironment; //append current environment to specified one 00013 BOOL Hide; //Hide program while running [linux:ignored] 00014 BOOL Wait; //Wait for program to return 00015 BOOL Inherit; //new process inherits handles 00016 uint32 Timeout; //Timeout to wait (milliseconds) 00017 BOOL CaptureOutput; //Capture console based output (STDOUT) 00018 PTR OutBuffer; //filled in (if CaptureOutput==TRUE) 00019 uint32 OutSize; //filled in (if CaptureOutput==TRUE) 00020 00021 BOOL Valid; 00022 00023 Process(); 00024 ~Process(); 00025 BOOL Exec(char *cmd); 00026 BOOL Close(); 00027 uint32 GetExitCode(); 00028 BOOL IsActive(); 00029 BOOL Terminate(); //force termination 00030 };