PeekNamedPipe


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.

Parameters

Handle Pipe

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.

Handle Buffer

A pointer to a buffer to receive data read from the pipe. If no data is to be read, null should be specified.

unsigned Size

The size (in bytes) of the buffer provided by the previous parameter. If null is specified for the previous parameter, this parameter is ignored.

unsigned% BytesRead

A reference to a variable that receives the number of bytes read.

unsigned% BytesAvailable

A reference to a variable that receives the number of bytes available to be read.

unsigned% BytesRemaining

A reference to a variable that receives the number of bytes remaining in the message being read.

Notes

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.

Details

Name Space IPlusPlus::Control
Class Base
Assembly IPlusPlus.WinPlus.dll