2015-02-16 13:17:04 +00:00
|
|
|
/*
|
|
|
|
* PROJECT: ReactOS Automatic Testing Utility
|
2017-09-29 18:13:54 +00:00
|
|
|
* LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
|
|
|
|
* PURPOSE: Class that manages an unidirectional anonymous byte stream pipe
|
|
|
|
* COPYRIGHT: Copyright 2015 Thomas Faber (thomas.faber@reactos.org)
|
2019-04-23 07:17:05 +00:00
|
|
|
* Copyright 2019 Colin Finck (colin@reactos.org)
|
2015-02-16 13:17:04 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
class CPipe
|
|
|
|
{
|
|
|
|
private:
|
2019-04-23 07:17:05 +00:00
|
|
|
static LONG m_lPipeCount;
|
|
|
|
|
|
|
|
OVERLAPPED m_ReadOverlapped;
|
2015-02-16 13:17:04 +00:00
|
|
|
HANDLE m_hReadPipe;
|
|
|
|
HANDLE m_hWritePipe;
|
|
|
|
|
|
|
|
public:
|
|
|
|
CPipe();
|
|
|
|
~CPipe();
|
|
|
|
|
|
|
|
void CloseReadPipe();
|
|
|
|
void CloseWritePipe();
|
|
|
|
|
|
|
|
bool Peek(PVOID Buffer, DWORD BufferSize, PDWORD BytesRead, PDWORD TotalBytesAvailable);
|
2019-04-23 07:17:05 +00:00
|
|
|
DWORD Read(PVOID Buffer, DWORD NumberOfBytesToRead, PDWORD NumberOfBytesRead, DWORD TimeoutMilliseconds);
|
2015-02-16 13:17:04 +00:00
|
|
|
bool Write(LPCVOID Buffer, DWORD NumberOfBytesToWrite, PDWORD NumberOfBytesWritten);
|
|
|
|
|
|
|
|
friend class CPipedProcess;
|
|
|
|
};
|