dos12.hlp (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
DosPeekNmPipe (1.2)
Function Group                                      Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
#define INCL_DOSNMPIPES
 
USHORT DosPeekNmPipe(hp, pbBuf, cbBuf, pcbRead, pavldt, pfsState)
HPIPE hp;             /* pipe handle                                    */
PBYTE pbBuf;          /* pointer to buffer for data                     */
USHORT cbBuf;         /* length of buffer for data                      */
PUSHORT pcbRead;      /* pointer to variable for number bytes read      */
PAVAILDATA pavldt;    /* pointer to variable for number bytes available */
PUSHORT pfsState;     /* pointer to variable for pipe state             */
 
The DosPeekNmPipe function copies a pipe's data into a buffer.
 
Parameter  Description
────────────────────────────────────────────────────────────────────────────
 
hp         Identifies the pipe to read from.
 
pbBuf      Points to a buffer that receives the data from the pipe.
 
cbBuf      Specifies the length (in bytes) of the buffer that receives the
           data from the pipe.
 
pcbRead    Points to the variable that receives a value specifying the
           number of bytes read from the pipe.
 
pavldt     Points to the AVAILDATA structure that the receives a value
           specifying the number of bytes that were available to be read.
 
pfsState   Points to the variable that receives the state of the pipe. The
           state may be one of the following values:
 
           Value            Meaning
           ─────────────────────────────────────────────────────────────────
           NP_CLOSING       The pipe is closed and can no longer be used.
 
           NP_CONNECTED     The pipe has been opened and is available for
                            reading and writing.
 
           NP_DISCONNECTED  The serving end must call the DosConnectNmPipe
                            function to put the pipe into a listening state
                            before a call to the DosOpen function will be
                            accepted. A pipe is in a disconnected state
                            between a call to the DosMakeNmPipe function and
                            a call to the DosConnectNmPipe function.
 
           NP_LISTENING     The pipe will accept a call to the DosOpen
                            function.
 
Return Value
 
The return value is zero if the function is successful. Otherwise, it is an
error value, which may be one of the following:
 
     ERROR_BAD_PIPE
     ERROR_PIPE_NOT_CONNECTED
 
Comments
 
The DosPeekNmPipe function never blocks, regardless of the blocking mode of
the pipe.
 
If the DosDisConnectNmPipe function has been called, the pipe will remain
disconnected until a call is made to the DosConnectNmPipe function.
 
See Also
 
DosConnectNmPipe, DosDisConnectNmPipe, DosMakeNmPipe, DosOpen, DosRead,
AVAILDATA