get_named_pipe_handle_state


bool get_named_pipe_handle_state(handle pipe,
                                 unsigned* state,
                                 unsigned* instances,
                                 unsigned* collection_maximum,
                                 unsigned* collection_timeout,
                                 character* user,
                                 unsigned user_name_size)

This function obtains state information for a named pipe.

Parameters

handle pipe

The handle of the pipe about which information is sought. The caller must have generic read access to the pipe.

unsigned* state

A pointer to a variable indicating the current state of the handle. null may be specified when this information is not needed. Either of the following values may result.

pipe_mode::no_wait The pipe is in nonblocking mode. If this flag is not present, the pipe is in blocking mode.
pipe_mode::message_read The pipe is in message-read mode. If this flag is not present, the pipe is in byte-read mode.

unsigned* instances

A pointer to a variable that receives the number of pipe instances currently in existence. When this information is not required, null may be specified.

unsigned* collection_maximum

A pointer to a variable that receives the maximum number of bytes collected on the client computer prior to transmission to the server. This parameter must be null when the pipe is the server end of a named pipe or when the client and server processes are on the same machine. If null is specified, the collection count is not queried.

unsigned* collection_timeout

A pointer to a variable that receives the time (in milliseconds) allowed to elapse before a remote named pipe transfers information over the network. This parameter must be null when the pipe is the server end of a named pipe or when the client and server processes are on the same machine. If null is specified, the value is not queried.

character* user

A pointer to a buffer that receives the user name string of the client application. This parameter must be null if the instance is at the client end of a named pipe. When this information is not required, the parameter may be set to null.

unsigned user_name_size

The size (in characters) of the buffer provided by the previous parameter. This parameter is ignored when the previous parameter is null.

Return

bool

true The function succeeded.
false The call failed.