/[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

--- trunk/TSAdminTool/TerminalServices.cs	2012/07/12 14:29:34	47
+++ trunk/TSAdminTool/TerminalServices.cs	2012/07/16 15:48:04	188
@@ -25,6 +25,25 @@
             ref IntPtr ppSessionInfo,
             [MarshalAs(UnmanagedType.U4)] ref Int32 pCount);
 
+        /// <summary>
+        /// The WTSQuerySessionInformation function retrieves session information for the specified 
+        /// session on the specified terminal server. 
+        /// It can be used to query session information on local and remote terminal servers.
+        /// http://msdn.microsoft.com/library/default.asp?url=/library/en-us/termserv/termserv/wtsquerysessioninformation.asp
+        /// </summary>
+        /// <param name="hServer">Handle to a terminal server. Specify a handle opened by the WTSOpenServer function, 
+        /// or specify <see cref="WTS_CURRENT_SERVER_HANDLE"/> to indicate the terminal server on which your application is running.</param>
+        /// <param name="sessionId">A Terminal Services session identifier. To indicate the session in which the calling application is running 
+        /// (or the current session) specify <see cref="WTS_CURRENT_SESSION"/>. Only specify <see cref="WTS_CURRENT_SESSION"/> when obtaining session information on the 
+        /// local server. If it is specified when querying session information on a remote server, the returned session 
+        /// information will be inconsistent. Do not use the returned data in this situation.</param>
+        /// <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>
+        /// <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. 
+        /// To free the returned buffer, call the <see cref="WTSFreeMemory"/> function. </param>
+        /// <param name="pBytesReturned">Pointer to a variable that receives the size, in bytes, of the data returned in ppBuffer.</param>
+        /// <returns>If the function succeeds, the return value is a nonzero value.
+        /// If the function fails, the return value is zero. To get extended error information, call GetLastError.
+        /// </returns>
         [DllImport("wtsapi32.dll", EntryPoint = "WTSQuerySessionInformation", CallingConvention = CallingConvention.Cdecl)]
         public static extern bool WTSQuerySessionInformation(
             System.IntPtr hServer,
@@ -71,26 +90,152 @@
             WTSDown,                // WinStation is down due to error
             WTSInit,                // WinStation in initialization
         };
