int = GetNamedPipeServerSessionId(hPipe)
Returns session id of server process that created a named pipe