Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Contains values that indicate the type of session information to retrieve in a call to the WTSQuerySessionInformation function.
Syntax
typedef enum _WTS_INFO_CLASS {
WTSInitialProgram,
WTSApplicationName,
WTSWorkingDirectory,
WTSOEMId,
WTSSessionId,
WTSUserName,
WTSWinStationName,
WTSDomainName,
WTSConnectState,
WTSClientBuildNumber,
WTSClientName,
WTSClientDirectory,
WTSClientProductId,
WTSClientHardwareId,
WTSClientAddress,
WTSClientDisplay,
WTSClientProtocolType,
WTSIdleTime,
WTSLogonTime,
WTSIncomingBytes,
WTSOutgoingBytes,
WTSIncomingFrames,
WTSOutgoingFrames,
WTSClientInfo,
WTSSessionInfo,
WTSSessionInfoEx,
WTSConfigInfo,
WTSValidationInfo,
WTSSessionAddressV4,
WTSIsRemoteSession,
WTSSessionActivityId
} WTS_INFO_CLASS;
Constants
WTSInitialProgramA null-terminated string that contains the name of the initial program that Remote Desktop Services runs when the user logs on. |
||||||||
WTSApplicationNameA null-terminated string that contains the published name of the application that the session is running. Windows Server 2008 R2, Windows 7, Windows Server 2008 and Windows Vista: This value is not supported |
||||||||
WTSWorkingDirectoryA null-terminated string that contains the default directory used when launching the initial program. |
||||||||
WTSOEMIdThis value is not used. |
||||||||
WTSSessionIdA ULONG value that contains the session identifier. |
||||||||
WTSUserNameA null-terminated string that contains the name of the user associated with the session. |
||||||||
WTSWinStationNameA 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. |
||||||||
WTSDomainNameA null-terminated string that contains the name of the ___domain to which the logged-on user belongs. |
||||||||
WTSConnectStateThe session's current connection state. For more information, see WTS_CONNECTSTATE_CLASS. |
||||||||
WTSClientBuildNumberA ULONG value that contains the build number of the client. |
||||||||
WTSClientNameA null-terminated string that contains the name of the client. |
||||||||
WTSClientDirectoryA null-terminated string that contains the directory in which the client is installed. |
||||||||
WTSClientProductIdA USHORT client-specific product identifier. |
||||||||
WTSClientHardwareIdA ULONG value that contains a client-specific hardware identifier. This option is reserved for future use. WTSQuerySessionInformation will always return a value of 0. |
||||||||
WTSClientAddressThe network type and network address of the client. For more information, see WTS_CLIENT_ADDRESS. The IP address is offset by two bytes from the start of the Address member of the WTS_CLIENT_ADDRESS structure. |
||||||||
WTSClientDisplayInformation about the display resolution of the client. For more information, see WTS_CLIENT_DISPLAY. |
||||||||
WTSClientProtocolTypeA USHORT value that specifies information about the protocol type for the session. This is one of the following values.
|
||||||||
WTSIdleTimeThis value returns FALSE. If you call GetLastError to get extended error information, GetLastError returns ERROR_NOT_SUPPORTED. To caculate session idle time, use the LastInputTime structure field. Windows Server 2008 and Windows Vista: This value is not used. |
||||||||
WTSLogonTimeThis value returns FALSE. If you call GetLastError to get extended error information, GetLastError returns ERROR_NOT_SUPPORTED. Windows Server 2008 and Windows Vista: This value is not used. |
||||||||
WTSIncomingBytesThis value returns FALSE. If you call GetLastError to get extended error information, GetLastError returns ERROR_NOT_SUPPORTED. Windows Server 2008 and Windows Vista: This value is not used. |
||||||||
WTSOutgoingBytesThis value returns FALSE. If you call GetLastError to get extended error information, GetLastError returns ERROR_NOT_SUPPORTED. Windows Server 2008 and Windows Vista: This value is not used. |
||||||||
WTSIncomingFramesThis value returns FALSE. If you call GetLastError to get extended error information, GetLastError returns ERROR_NOT_SUPPORTED. Windows Server 2008 and Windows Vista: This value is not used. |
||||||||
WTSOutgoingFramesThis value returns FALSE. If you call GetLastError to get extended error information, GetLastError returns ERROR_NOT_SUPPORTED. Windows Server 2008 and Windows Vista: This value is not used. |
||||||||
WTSClientInfoInformation about a Remote Desktop Connection (RDC) client. For more information, see WTSCLIENT. |
||||||||
WTSSessionInfoInformation about a client session on a RD Session Host server. For more information, see WTSINFO. |
||||||||
WTSSessionInfoExExtended information about a session on a RD Session Host server. For more information, see WTSINFOEX. Windows Server 2008 and Windows Vista: This value is not supported. |
||||||||
WTSConfigInfoA WTSCONFIGINFO structure that contains information about the configuration of a RD Session Host server. Windows Server 2008 and Windows Vista: This value is not supported. |
||||||||
WTSValidationInfoThis value is not supported. |
||||||||
WTSSessionAddressV4A 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 returns ERROR_NOT_SUPPORTED. Windows Server 2008 and Windows Vista: This value is not supported. |
||||||||
WTSIsRemoteSessionDetermines whether the current session is a remote session. The WTSQuerySessionInformation function returns a value of TRUE to indicate that the current session is a remote session, and FALSE 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 and Windows Vista: This value is not supported. |
||||||||
WTSSessionActivityIdA GUID value that contains the Terminal Services activity ID currently associated with the session. Versions prior to Windows Server 2025 or Windows 11 (23H2): This value is not supported. |
Requirements
| Requirement | Value |
|---|---|
| Minimum supported client | Windows Vista |
| Minimum supported server | Windows Server 2008 |
| Header | wtsapi32.h |