reactos/modules/rostests/rosautotest/CPipe.h
Colin Finck 7dd4d2256b [ROSAUTOTEST] Implement a process activity timeout of 2 minutes. If there is no log output within 2 minutes, the test process is killed, and we continue with the next test.
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.
2019-04-26 08:47:15 +02:00

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;
};