WTS_SESSION_INFOW structure (wtsapi32.h)

Contains information about a client session on a Remote Desktop Session Host (RD Session Host) server.

Syntax

typedef struct _WTS_SESSION_INFOW {
  DWORD                  SessionId;
  LPWSTR                 pWinStationName;
  WTS_CONNECTSTATE_CLASS State;
} WTS_SESSION_INFOW, *PWTS_SESSION_INFOW;

Members

SessionId

Session identifier of the session.

pWinStationName

Pointer to a null-terminated string that contains the WinStation name of this session. The WinStation name is a name that Windows associates with the session, for example, "services", "console", or "RDP-Tcp#0".

State

A value from the WTS_CONNECTSTATE_CLASS enumeration type that indicates the session's current connection state.

Remarks

Note

The wtsapi32.h header defines WTS_SESSION_INFO as an alias that automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that is not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.

Requirements

Requirement Value
Minimum supported client Windows Vista
Minimum supported server Windows Server 2008
Header wtsapi32.h

See also

WTSEnumerateSessions

WTS_CONNECTSTATE_CLASS