mirror of
https://github.com/reactos/reactos.git
synced 2024-11-06 14:44:19 +00:00
1ea34407b8
- Abstract unidirectional anonymous pipes into a CPipe class - Abstract a process with redirected output into a CPipedProcess class - Use these abstractions to avoid polling for output from test processes. Instead, use blocking read operations to yield the CPU while waiting for data. ROSTESTS-144 #resolve svn path=/trunk/; revision=66316
26 lines
764 B
C++
26 lines
764 B
C++
/*
|
|
* PROJECT: ReactOS Automatic Testing Utility
|
|
* LICENSE: GNU GPLv2 or any later version as published by the Free Software Foundation
|
|
* PURPOSE: Class that managed an unidirectional anonymous byte stream pipe
|
|
* COPYRIGHT: Copyright 2015 Thomas Faber <thomas.faber@reactos.org>
|
|
*/
|
|
|
|
class CPipe
|
|
{
|
|
private:
|
|
HANDLE m_hReadPipe;
|
|
HANDLE m_hWritePipe;
|
|
|
|
public:
|
|
CPipe();
|
|
~CPipe();
|
|
|
|
void CloseReadPipe();
|
|
void CloseWritePipe();
|
|
|
|
bool Peek(PVOID Buffer, DWORD BufferSize, PDWORD BytesRead, PDWORD TotalBytesAvailable);
|
|
bool Read(PVOID Buffer, DWORD NumberOfBytesToRead, PDWORD NumberOfBytesRead);
|
|
bool Write(LPCVOID Buffer, DWORD NumberOfBytesToWrite, PDWORD NumberOfBytesWritten);
|
|
|
|
friend class CPipedProcess;
|
|
};
|