static void PeekNamedPipe(Handle Pipe, Handle Buffer, unsigned Size, unsigned% BytesRead, unsigned% BytesAvailable, unsigned% BytesRemaining)
This function extracts data from a pipe without removing it from the pipe's buffer.
The handle of the pipe to be read. The pipe may be the server end of a named pipe, the client end of a named pipe or an anonymous pipe. The caller must have generic read access to the pipe.
A pointer to a buffer to receive data read from the pipe. If no data is to be read, null should be specified.
The size (in bytes) of the buffer provided by the previous parameter. If null is specified for the previous parameter, this parameter is ignored.
A reference to a variable that receives the number of bytes read.
A reference to a variable that receives the number of bytes available to be read.
A reference to a variable that receives the number of bytes remaining in the message being read.
This function differs from ReadFile in that:
When the pipe is a named pipe in byte-read mode, all available bytes up to the size specified by size are read. For a named pipe handle in message-read mode, the next message in the pipe is read. If the message is larger than Size, true is returned after reading the specified number of bytes. In this situation, BytesRemaining is the number of bytes remaining in the message.