ReactOS
0.4.16-dev-311-g9382aa2
CPipedProcess.cpp
Go to the documentation of this file.
1
/*
2
* PROJECT: ReactOS Automatic Testing Utility
3
* LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
4
* PURPOSE: Class that creates a process and redirects its output to a pipe
5
* COPYRIGHT: Copyright 2015 Thomas Faber (thomas.faber@reactos.org)
6
*/
7
8
#include "
precomp.h
"
9
20
CPipedProcess::CPipedProcess
(
const
wstring& CommandLine,
CPipe
&
Pipe
)
21
:
CProcess
(CommandLine, InitStartupInfo(
Pipe
))
22
{
23
Pipe
.CloseWritePipe();
24
}
25
32
LPSTARTUPINFOW
33
CPipedProcess::InitStartupInfo
(
CPipe
&
Pipe
)
34
{
35
ZeroMemory
(&
m_StartupInfo
,
sizeof
(
m_StartupInfo
));
36
m_StartupInfo
.
cb
=
sizeof
(
m_StartupInfo
);
37
m_StartupInfo
.
dwFlags
=
STARTF_USESTDHANDLES
;
38
m_StartupInfo
.
hStdInput
=
GetStdHandle
(
STD_INPUT_HANDLE
);
39
m_StartupInfo
.
hStdOutput
=
Pipe
.m_hWritePipe;
40
m_StartupInfo
.
hStdError
=
Pipe
.m_hWritePipe;
41
return
&
m_StartupInfo
;
42
}
GetStdHandle
HANDLE WINAPI GetStdHandle(IN DWORD nStdHandle)
Definition:
console.c:203
CPipe
Definition:
CPipe.h:10
CPipedProcess::CPipedProcess
CPipedProcess(const wstring &CommandLine, CPipe &Pipe)
Definition:
CPipedProcess.cpp:20
CPipedProcess::m_StartupInfo
STARTUPINFOW m_StartupInfo
Definition:
CPipedProcess.h:11
CPipedProcess::InitStartupInfo
LPSTARTUPINFOW InitStartupInfo(CPipe &Pipe)
Definition:
CPipedProcess.cpp:33
CProcess
Definition:
CProcess.h:9
LPSTARTUPINFOW
SIZE_T LPSTARTUPINFOW
Definition:
cordebug.idl:85
_STARTUPINFOW::cb
DWORD cb
Definition:
winbase.h:877
_STARTUPINFOW::hStdError
HANDLE hStdError
Definition:
winbase.h:894
_STARTUPINFOW::dwFlags
DWORD dwFlags
Definition:
winbase.h:888
_STARTUPINFOW::hStdOutput
HANDLE hStdOutput
Definition:
winbase.h:893
_STARTUPINFOW::hStdInput
HANDLE hStdInput
Definition:
winbase.h:892
Pipe
_In_ WDFUSBPIPE Pipe
Definition:
wdfusb.h:1741
precomp.h
ZeroMemory
#define ZeroMemory
Definition:
winbase.h:1737
STD_INPUT_HANDLE
#define STD_INPUT_HANDLE
Definition:
winbase.h:293
STARTF_USESTDHANDLES
#define STARTF_USESTDHANDLES
Definition:
winbase.h:525
modules
rostests
rosautotest
CPipedProcess.cpp
Generated on Tue Dec 3 2024 06:11:58 for ReactOS by
1.9.6