ReactOS  0.4.15-dev-3017-g1d9542d
CPipedProcess Class Reference

#include <CPipedProcess.h>

Inheritance diagram for CPipedProcess:
Collaboration diagram for CPipedProcess:

Public Member Functions

 CPipedProcess (const wstring &CommandLine, CPipe &Pipe)
 
- Public Member Functions inherited from CProcess
 CProcess (const wstring &CommandLine, LPSTARTUPINFOW StartupInfo)
 
 ~CProcess ()
 
HANDLE GetProcessHandle () const
 

Private Member Functions

LPSTARTUPINFOW InitStartupInfo (CPipe &Pipe)
 

Private Attributes

STARTUPINFOW m_StartupInfo
 

Detailed Description

Definition at line 8 of file CPipedProcess.h.

Constructor & Destructor Documentation

◆ CPipedProcess()

CPipedProcess::CPipedProcess ( const wstring &  CommandLine,
CPipe Pipe 
)

Constructs a CPipedProcess object and starts the process with redirected output.

Parameters
CommandLineA std::wstring containing the command line to run.
PipeThe CPipe instance to redirect the process's output to. Note that only the read pipe is usable after the pipe was passed to this object.

Definition at line 20 of file CPipedProcess.cpp.

21  : CProcess(CommandLine, InitStartupInfo(Pipe))
22 {
23  Pipe.CloseWritePipe();
24 }
LPSTARTUPINFOW InitStartupInfo(CPipe &Pipe)
_In_ WDFUSBPIPE Pipe
Definition: wdfusb.h:1741
CProcess(const wstring &CommandLine, LPSTARTUPINFOW StartupInfo)
Definition: CProcess.cpp:19

Member Function Documentation

◆ InitStartupInfo()

LPSTARTUPINFOW CPipedProcess::InitStartupInfo ( CPipe Pipe)
private

Initializes the STARTUPINFO structure for use in CreateProcessW.

Parameters
PipeThe CPipe instance to redirect the process's output to.

Definition at line 33 of file CPipedProcess.cpp.

34 {
36  m_StartupInfo.cb = sizeof(m_StartupInfo);
39  m_StartupInfo.hStdOutput = Pipe.m_hWritePipe;
40  m_StartupInfo.hStdError = Pipe.m_hWritePipe;
41  return &m_StartupInfo;
42 }
STARTUPINFOW m_StartupInfo
Definition: CPipedProcess.h:11
#define ZeroMemory
Definition: winbase.h:1664
HANDLE hStdOutput
Definition: winbase.h:862
HANDLE WINAPI GetStdHandle(IN DWORD nStdHandle)
Definition: console.c:200
#define STD_INPUT_HANDLE
Definition: winbase.h:264
#define STARTF_USESTDHANDLES
Definition: winbase.h:496
DWORD cb
Definition: winbase.h:846
HANDLE hStdInput
Definition: winbase.h:861
_In_ WDFUSBPIPE Pipe
Definition: wdfusb.h:1741
HANDLE hStdError
Definition: winbase.h:863
DWORD dwFlags
Definition: winbase.h:857

Member Data Documentation

◆ m_StartupInfo

STARTUPINFOW CPipedProcess::m_StartupInfo
private

Definition at line 11 of file CPipedProcess.h.

Referenced by InitStartupInfo().


The documentation for this class was generated from the following files: