WTSINFOW structure (wtsapi32.h)

Contains information about a Remote Desktop Services session.

Syntax

typedef struct _WTSINFOW {
  WTS_CONNECTSTATE_CLASS State;
  DWORD                  SessionId;
  DWORD                  IncomingBytes;
  DWORD                  OutgoingBytes;
  DWORD                  IncomingFrames;
  DWORD                  OutgoingFrames;
  DWORD                  IncomingCompressedBytes;
  DWORD                  OutgoingCompressedBytes;
  WCHAR                  WinStationName[WINSTATIONNAME_LENGTH];
  WCHAR                  Domain[DOMAIN_LENGTH];
  WCHAR                  UserName[USERNAME_LENGTH + 1];
  LARGE_INTEGER          ConnectTime;
  LARGE_INTEGER          DisconnectTime;
  LARGE_INTEGER          LastInputTime;
  LARGE_INTEGER          LogonTime;
  LARGE_INTEGER          CurrentTime;
} WTSINFOW, *PWTSINFOW;

Members

State

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

SessionId

The session identifier.

IncomingBytes

Uncompressed Remote Desktop Protocol (RDP) data from the client to the server.

OutgoingBytes

Uncompressed RDP data from the server to the client.

IncomingFrames

The number of frames of RDP data sent from the client to the server since the client connected.

OutgoingFrames

The number of frames of RDP data sent from the server to the client since the client connected.

IncomingCompressedBytes

Compressed RDP data from the client to the server.

OutgoingCompressedBytes

Compressed RDP data from the server to the client.

WinStationName[WINSTATIONNAME_LENGTH]

A null-terminated string that contains the name of the WinStation for the session.

Domain[DOMAIN_LENGTH]

A null-terminated string that contains the name of the domain that the user belongs to.

UserName[USERNAME_LENGTH + 1]

A null-terminated string that contains the name of the user who owns the session.

ConnectTime

The most recent client connection time.

DisconnectTime

The last client disconnection time.

LastInputTime

The time of the last user input in the session.

LogonTime

The time that the user logged on to the session.

CurrentTime

The time that the WTSINFO data structure was called.

Remarks

Note

The wtsapi32.h header defines WTSINFO as an alias which 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 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 with SP1
Minimum supported server Windows Server 2008
Header wtsapi32.h