GetNamedPipeInfo

  BOOL GetNamedPipeInfo(hNamedPipe, lpdwType, lpcbOutBuf, lpcbInBuf, lpcMaxInstances)    
  HANDLE hNamedPipe; /* named-pipe handle */
  LPDWORD lpdwType; /* gets flags indicating type of pipe */
  LPDWORD lpcbOutBuf; /* gets size in bytes of pipe's output buffer */
  LPDWORD lpcbInBuf; /* gets size in bytes of pipe's input buffer */
  LPDWORD lpcMaxInstances; /* gets max number of pipe instances */

The GetNamedPipeInfo function retrieves information about the specified named pipe.

Parameters

hNamedPipe

Specifies a handle to the named pipe. The handle must have GENERIC_READ access to the named pipe.

lpdwType

Points to the variable that will receive flags indicating the type of the named pipe. The parameter can be NULL if this information is not required. The returned value can be some combination of the following flags:

Value Meaning

PIPE_SERVER_END The handle is the server end of a named pipe. If not set, the handle is the client end of a named pipe.
PIPE_TYPE_MESSAGE The pipe is a message-stream pipe. If this flag is not set, the pipe is a byte-stream pipe.

lpcbOutBuf

Points to the variable that will be set to the size (in bytes) of the buffer for outgoing data. If the buffer size is zero, the buffer is allocated as needed. The parameter can be NULL if this information is not required.

lpcbInBuf

Points to the variable that will be set to the size (in bytes) of the buffer for incoming data. If the buffer size is zero, the buffer is allocated as needed. The parameter can be NULL if this information is not required.

lpcMaxInstances

Points to the variable that will be set to the maximum number of pipe instances that can be created. If this value is PIPE_UNLIMITED_INSTANCES, unlimited instances of the pipe can be created. This parameter can be NULL if this information is not required.

Return Value

The return value is TRUE if the function was successful, or FALSE if an error occurred. Use the GetLastError function to obtain extended error information.

See Also

CreateNamedPipe, GetNamedPipeHandleState