-
+        
+        /// <summary>
+        /// Contains values that indicate the type of session information to retrieve in a call to the WTSQuerySessionInformation function.
+        /// http://msdn.microsoft.com/en-us/library/windows/desktop/aa383861(v=vs.85).aspx
+        /// </summary>
         public enum WTSInfoClass
         {
+            /// <summary>
+            /// A null-terminated string that contains the name of the initial program that Remote Desktop Services runs when the user logs on.
+            /// </summary>
             WTSInitialProgram,
+            /// <summary>
+            /// A null-terminated string that contains the published name of the application that the session is running.
+            /// </summary>
             WTSApplicationName,
+            /// <summary>
+            /// A null-terminated string that contains the default directory used when launching the initial program.
+            /// </summary>
             WTSWorkingDirectory,
+            /// <summary>
+            /// This value is not used.
+            /// </summary>
             WTSOEMId,
+            /// <summary>
+            /// A ULONG value that contains the session identifier.
+            /// </summary>
             WTSSessionId,
+            /// <summary>
+            /// A null-terminated string that contains the name of the user associated with the session.
+            /// </summary>
             WTSUserName,
+            /// <summary>
+            /// 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.
+            /// </summary>
             WTSWinStationName,
+            /// <summary>
+            /// A null-terminated string that contains the name of the domain to which the logged-on user belongs.
+            /// </summary>
             WTSDomainName,
+            /// <summary>
+            /// The session's current connection state. For more information, see WTS_CONNECTSTATE_CLASS.
+            /// </summary>
             WTSConnectState,
+            /// <summary>
+            /// A ULONG value that contains the build number of the client.
+            /// </summary>
             WTSClientBuildNumber,
+            /// <summary>
+            /// A null-terminated string that contains the name of the client.
+            /// </summary>
             WTSClientName,
+            /// <summary>
+            /// A null-terminated string that contains the directory in which the client is installed.
+            /// </summary>
             WTSClientDirectory,
+            /// <summary>
+            /// A USHORT client-specific product identifier.
+            /// </summary>
             WTSClientProductId,
+            /// <summary>
+            /// 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.
+            /// </summary>
             WTSClientHardwareId,
+            /// <summary>
+            /// The 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.
+            /// </summary>
             WTSClientAddress,
+            /// <summary>
+            /// Information about the display resolution of the client. For more information, see WTS_CLIENT_DISPLAY.
+            /// </summary>
             WTSClientDisplay,
+            /// <summary>
+            /// A USHORT value that specifies information about the protocol type for the session. This is one of the following values.
+            /// 0: The console session.
+            /// 1: This value is retained for legacy purposes.
+            /// 2: The RDP protocol.
+            /// </summary>
             WTSClientProtocolType,
+            /// <summary>
+            /// 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, Windows XP, and Windows 2000:  This value is not used.
+            /// </summary>
+            WTSIdleTime,
+            /// <summary>
+            /// 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, Windows XP, and Windows 2000:  This value is not used.
+            /// </summary>
+            WTSLogonTime,
+            /// <summary>
+            /// 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, Windows XP, and Windows 2000:  This value is not used.
+            /// </summary>
+            WTSIncomingBytes,
+            /// <summary>
+            /// 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, Windows XP, and Windows 2000:  This value is not used.
+            /// </summary>
+            WTSOutgoingBytes,
+            /// <summary>
+            /// 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, Windows XP, and Windows 2000:  This value is not used.
+            /// </summary>
+            WTSIncomingFrames,
+            /// <summary>
+            /// 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, Windows XP, and Windows 2000:  This value is not used.
+            /// </summary>
+            WTSOutgoingFrames,
+            /// <summary>
+            /// Information about a Remote Desktop Connection (RDC) client. For more information, see WTSCLIENT.
+            /// Windows Vista, Windows Server 2003, Windows XP, and Windows 2000:  This value is not supported. 
+            /// This value is supported beginning with Windows Server 2008 and Windows Vista with SP1.
+            /// </summary>
+            WTSClientInfo,
+            /// <summary>
+            /// Information about a client session on an RD Session Host server. For more information, see WTSINFO. 
+            /// Windows Vista, Windows Server 2003, Windows XP, and Windows 2000:  This value is not supported.
+            /// This value is supported beginning with Windows Server 2008 and Windows Vista with SP1.
+            /// </summary>
+            WTSSessionInfo,
+            /// <summary>
+            /// Extended information about a session on an RD Session Host server. For more information, see WTSINFOEX.
+            /// Windows Server 2008, Windows Vista, Windows Server 2003, Windows XP, and Windows 2000:  This value is not supported.
+            /// </summary>
+            WTSSessionInfoEx,
+            /// <summary>
+            /// Information about the configuration of an RD Session Host server. 
+            /// Windows Server 2008, Windows Vista, Windows Server 2003, Windows XP, and Windows 2000:  This value is not supported.
+            /// </summary>
+            WTSConfigInfo,
+            /// <summary>
+            /// This value is not supported.
+            /// </summary>
+            WTSValidationInfo,
+            /// <summary>
+            /// 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.
+            /// Windows Server 2008, Windows Vista, Windows Server 2003, Windows XP, and Windows 2000:  This value is not supported.
+            /// </summary>
+            WTSSessionAddressV4,
+            /// <summary>
+            /// 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.
+            /// Windows Server 2008, Windows Vista, Windows Server 2003, Windows XP, and Windows 2000:  This value is not supported.
+            /// </summary>
+            WTSIsRemoteSession,
         } ;
         
         public struct WTS_CLIENT_ADDRESS

 

  ViewVC Help
Powered by ViewVC 1.1.22