Export (0) Print
Expand All

WTS_SESSION_INFO_1 structure

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

Syntax


typedef struct _WTS_SESSION_INFO_1 {
  DWORD                  ExecEnvId;
  WTS_CONNECTSTATE_CLASS State;
  DWORD                  SessionId  ;
  LPTSTR                 pSessionName;
  LPTSTR                 pHostName;
  LPTSTR                 pUserName;
  LPTSTR                 pDomainName;
  LPTSTR                 pFarmName;
} WTS_SESSION_INFO_1, *PWTS_SESSION_INFO_1;

Members

ExecEnvId

An identifier that uniquely identifies the session within the list of sessions returned by the WTSEnumerateSessionsEx function. For more information, see Remarks.

State

A value of the WTS_CONNECTSTATE_CLASS enumeration type that specifies the connection state of a Remote Desktop Services session.

SessionId

A session identifier assigned by the RD Session Host server, RD Virtualization Host server, or virtual machine.

pSessionName

A pointer to a null-terminated string that contains the name of this session. For example, "services", "console", or "RDP-Tcp#0".

pHostName

A pointer to a null-terminated string that contains the name of the computer that the session is running on. If the session is running directly on an RD Session Host server or RD Virtualization Host server, the string contains NULL. If the session is running on a virtual machine, the string contains the name of the virtual machine.

pUserName

A pointer to a null-terminated string that contains the name of the user who is logged on to the session. If no user is logged on to the session, the string contains NULL.

pDomainName

A pointer to a null-terminated string that contains the domain name of the user who is logged on to the session. If no user is logged on to the session, the string contains NULL.

pFarmName

A pointer to a null-terminated string that contains the name of the farm that the virtual machine is joined to. If the session is not running on a virtual machine that is joined to a farm, the string contains NULL.

Remarks

The WTSEnumerateSessionsEx function returns this structure if you call the function and specify a handle to an RD Virtualization Host server that you obtained by calling the WTSOpenServerEx function. In this case, the WTSEnumerateSessionsEx function aggregates all the sessions running on the host itself as well as sessions running on individual virtual machines. The ExecEnvId parameter uniquely identifies each session in the aggregated list. This identifier may be different from the actual session identifier defined in the server or virtual machine that hosts the session, which is specified by the SessionId member.

The session represented by this structure could be a session running directly on the server or a session running within a virtual machine. If the session is running within a virtual machine, the pHostName member contains the name of the virtual machine. The pFarmName member is applicable to sessions that are hosted on virtual machines that are joined to a RD Session Host farm.

Requirements

Minimum supported client

Windows 7

Minimum supported server

Windows Server 2008 R2

Header

Wtsapi32.h

Unicode and ANSI names

WTS_SESSION_INFO_1W (Unicode) and WTS_SESSION_INFO_1A (ANSI)

See also

WTSEnumerateSessionsEx
WTS_SESSION_INFO

 

 

Show:
© 2014 Microsoft