The GetNamedPipeHandleState function retrieves information about a specified named pipe. The information returned can vary during the lifetime of an instance of the named pipe.
BOOL GetNamedPipeHandleState(
HANDLE hNamedPipe, // handle to named pipe
LPDWORD lpState, // pointer to pipe state flags state
LPDWORD lpCurInstances, // pointer to number of current pipe instances
LPDWORD lpMaxCollectionCount, // pointer to maximum collection count
LPDWORD lpCollectDataTimeout, // pointer to time before remote transmission
LPTSTR lpUserName, // pointer to user name of client process
DWORD nMaxUserNameSize // size, in characters, of user name buffer
);
Windows NT: This parameter can also be a handle to an anonymous pipe, as returned by the CreatePipe function.
Value | Meaning |
---|---|
PIPE_NOWAIT | The pipe handle is in nonblocking mode. If this flag is not specified, the pipe handle is in blocking mode. |
PIPE_READMODE_MESSAGE | The pipe handle is in message-read mode. If this flag is not specified, the pipe handle is in byte-read mode. |
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
The GetNamedPipeHandleState function returns successfully even if all of the pointers passed to it are NULL.
To set the pipe handle state, use the SetNamedPipeHandleState function.
Windows NT: Requires version 3.1 or later.
Windows: Requires Windows 95 or later.
Windows CE: Unsupported.
Header: Declared in winbase.h.
Import Library: Use kernel32.lib.
Unicode: Implemented as Unicode and ANSI versions on Windows NT.
Pipes Overview, Pipe Functions, SetNamedPipeHandleState