mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
7dd4d2256b
This is a rather graceful approach compared to sysreg2's 3 minute timeout before killing and restarting the entire VM. Since we added autochk for FAT filesystems, the filesystem is often "fixed" after a reset with the consequence that ReactOS doesn't boot up anymore. The sysreg2 restart code still remains for handling tests causing BSODs.
30 lines
889 B
C++
30 lines
889 B
C++
/*
|
|
* PROJECT: ReactOS Automatic Testing Utility
|
|
* 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)
|
|
* Copyright 2019 Colin Finck (colin@reactos.org)
|
|
*/
|
|
|
|
class CPipe
|
|
{
|
|
private:
|
|
static LONG m_lPipeCount;
|
|
|
|
OVERLAPPED m_ReadOverlapped;
|
|
HANDLE m_hReadPipe;
|
|
HANDLE m_hWritePipe;
|
|
|
|
public:
|
|
CPipe();
|
|
~CPipe();
|
|
|
|
void CloseReadPipe();
|
|
void CloseWritePipe();
|
|
|
|
bool Peek(PVOID Buffer, DWORD BufferSize, PDWORD BytesRead, PDWORD TotalBytesAvailable);
|
|
DWORD Read(PVOID Buffer, DWORD NumberOfBytesToRead, PDWORD NumberOfBytesRead, DWORD TimeoutMilliseconds);
|
|
bool Write(LPCVOID Buffer, DWORD NumberOfBytesToWrite, PDWORD NumberOfBytesWritten);
|
|
|
|
friend class CPipedProcess;
|
|
};
|