This call reads pipe without removing the read data from the pipe.
DosPeekNmPipe
Handle (HPIPE) - input
Value
o
The pipe is in a listening state after a DosConnectNmPipe. A listening pipe is ready to accept a DosOpen request. If the pipe is not in a listening state, DosOpen returns ERROR_PIPE_BUSY.
The pipe is in a connected state after a successful DosOpen to the listening pipe. The connected pipe allows the serving and client ends to perform I/O, provided both have valid handles.
The pipe is in a closing state after the last DosClose to the pipe from either the client or server end.
After DosClose has been issued for the client handle and any duplicates, and the serving end has read all buffered data, the serving end is returned ERROR_EOF for reads and ERROR_BROKEN_PIPE for writes. The serving end must acknowledge the closing of the client end by issuing either DosDisConnectNmPipe or DosClose. Issuing DosClose deallocates the pipe.
DosPeekNmPipe is similar to a DosRead, except the bytes read from the pipe are not removed. In addition, a DosPeekNmPipe never blocks, regardless of the blocking mode set. If the pipe cannot be accessed immediately, ERROR_PIPE_BUSY is returned. Because the peek cannot block, it returns only what is currently in the pipe. Thus, a portion of a message may be returned, even though the size of the peek can accommodate the entire message.
The value returned in PipeState can be used by the client or the server end to determine the current state of the pipe and take appropriate action.