1 /*
2  * PROJECT:     ReactOS Automatic Testing Utility
3  * LICENSE:     GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
4  * PURPOSE:     Class that manages an unidirectional anonymous byte stream pipe
5  * COPYRIGHT:   Copyright 2015 Thomas Faber (thomas.faber@reactos.org)
6  *              Copyright 2019 Colin Finck (colin@reactos.org)
7  */
8 
9 class CPipe
10 {
11 private:
12     static LONG m_lPipeCount;
13 
14     OVERLAPPED m_ReadOverlapped;
15     HANDLE m_hReadPipe;
16     HANDLE m_hWritePipe;
17 
18 public:
19     CPipe();
20     ~CPipe();
21 
22     void CloseReadPipe();
23     void CloseWritePipe();
24 
25     bool Peek(PVOID Buffer, DWORD BufferSize, PDWORD BytesRead, PDWORD TotalBytesAvailable);
26     DWORD Read(PVOID Buffer, DWORD NumberOfBytesToRead, PDWORD NumberOfBytesRead, DWORD TimeoutMilliseconds);
27     bool Write(LPCVOID Buffer, DWORD NumberOfBytesToWrite, PDWORD NumberOfBytesWritten);
28 
29     friend class CPipedProcess;
30 };
31