Process.h
Go to the documentation of this file.
1 #pragma once
2 
3 namespace AppSecInc
4 {
5  namespace File
6  {
8  class Process
9  {
10  private:
11  std::string _buffer;
12  STARTUPINFO _si;
13  PROCESS_INFORMATION _pi;
14  HANDLE _stdout_read;
15  HANDLE _stdout_write;
16  public:
17  Process();
18  virtual ~Process();
20  void Create(const std::wstring& commandline, const std::wstring directory = L"");
22  void CreateWithRedirectedOutput(const std::wstring& commandline, const std::wstring directory = L"");
24  void Wait(DWORD dwMilliseconds = INFINITE);
26  DWORD GetExitCode();
28  std::string ReadLine(bool& finished);
30  static DWORD Execute(const std::wstring commandline, const std::wstring& directory = L"");
31  };
32  }
33 }
DWORD GetExitCode()
return process exit code
Definition: Process.cpp:69
static DWORD Execute(const std::wstring commandline, const std::wstring &directory=L"")
execute a process, wait for it to complete and return its exit code
Definition: Process.cpp:129
virtual ~Process()
Definition: Process.cpp:14
void Wait(DWORD dwMilliseconds=INFINITE)
wait for the process to complete
Definition: Process.cpp:63
void CreateWithRedirectedOutput(const std::wstring &commandline, const std::wstring directory=L"")
create a process with redirected pipes
Definition: Process.cpp:42
void Create(const std::wstring &commandline, const std::wstring directory=L"")
create a process
Definition: Process.cpp:22
Win32 process support functions.
Definition: Process.h:8
Process()
Definition: Process.cpp:6
std::string ReadLine(bool &finished)
read a line from an executing process' output
Definition: Process.cpp:77


© Application Security Inc. - All Rights Reserved http://msiext.codeplex.com