DosTransactNPipe is intended for use only on a duplex message pipe that is in message-read mode. If this function is issued for a pipe that is not a duplex message pipe, ERROR_BAD_FORMAT is returned.

The current setting of the pipe's blocking mode has no effect on this function; that is, even if the pipe is in nonblocking mode, DosTransactNPipe writes the entire pOutbuf to the pipe, and does not return until it reads a response from the pipe into pInbuf. If pInbuf is too small to contain the response message, ERROR_MORE_DATA is returned.

The function does not succeed if there is any unread data in the pipe, or if the pipe is not in message-read mode.

Clients of named pipes created with the NP_ACCESS_OUTBOUND or NP_ACCESS_INBOUND access mode cannot use the DosTransactNPipe function. If the named pipe's client uses the DosTransactNPipe function, the function returns error code ERROR_ACCESS_DENIED.

An attempt to write to a pipe whose other end has been closed returns ERROR_BROKEN_PIPE or, if the other end was closed without reading all pending data, ERROR_DISCARDED.


[Back] [Next]