/[AnywhereTS-MSSQL]/trunk/TSAdminTool/TerminalServices.cs
ViewVC logotype

Diff of /trunk/TSAdminTool/TerminalServices.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 47 by william, Thu Jul 12 14:29:34 2012 UTC revision 188 by william, Mon Jul 16 15:48:04 2012 UTC
# Line 25  namespace AnywhereTS Line 25  namespace AnywhereTS
25              ref IntPtr ppSessionInfo,              ref IntPtr ppSessionInfo,
26              [MarshalAs(UnmanagedType.U4)] ref Int32 pCount);              [MarshalAs(UnmanagedType.U4)] ref Int32 pCount);
27    
28            /// <summary>
29            /// The WTSQuerySessionInformation function retrieves session information for the specified
30            /// session on the specified terminal server.
31            /// It can be used to query session information on local and remote terminal servers.
32            /// http://msdn.microsoft.com/library/default.asp?url=/library/en-us/termserv/termserv/wtsquerysessioninformation.asp
33            /// </summary>
34            /// <param name="hServer">Handle to a terminal server. Specify a handle opened by the WTSOpenServer function,
35            /// or specify <see cref="WTS_CURRENT_SERVER_HANDLE"/> to indicate the terminal server on which your application is running.</param>
36            /// <param name="sessionId">A Terminal Services session identifier. To indicate the session in which the calling application is running
37            /// (or the current session) specify <see cref="WTS_CURRENT_SESSION"/>. Only specify <see cref="WTS_CURRENT_SESSION"/> when obtaining session information on the
38            /// local server. If it is specified when querying session information on a remote server, the returned session
39            /// information will be inconsistent. Do not use the returned data in this situation.</param>
40            /// <param name="wtsInfoClass">Specifies the type of information to retrieve. This parameter can be one of the values from the <see cref="WTSInfoClass"/> enumeration type. </param>
41            /// <param name="ppBuffer">Pointer to a variable that receives a pointer to the requested information. The format and contents of the data depend on the information class specified in the <see cref="WTSInfoClass"/> parameter.
42            /// To free the returned buffer, call the <see cref="WTSFreeMemory"/> function. </param>
43            /// <param name="pBytesReturned">Pointer to a variable that receives the size, in bytes, of the data returned in ppBuffer.</param>
44            /// <returns>If the function succeeds, the return value is a nonzero value.
45            /// If the function fails, the return value is zero. To get extended error information, call GetLastError.
46            /// </returns>
47          [DllImport("wtsapi32.dll", EntryPoint = "WTSQuerySessionInformation", CallingConvention = CallingConvention.Cdecl)]          [DllImport("wtsapi32.dll", EntryPoint = "WTSQuerySessionInformation", CallingConvention = CallingConvention.Cdecl)]
48          public static extern bool WTSQuerySessionInformation(          public static extern bool WTSQuerySessionInformation(
49              System.IntPtr hServer,              System.IntPtr hServer,
# Line 71  namespace AnywhereTS Line 90  namespace AnywhereTS
90              WTSDown,                // WinStation is down due to error              WTSDown,                // WinStation is down due to error
91              WTSInit,                // WinStation in initialization              WTSInit,                // WinStation in initialization
92          };          };
93            
94            /// <summary>
95            /// Contains values that indicate the type of session information to retrieve in a call to the WTSQuerySessionInformation function.
96            /// http://msdn.microsoft.com/en-us/library/windows/desktop/aa383861(v=vs.85).aspx
97            /// </summary>
98          public enum WTSInfoClass          public enum WTSInfoClass
99          {          {
100                /// <summary>
101                /// A null-terminated string that contains the name of the initial program that Remote Desktop Services runs when the user logs on.
102                /// </summary>
103              WTSInitialProgram,              WTSInitialProgram,
104                /// <summary>
105                /// A null-terminated string that contains the published name of the application that the session is running.
106                /// </summary>
107              WTSApplicationName,              WTSApplicationName,
108                /// <summary>
109                /// A null-terminated string that contains the default directory used when launching the initial program.
110                /// </summary>
111              WTSWorkingDirectory,              WTSWorkingDirectory,
112                /// <summary>
113                /// This value is not used.
114                /// </summary>
115              WTSOEMId,              WTSOEMId,
116                /// <summary>
117                /// A ULONG value that contains the session identifier.
118                /// </summary>
119              WTSSessionId,              WTSSessionId,
120                /// <summary>
121                /// A null-terminated string that contains the name of the user associated with the session.
122                /// </summary>
123              WTSUserName,              WTSUserName,
124                /// <summary>
125                /// A null-terminated string that contains the name of the Remote Desktop Services session.
126                /// 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.
127                /// </summary>
128              WTSWinStationName,              WTSWinStationName,
129                /// <summary>
130                /// A null-terminated string that contains the name of the domain to which the logged-on user belongs.
131                /// </summary>
132              WTSDomainName,              WTSDomainName,
133                /// <summary>
134                /// The session's current connection state. For more information, see WTS_CONNECTSTATE_CLASS.
135                /// </summary>
136              WTSConnectState,              WTSConnectState,
137                /// <summary>
138                /// A ULONG value that contains the build number of the client.
139                /// </summary>
140              WTSClientBuildNumber,              WTSClientBuildNumber,
141                /// <summary>
142                /// A null-terminated string that contains the name of the client.
143                /// </summary>
144              WTSClientName,              WTSClientName,
145                /// <summary>
146                /// A null-terminated string that contains the directory in which the client is installed.
147                /// </summary>
148              WTSClientDirectory,              WTSClientDirectory,
149                /// <summary>
150                /// A USHORT client-specific product identifier.
151                /// </summary>
152              WTSClientProductId,              WTSClientProductId,
153                /// <summary>
154                /// 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.
155                /// </summary>
156              WTSClientHardwareId,              WTSClientHardwareId,
157                /// <summary>
158                /// The network type and network address of the client. For more information, see WTS_CLIENT_ADDRESS.
159                /// The IP address is offset by two bytes from the start of the Address member of the WTS_CLIENT_ADDRESS structure.
160                /// </summary>
161              WTSClientAddress,              WTSClientAddress,
162                /// <summary>
163                /// Information about the display resolution of the client. For more information, see WTS_CLIENT_DISPLAY.
164                /// </summary>
165              WTSClientDisplay,              WTSClientDisplay,
166                /// <summary>
167                /// A USHORT value that specifies information about the protocol type for the session. This is one of the following values.
168                /// 0: The console session.
169                /// 1: This value is retained for legacy purposes.
170                /// 2: The RDP protocol.
171                /// </summary>
172              WTSClientProtocolType,              WTSClientProtocolType,
173                /// <summary>
174                /// This value returns FALSE. If you call GetLastError to get extended error information, GetLastError returns ERROR_NOT_SUPPORTED.
175                /// Windows Server 2008, Windows Vista, Windows Server 2003, Windows XP, and Windows 2000:  This value is not used.
176                /// </summary>
177                WTSIdleTime,
178                /// <summary>
179                /// This value returns FALSE. If you call GetLastError to get extended error information, GetLastError returns ERROR_NOT_SUPPORTED.
180                /// Windows Server 2008, Windows Vista, Windows Server 2003, Windows XP, and Windows 2000:  This value is not used.
181                /// </summary>
182                WTSLogonTime,
183                /// <summary>
184                /// This value returns FALSE. If you call GetLastError to get extended error information, GetLastError returns ERROR_NOT_SUPPORTED.
185                /// Windows Server 2008, Windows Vista, Windows Server 2003, Windows XP, and Windows 2000:  This value is not used.
186                /// </summary>
187                WTSIncomingBytes,
188                /// <summary>
189                /// This value returns FALSE. If you call GetLastError to get extended error information, GetLastError returns ERROR_NOT_SUPPORTED.
190                /// Windows Server 2008, Windows Vista, Windows Server 2003, Windows XP, and Windows 2000:  This value is not used.
191                /// </summary>
192                WTSOutgoingBytes,
193                /// <summary>
194                /// This value returns FALSE. If you call GetLastError to get extended error information, GetLastError returns ERROR_NOT_SUPPORTED.
195                /// Windows Server 2008, Windows Vista, Windows Server 2003, Windows XP, and Windows 2000:  This value is not used.
196                /// </summary>
197                WTSIncomingFrames,
198                /// <summary>
199                /// This value returns FALSE. If you call GetLastError to get extended error information, GetLastError returns ERROR_NOT_SUPPORTED.
200                /// Windows Server 2008, Windows Vista, Windows Server 2003, Windows XP, and Windows 2000:  This value is not used.
201                /// </summary>
202                WTSOutgoingFrames,
203                /// <summary>
204                /// Information about a Remote Desktop Connection (RDC) client. For more information, see WTSCLIENT.
205                /// Windows Vista, Windows Server 2003, Windows XP, and Windows 2000:  This value is not supported.
206                /// This value is supported beginning with Windows Server 2008 and Windows Vista with SP1.
207                /// </summary>
208                WTSClientInfo,
209                /// <summary>
210                /// Information about a client session on an RD Session Host server. For more information, see WTSINFO.
211                /// Windows Vista, Windows Server 2003, Windows XP, and Windows 2000:  This value is not supported.
212                /// This value is supported beginning with Windows Server 2008 and Windows Vista with SP1.
213                /// </summary>
214                WTSSessionInfo,
215                /// <summary>
216                /// Extended information about a session on an RD Session Host server. For more information, see WTSINFOEX.
217                /// Windows Server 2008, Windows Vista, Windows Server 2003, Windows XP, and Windows 2000:  This value is not supported.
218                /// </summary>
219                WTSSessionInfoEx,
220                /// <summary>
221                /// Information about the configuration of an RD Session Host server.
222                /// Windows Server 2008, Windows Vista, Windows Server 2003, Windows XP, and Windows 2000:  This value is not supported.
223                /// </summary>
224                WTSConfigInfo,
225                /// <summary>
226                /// This value is not supported.
227                /// </summary>
228                WTSValidationInfo,
229                /// <summary>
230                /// 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 returns ERROR_NOT_SUPPORTED.
231                /// Windows Server 2008, Windows Vista, Windows Server 2003, Windows XP, and Windows 2000:  This value is not supported.
232                /// </summary>
233                WTSSessionAddressV4,
234                /// <summary>
235                /// Determines 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.
236                /// Windows Server 2008, Windows Vista, Windows Server 2003, Windows XP, and Windows 2000:  This value is not supported.
237                /// </summary>
238                WTSIsRemoteSession,
239          } ;          } ;
240                    
241          public struct WTS_CLIENT_ADDRESS          public struct WTS_CLIENT_ADDRESS

Legend:
Removed from v.47  
changed lines
  Added in v.188

  ViewVC Help
Powered by ViewVC 1.1.22