ReactOS 0.4.15-dev-7918-g2a2556c
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

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{
39 m_StartupInfo.hStdOutput = Pipe.m_hWritePipe;
40 m_StartupInfo.hStdError = Pipe.m_hWritePipe;
41 return &m_StartupInfo;
42}
HANDLE WINAPI GetStdHandle(IN DWORD nStdHandle)
Definition: console.c:203
STARTUPINFOW m_StartupInfo
Definition: CPipedProcess.h:11
DWORD cb
Definition: winbase.h:852
HANDLE hStdError
Definition: winbase.h:869
DWORD dwFlags
Definition: winbase.h:863
HANDLE hStdOutput
Definition: winbase.h:868
HANDLE hStdInput
Definition: winbase.h:867
#define ZeroMemory
Definition: winbase.h:1712
#define STD_INPUT_HANDLE
Definition: winbase.h:267
#define STARTF_USESTDHANDLES
Definition: winbase.h:499

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: