Contains values that indicate the type of session information to retrieve in a call to theWTSQuerySessionInformation function.
Syntax
Constants
-
WTSInitialProgram
-
A null-terminated string that contains the name of the initial program that Remote Desktop Services runs when the user logs on.
WTSApplicationName
-
A null-terminated string that contains the published name of the application that the session is running.
WTSWorkingDirectory
-
A null-terminated string that contains the default directory used when launching the initial program.
WTSOEMId
-
This value is not used.
WTSSessionId
-
A ULONG value that contains the session identifier.
WTSUserName
-
A null-terminated string that contains the name of the user associated with the session.
WTSWinStationName
-
A null-terminated string that contains the name of the Remote Desktop Services session.
Note Despite its name, specifying this type does not return the window station name. Rather, it returns the name of the Remote Desktop Services session. Each Remote Desktop Services session is associated with an interactive window station. Because the only supported window station name for an interactive window station is "WinSta0", each session is associated with its own "WinSta0" window station. For more information, see Window Stations.
WTSDomainName
-
A null-terminated string that contains the name of the domain to which the logged-on user belongs.
WTSConnectState
-
The session's current connection state. For more information, see WTS_CONNECTSTATE_CLASS.
WTSClientBuildNumber
-
A ULONG value that contains the build number of the client.
WTSClientName
-
A null-terminated string that contains the name of the client.
WTSClientDirectory
-
A null-terminated string that contains the directory in which the client is installed.
WTSClientProductId
-
A USHORT client-specific product identifier.
WTSClientHardwareId
-
A ULONG value that contains a client-specific hardware identifier. This option is reserved for future use. WTSQuerySessionInformation will always return a value of 0.
WTSClientAddress
-
The network type and network address of the client. For more information, seeWTS_CLIENT_ADDRESS.
The IP address is offset by two bytes from the start of the Address member of theWTS_CLIENT_ADDRESS structure.
WTSClientDisplay
-
Information about the display resolution of the client. For more information, seeWTS_CLIENT_DISPLAY.
WTSClientProtocolType
-
A USHORT value that specifies information about the protocol type for the session. This is one of the following values.
Value Meaning 0
The console session.
1
This value is retained for legacy purposes.
2
The RDP protocol.
WTSIdleTime
-
This value returns FALSE. If you call GetLastError to get extended error information,GetLastError returns ERROR_NOT_SUPPORTED.
Windows Server 2008, Windows Vista, Windows Server 2003, and Windows XP: This value is not used.
WTSLogonTime
-
This value returns FALSE. If you call GetLastError to get extended error information,GetLastError returns ERROR_NOT_SUPPORTED.
Windows Server 2008, Windows Vista, Windows Server 2003, and Windows XP: This value is not used.
WTSIncomingBytes
-
This value returns FALSE. If you call GetLastError to get extended error information,GetLastError returns ERROR_NOT_SUPPORTED.
Windows Server 2008, Windows Vista, Windows Server 2003, and Windows XP: This value is not used.
WTSOutgoingBytes
-
This value returns FALSE. If you call GetLastError to get extended error information,GetLastError returns ERROR_NOT_SUPPORTED.
Windows Server 2008, Windows Vista, Windows Server 2003, and Windows XP: This value is not used.
WTSIncomingFrames
-
This value returns FALSE. If you call GetLastError to get extended error information,GetLastError returns ERROR_NOT_SUPPORTED.
Windows Server 2008, Windows Vista, Windows Server 2003, and Windows XP: This value is not used.
WTSOutgoingFrames
-
This value returns FALSE. If you call GetLastError to get extended error information,GetLastError returns ERROR_NOT_SUPPORTED.
Windows Server 2008, Windows Vista, Windows Server 2003, and Windows XP: This value is not used.
WTSClientInfo
-
Information about a Remote Desktop Connection (RDC) client. For more information, seeWTSCLIENT.
Windows Vista, Windows Server 2003, and Windows XP: This value is not supported. This value is supported beginning with Windows Server 2008 and Windows Vista with SP1.
WTSSessionInfo
-
Information about a client session on an RD Session Host server. For more information, seeWTSINFO.
Windows Vista, Windows Server 2003, and Windows XP: This value is not supported. This value is supported beginning with Windows Server 2008 and Windows Vista with SP1.
WTSSessionInfoEx
-
Extended information about a session on an RD Session Host server. For more information, seeWTSINFOEX.
Windows Server 2008, Windows Vista, Windows Server 2003, and Windows XP: This value is not supported.
WTSConfigInfo
-
Information about the configuration of an RD Session Host server.
Windows Server 2008, Windows Vista, Windows Server 2003, and Windows XP: This value is not supported.
WTSValidationInfo
-
This value is not supported.
WTSSessionAddressV4
-
A WTS_SESSION_ADDRESS structure that contains the IPv4 address assigned to the session. If the session does not have a virtual IP address, the WTSQuerySessionInformation function returnsERROR_NOT_SUPPORTED.
Windows Server 2008, Windows Vista, Windows Server 2003, and Windows XP: This value is not supported.
WTSIsRemoteSession
-
Determines whether the current session is a remote session. The WTSQuerySessionInformationfunction returns a value of TRUE to indicate that the current session is a remote session, andFALSE to indicate that the current session is a local session. This value can only be used for the local machine, so the hServer parameter of the WTSQuerySessionInformation function must contain WTS_CURRENT_SERVER_HANDLE.
Windows Server 2008, Windows Vista, Windows Server 2003, and Windows XP: This value is not supported.
Requirements
Minimum supported client | Windows XP [desktop apps only] |
---|---|
Minimum supported server | Windows Server 2003 [desktop apps only] |
Header |
|
Window Stations
A window station contains a clipboard, an atom table, and one or more desktop objects. Each window station object is a securable object. When a window station is created, it is associated with the calling process and assigned to the current session.
The interactive window station is the only window station that can display a user interface or receive user input. It is assigned to the logon session of the interactive user, and contains the keyboard, mouse, and display device. It is always named "WinSta0". All other window stations are noninteractive, which means they cannot display a user interface or receive user input.
When a user logs on to a computer using Remote Desktop Services, a session is started for the user. Each session is associated with its own interactive window station named "WinSta0". For more information, see Remote Desktop Sessions.
WTS_CONNECTSTATE_CLASS enumeration
Specifies the connection state of a Remote Desktop Services session.
Syntax
Constants
-
WTSActive
-
A user is logged on to the WinStation.
WTSConnected
-
The WinStation is connected to the client.
WTSConnectQuery
-
The WinStation is in the process of connecting to the client.
WTSShadow
-
The WinStation is shadowing another WinStation.
WTSDisconnected
-
The WinStation is active but the client is disconnected.
WTSIdle
-
The WinStation is waiting for a client to connect.
WTSListen
-
The WinStation is listening for a connection. A listener session waits for requests for new client connections. No user is logged on a listener session. A listener session cannot be reset, shadowed, or changed to a regular client session.
WTSReset
-
The WinStation is being reset.
WTSDown
-
The WinStation is down due to an error.
WTSInit
-
The WinStation is initializing.
Requirements
Minimum supported client | Windows XP [desktop apps only] |
---|---|
Minimum supported server | Windows Server 2003 [desktop apps only] |
Header |
|
See also
WTS_CLIENT_ADDRESS structure (Windows)
Contains the client network address of a Remote Desktop Services session.
Syntax
Members
-
AddressFamily
-
Address family. This member can be AF_INET, AF_INET6, AF_IPX, AF_NETBIOS, or AF_UNSPEC.
Windows Server 2003 and Windows XP: This member can be AF_INET, AF_IPX, AF_NETBIOS, or AF_UNSPEC.
Address
-
Client network address.
Remarks
The client network address is reported by the RDP client itself when it connects to the server. This could be different than the address that actually connected to the server. For example, suppose there is a NAT between the client and the server. The client can report its own IP address, but the IP address that actually connects to the server is the NAT address. For VPN connections, the IP address might not be discoverable by the client. If it cannot be discovered, the client can report the only IP address it has, which may be the ISP assigned address. Because the address may not be the actual network address, it should not be used as a form of client authentication.
Requirements
Minimum supported client | Windows XP [desktop apps only] |
---|---|
Minimum supported server | Windows Server 2003 [desktop apps only] |
Header |
|
See also
WTS_CLIENT_DISPLAY structure (Windows)
Contains information about the display of a Remote Desktop Connection (RDC) client.
Syntax
Members
-
HorizontalResolution
-
Horizontal dimension, in pixels, of the client's display.
VerticalResolution
-
Vertical dimension, in pixels, of the client's display.
ColorDepth
-
Color depth of the client's display. This member can be one of the following values.
Value Meaning -
1
4 bits per pixel.
-
2
8 bits per pixel.
-
4
16 bits per pixel.
-
8
A 3-byte RGB values for a maximum of 2^24 colors.
-
16
15 bits per pixel.
-
24
24 bits per pixel.
-
32
32 bits per pixel.
Requirements
Minimum supported client | Windows XP [desktop apps only] |
---|---|
Minimum supported server | Windows Server 2003 [desktop apps only] |
Header |
|