WTSQuerySessionInformation

  • Thread starter Thread starter amdrit
  • Start date Start date
A

amdrit

I am encountering unexpected results when executing
WTSQuerySessionInformation in C# against my W2K3 terminal server.

When I query for WTSClientProtocolType, the value returned is 0 while I
expect 2.

WTSClientProtocolType
A USHORT value specifying 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.

When I query for WTSWinStationName, the value returned is "Console" while I
expect "RDP-TCP#xxx"

WTSWinStationName
A null-terminated string containing 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. Currently, since 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.


When I looked at terminal services manager, I see my session is not a
console session, rather just labled "RDP-TCP#xxx (username)"

Using C# 2008 / W2K3

Thanks in advance
 
Back
Top