Terminal Services Terminal Server Runtime Interface Protocol
Total Page:16
File Type:pdf, Size:1020Kb
[MS-TSTS]: Terminal Services Terminal Server Runtime Interface Protocol
Intellectual Property Rights Notice for Open Specifications Documentation § Technical Documentation. Microsoft publishes Open Specifications documentation for protocols, file formats, languages, standards as well as overviews of the interaction among each of these technologies. § Copyrights. This documentation is covered by Microsoft copyrights. Regardless of any other terms that are contained in the terms of use for the Microsoft website that hosts this documentation, you may make copies of it in order to develop implementations of the technologies described in the Open Specifications and may distribute portions of it in your implementations using these technologies or your documentation as necessary to properly document the implementation. You may also distribute in your implementation, with or without modification, any schema, IDL's, or code samples that are included in the documentation. This permission also applies to any documents that are referenced in the Open Specifications. § No Trade Secrets. Microsoft does not claim any trade secret rights in this documentation.
§ Patents. Microsoft has patents that may cover your implementations of the technologies described in the Open Specifications. Neither this notice nor Microsoft's delivery of the documentation grants any licenses under those or any other Microsoft patents. However, a given Open Specification may be covered by Microsoft Open Specification Promise or the Community Promise. If you would prefer a written license, or if the technologies described in the Open Specifications are not covered by the Open Specifications Promise or Community Promise, as applicable, patent licenses are available by contacting [email protected]. § Trademarks. The names of companies and products contained in this documentation may be covered by trademarks or similar intellectual property rights. This notice does not grant any licenses under those rights. For a list of Microsoft trademarks, visit www.microsoft.com/trademarks. § Fictitious Names. The example companies, organizations, products, domain names, e-mail addresses, logos, people, places, and events depicted in this documentation are fictitious. No association with any real company, organization, product, domain name, email address, logo, person, place, or event is intended or should be inferred.
1 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 Reservation of Rights. All other rights are reserved, and this notice does not grant any rights other than specifically described above, whether by implication, estoppel, or otherwise. Tools. The Open Specifications do not require the use of Microsoft programming tools or programming environments in order for you to develop an implementation. If you have access to Microsoft programming tools and environments you are free to take advantage of them. Certain Open Specifications are intended for use in conjunction with publicly available standard specifications and network programming art, and assumes that the reader either is familiar with the aforementioned material or has immediate access to it.
2 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 Revision Summary Revision Revision Date History Class Comments
7/20/2007 0.1 Major MCPP Milestone 5 Initial Availability
9/28/2007 0.2 Minor Made changes to technical and editorial content based on feedback.
10/23/2007 0.3 Minor Made technical and editorial changes based on feedback.
11/30/2007 0.4 Minor Made technical and editorial changes based on feedback.
1/25/2008 1.0 Major Updated and revised the technical content.
3/14/2008 2.0 Major IDL files and data typing revised.
5/16/2008 2.0.1 Editorial Changed language and formatting in the technical content.
6/20/2008 3.0 Major Updated and revised the technical content.
7/25/2008 4.0 Major Updated and revised the technical content.
8/29/2008 5.0 Major Updated and revised the technical content.
10/24/2008 6.0 Major Updated and revised the technical content.
12/5/2008 7.0 Major Updated and revised the technical content.
1/16/2009 7.1 Minor Clarified the meaning of the technical content.
2/27/2009 8.0 Major Updated and revised the technical content.
4/10/2009 8.1 Minor Clarified the meaning of the technical content.
5/22/2009 8.1.1 Editorial Changed language and formatting in the technical content.
7/2/2009 9.0 Major Updated and revised the technical content.
8/14/2009 9.1 Minor Clarified the meaning of the technical content.
9/25/2009 9.2 Minor Clarified the meaning of the technical content.
11/6/2009 9.3 Minor Clarified the meaning of the technical content.
12/18/2009 9.4 Minor Clarified the meaning of the technical content.
1/29/2010 9.4.1 Editorial Changed language and formatting in the technical content.
3/12/2010 9.5 Minor Clarified the meaning of the technical content.
4/23/2010 10.0 Major Updated and revised the technical content.
6/4/2010 11.0 Major Updated and revised the technical content.
7/16/2010 12.0 Major Updated and revised the technical content.
8/27/2010 12.0 None No changes to the meaning, language, or formatting of the technical content.
10/8/2010 12.1 Minor Clarified the meaning of the technical content.
11/19/2010 13.0 Major Updated and revised the technical content.
1/7/2011 14.0 Major Updated and revised the technical content.
2/11/2011 15.0 Major Updated and revised the technical content.
3/25/2011 16.0 Major Updated and revised the technical content.
5/6/2011 16.1 Minor Clarified the meaning of the technical content.
6/17/2011 16.2 Minor Clarified the meaning of the technical content.
9/23/2011 17.0 Major Updated and revised the technical content.
12/16/2011 18.0 Major Updated and revised the technical content.
3/30/2012 18.0 None No changes to the meaning, language, or formatting of the
3 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 Revision Revision Date History Class Comments
technical content.
7/12/2012 18.0 None No changes to the meaning, language, or formatting of the technical content.
10/25/2012 18.0 None No changes to the meaning, language, or formatting of the technical content.
1/31/2013 18.0 None No changes to the meaning, language, or formatting of the technical content.
8/8/2013 19.0 Major Updated and revised the technical content.
11/14/2013 20.0 Major Updated and revised the technical content.
2/13/2014 21.0 Major Updated and revised the technical content.
5/15/2014 21.0 None No changes to the meaning, language, or formatting of the technical content.
6/30/2015 22.0 Major Significantly changed the technical content.
10/16/2015 23.0 Major Significantly changed the technical content.
4 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 Table of Contents
5 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 1 Introduction This document specifies the Terminal Services Terminal Server Runtime Interface Protocol. The Terminal Services Terminal Server Runtime Interface Protocol is an RPC-based protocol used for remotely querying and configuring various aspects of a terminal server. Sections 1.8, 2, and 3 of this specification are normative and can contain the terms MAY, SHOULD, MUST, MUST NOT, and SHOULD NOT as defined in [RFC2119]. Sections 1.5 and 1.9 are also normative but do not contain those terms. All other sections and examples in this specification are informative.
1.1 Glossary The following terms are specific to this document: administrator: A user who has complete and unrestricted access to the computer or domain. administrators: An alias object with the security identifier (SID) S-1-5- 32-544. application server mode: A mode in which Terminal Services require a client access license (CAL) to allow remote access to sessions on a terminal server. ASCII: The American Standard Code for Information Interchange (ASCII) is an 8-bit character-encoding scheme based on the English alphabet. ASCII codes represent text in computers, communications equipment, and other devices that work with text. ASCII refers to a single 8-bit ASCII character or an array of 8-bit ASCII characters with the high bit of each character set to zero. client access license (CAL): A license required by a client user or device for accessing a terminal server configured in Application Server mode. directory service (DS): A service that stores and organizes information about a computer network's users and network shares, and that allows network administrators to manage users' access to the shares. See also Active Directory. domain: A set of users and computers sharing a common namespace and management infrastructure. At least one computer member of the set must act as a domain controller (DC) and host a member list that identifies all members of the domain, as well as optionally hosting the Active Directory service. The domain controller provides authentication (2) of members, creating a unit of trust for its members. Each domain has an identifier that is shared among its members. For more information, see [MS-AUTHSOD] section 1.1.1.5 and [MS-ADTS]. endpoint: A network-specific address of a remote procedure call (RPC) server process for remote procedure calls. The actual name and type of the endpoint depends on the RPC protocol sequence that is being used. For example, for RPC over TCP (RPC Protocol Sequence ncacn_ip_tcp), an endpoint might be TCP port 1025. For RPC over Server Message Block
6 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 (RPC Protocol Sequence ncacn_np), an endpoint might be the name of a named pipe. For more information, see [C706]. GINA: The Graphical Identification and Authentication binary. The binary loaded by logon Service, used by the Winlogon, to show the authentication user interface and to validate the user. The default GINA (MSGINA) can be replaced by a custom GINA if an administrator wants to use its own authentication UI/methods such as fingerprint, voice recognition, and so on. For more information, see [MSDN-GINA]. globally unique identifier (GUID): A term used interchangeably with universally unique identifier (UUID) in Microsoft protocol technical documents (TDs). Interchanging the usage of these terms does not imply or require a specific algorithm or mechanism to generate the value. Specifically, the use of this term does not imply or require that the algorithms described in [RFC4122] or [C706] must be used for generating the GUID. See also universally unique identifier (UUID). handle: Any token that can be used to identify and access an object such as a device, file, or a window. input method editor (IME): A process that maps keyboard input to phonetic components (or other language elements) that are specific to a selected language. IMEs are typically used with languages for which conventional keyboard representation is difficult or impossible. For example, East Asian languages are made up of thousands of distinct characters, which makes it impossible to show all of the characters on a single keyboard. To facilitate composition, the IME converts keystrokes into the characters of the target language (such as Japanese Katakana or Simplified Chinese). Interface Definition Language (IDL): The International Standards Organization (ISO) standard language for specifying the interface for remote procedure calls. For more information, see [C706] section 4. listener: A session running on a terminal server that listens for incoming connection requests. Microsoft Interface Definition Language (MIDL): The Microsoft implementation and extension of the OSF-DCE Interface Definition Language (IDL). MIDL can also mean the Interface Definition Language (IDL) compiler provided by Microsoft. For more information, see [MS-RPCE]. named pipe: A named, one-way, or duplex pipe for communication between a pipe server and one or more pipe clients. opnum: An operation number or numeric identifier that is used to identify a specific remote procedure call (RPC) method or a method in an interface. For more information, see [C706] section 12.5.2.12 or [MS- RPCE]. Remote Desktop Protocol (RDP): A multi-channel protocol that allows a user to connect to a computer running Microsoft Terminal Services (TS). RDP enables the exchange of client and server settings and also enables
7 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 negotiation of common settings to use for the duration of the connection, so that input, graphics, and other data can be exchanged and processed between client and server. remote procedure call (RPC): A context-dependent term commonly overloaded with three meanings. Note that much of the industry literature concerning RPC technologies uses this term interchangeably for any of the three meanings. Following are the three definitions: (*) The runtime environment providing remote procedure call facilities. The preferred usage for this meaning is "RPC runtime". (*) The pattern of request and response message exchange between two parties (typically, a client and a server). The preferred usage for this meaning is "RPC exchange". (*) A single message from an exchange as defined in the previous definition. The preferred usage for this term is "RPC message". For more information about RPC, see [C706]. RPC protocol sequence: A character string that represents a valid combination of a remote procedure call (RPC) protocol, a network layer protocol, and a transport layer protocol, as described in [C706] and [MS- RPCE]. RPC transport: The underlying network services used by the remote procedure call (RPC) runtime for communications between network nodes. For more information, see [C706] section 2. security identifier (SID): An identifier for security principals in Windows that is used to identify an account or a group. Conceptually, the SID is composed of an account authority portion (typically a domain) and a smaller integer representing an identity relative to the account authority, termed the relative identifier (RID). The SID format is specified in [MS- DTYP] section 2.4.2; a string representation of SIDs is specified in [MS- DTYP] section 2.4.2 and [MS-AZOD] section 1.1.1.2. session: A collection of applications simultaneously running under the same Win32 subsystem. shell: Part of the Windows user interface (UI) that organizes and controls user access to a wide variety of objects necessary for running applications and managing the operating system. The most numerous are the folders and files that reside on computer storage media. There are also a number of virtual objects such as network printers and other computers. The shell organizes these objects into a hierarchical namespace and provides an API to access them. SYSTEM: An account that is used by the operating system. For more information about system account access rights, see [MSDN-LocSysAcct]. terminal server: A computer on which terminal services is running. terminal services (TS): A service on a server computer that allows delivery of applications, or the desktop itself, to various computing devices. When a user runs an application on a terminal server, the application execution takes place on the server computer and only keyboard, mouse, and display information is transmitted over the
8 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 network. Each user sees only his or her individual session, which is managed transparently by the server operating system and is independent of any other client session. Unicode: A character encoding standard developed by the Unicode Consortium that represents almost all of the written languages of the world. The Unicode standard [UNICODE5.0.0/2007] provides three forms (UTF-8, UTF-16, and UTF-32) and seven schemes (UTF-8, UTF-16, UTF-16 BE, UTF-16 LE, UTF-32, UTF-32 LE, and UTF-32 BE). universally unique identifier (UUID): A 128-bit value. UUIDs can be used for multiple purposes, from tagging objects with an extremely short lifetime, to reliably identifying very persistent objects in cross-process communication such as client and server interfaces, manager entry-point vectors, and RPC objects. UUIDs are highly likely to be unique. UUIDs are also known as globally unique identifiers (GUIDs) and these terms are used interchangeably in the Microsoft protocol technical documents (TDs). Interchanging the usage of these terms does not imply or require a specific algorithm or mechanism to generate the UUID. Specifically, the use of this term does not imply or require that the algorithms described in [RFC4122] or [C706] must be used for generating the UUID. well-known endpoint: A preassigned, network-specific, stable address for a particular client/server instance. For more information, see [C706]. Windows Station (WinStation): Sessions running on the computer. MAY, SHOULD, MUST, SHOULD NOT, MUST NOT: These terms (in all caps) are used as defined in [RFC2119]. All statements of optional behavior use either MAY, SHOULD, or SHOULD NOT.
1.2 References Links to a document in the Microsoft Open Specifications library point to the correct section in the most recently published version of the referenced document. However, because individual documents in the library are not updated at the same time, the section numbers in the documents may not match. You can confirm the correct section numbering by checking the Errata.
1.2.1 Normative References We conduct frequent surveys of the normative references to assure their continued availability. If you have any issue with finding a normative reference, please contact [email protected]. We will assist you in finding the relevant information. [C706] The Open Group, "DCE 1.1: Remote Procedure Call", C706, August 1997, https://www2.opengroup.org/ogsys/catalog/c706
[MS-ADA1] Microsoft Corporation, "Active Directory Schema Attributes A-L".
[MS-ADA2] Microsoft Corporation, "Active Directory Schema Attributes M".
[MS-ADA3] Microsoft Corporation, "Active Directory Schema Attributes N-Z".
9 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 [MS-ADSC] Microsoft Corporation, "Active Directory Schema Classes".
[MS-DTYP] Microsoft Corporation, "Windows Data Types".
[MS-ERREF] Microsoft Corporation, "Windows Error Codes".
[MS-RDPBCGR] Microsoft Corporation, "Remote Desktop Protocol: Basic Connectivity and Graphics Remoting".
[MS-RDPERP] Microsoft Corporation, "Remote Desktop Protocol: Remote Programs Virtual Channel Extension".
[MS-RPCE] Microsoft Corporation, "Remote Procedure Call Protocol Extensions".
[MS-RPCH] Microsoft Corporation, "Remote Procedure Call over HTTP Protocol".
[MSDN-ExitWindowsEx] Microsoft Corporation, "ExitWindowsEx function", http://msdn.microsoft.com/en-us/library/aa376868(VS.85).aspx
[MSDN-MSGBOX] Microsoft Corporation, "Message Box", http://msdn.microsoft.com/en-us/library/ms645505.aspx
[MSDN-PROCRIGHTS] Microsoft Corporation, "Process Security and Access Rights", http://msdn.microsoft.com/en-us/library/ms684880(VS.85).aspx
[MSDN-PRVLGECNSTS] Microsoft Corporation, "Privilege Constants", http://msdn.microsoft.com/en-us/library/bb530716(v=VS.85).aspx
[MSDN-RCMWin32_TSRCS] Microsoft Corporation, "RemoteControl Method of the Win32_TSRemoteControlSetting Class", http://msdn.microsoft.com/en- us/library/aa383818(v=VS.85).aspx
[MSDN-RPCBIND] Microsoft Corporation, "Creating a Binding Handle", http://msdn.microsoft.com/en-us/library/aa373609.aspx
[MSDN-TDIADDRESS] Microsoft Corporation, "TDI_ADDRESS_IP structure", http://msdn.microsoft.com/en-us/library/ff565072.aspx
[MSDN-TOKENRIGHTS] Microsoft Corporation, "Access Rights for Access-Token Objects", http://msdn.microsoft.com/en-us/library/aa374905(VS.85).aspx
[MSFT-SDLBTS] Microsoft Corporation, "Session Directory and Load Balancing Using Terminal Server", September 2002, http://download.microsoft.com/download/8/6/2/8624174c-8587-4a37-8722- 00139613a5bc/TS_Session_Directory.doc
[MSFT-WINMCE] Microsoft Corporation, "Windows Media Center", http://www.microsoft.com/windows/windows-media-center/get- started/default.aspx
10 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997, http://www.rfc- editor.org/rfc/rfc2119.txt
[WININTERNALS] Russinovich, M., and Solomon, D., "Microsoft Windows Internals, Fourth Edition", Microsoft Press, 2005, ISBN: 0735619174.
[X509] ITU-T, "Information Technology - Open Systems Interconnection - The Directory: Public-Key and Attribute Certificate Frameworks", Recommendation X.509, August 2005, http://www.itu.int/rec/T-REC-X.509/en
1.2.2 Informative References [MSDN-DWM] Microsoft Corporation, "Desktop Window Manager", http://msdn.microsoft.com/en-us/library/aa969540.aspx
[MSDN-MSGBeep] Microsoft Corporation, "MessageBeep function", http://msdn.microsoft.com/en-us/library/ms680356(VS.85).aspx
[MSDN-ProductID] Microsoft Corporation, "ProductID property", http://msdn.microsoft.com/en-us/library/aa370855(VS.85).aspx
[MSDN-SERIAL] Microsoft Corporation, "Serial Communications in Win32", http://msdn.microsoft.com/en-us/library/ms810467.aspx
[MSDN-SOCKADDR_IN6] Microsoft Corporation, "SOCKADDR_IN6 structure", http://msdn.microsoft.com/en-us/library/ff570824(VS.85).aspx
[MSDN-SOCKET] Microsoft Corporation, "socket function", http://msdn.microsoft.com/en-us/library/ms740506.aspx
[MSDN-SYSTIME] Microsoft Corporation, "SYSTEMTIME structure", http://msdn.microsoft.com/en-us/library/ms189104.aspx
[MSDN-Win32_TSAcct] Microsoft Corporation, "Win32_TSAccount class", http://msdn.microsoft.com/en-us/library/aa383773(VS.85).aspx
[MSFT-IME] Microsoft Corporation, "Microsoft Global Input Method Editors (IMEs)", http://www.microsoft.com/windows/ie/ie6/downloads/recommended/ime/defa ult.mspx
[MSFT-VS] Microsoft Corporation, "Virtual Server", http://www.microsoft.com/windowsserversystem/virtualserver/default.aspx
[MSFT-W2KDDK] Microsoft Press, "Microsoft Windows 2000 Driver Development Reference Kit, volumes 1-3", March 2000, ISBN: 0735609292.
Note The Windows 2000 DDK publication is cited as it was the last DDK (Driver Development Kit) that was physically in print. All driver development
11 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 documentation since then has been delivered in soft format, and is available for download here: http://www.m... [MSFT-WINSYSINTERNALS] Microsoft Corporation, "Windows Sysinternals", http://technet.microsoft.com/en-us/sysinternals
[MSFT-WSTSL] Microsoft Corporation, "Overview of Remote Desktop Licensing", http://technet.microsoft.com/en-us/library/cc725933.aspx
1.3 Overview The Terminal Services Terminal Server Runtime Interface Protocol is a simple request-response RPC-based protocol used for remotely querying and configuring various aspects of a terminal server. For example, this protocol can be used to query the number of active sessions running on a terminal server. For every method that the server receives, it executes the method and returns a completion. The client simply returns the completion status to the caller. The protocol consists of four major subcomponents: § Local Session Manager (LSM): A system component that creates, destroys, and manages sessions. § TermService: A service running on the system that manages remote connection requests. § VM Host Agent: A service running on the system that monitors the states of the sessions within virtual machines hosted on the server [MSFT- VS].<1> § Virtual IP: A service running on the system that assigns IP addresses to sessions that are created by using remote connection requests. The protocol can be further divided into the following functional categories:<2> Functional categories associated with the Local Session Manager (LSM) subcomponent: § Local Session Manager (LSM) Session: These calls collect information, and control and configure sessions running on the terminal server. § Local Session Manager (LSM) Notification: These RPC calls are asynchronous and can be used to receive event notifications from the LSM. § Local Session Manager (LSM) Enumeration: These calls are used to enumerate information related to sessions running on a terminal server. Functional categories associated with the VM Host Agent subcomponent: § VM Host Agent Session: These calls collect information as well as control and configure sessions running on the virtual machines hosted on the server. § VM Host Agent Notification: These RPC calls are asynchronous and can be used to receive event notifications from VM Host Agent. § VM Host Agent Enumeration: These calls are used to enumerate information related to sessions running on the virtual machines hosted on the server. Functional categories associated with the TermService subcomponent:
12 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 § TermService: These calls can be used to query and configure various aspects of the TermServices running on the terminal server. § TermService Listener: These calls are specific to the listener session running on the terminal server and listening for incoming connection requests. § Legacy: The legacy calls used by Terminal Services clients.
1.4 Relationship to Other Protocols The Terminal Services Terminal Server Runtime Interface Protocol is dependent upon RPC for its transport. This protocol uses RPC over named pipes as specified in section 2.1.
1.5 Prerequisites/Preconditions The Terminal Services Terminal Server Runtime Interface Protocol is an RPC interface and as a result has the prerequisites specified in [MS-RPCE] as being common to RPC interfaces. It is assumed that a Terminal Services Terminal Server Runtime Interface Protocol client has obtained the name of a terminal server that supports the Terminal Services Terminal Server Runtime Interface Protocol before this protocol is invoked. The manner in which a client obtains the terminal server name is implementation-specific.
1.6 Applicability Statement The Terminal Services Terminal Server Runtime Interface Protocol is appropriate only for querying and configuring a terminal server.
1.7 Versioning and Capability Negotiation None.
1.8 Vendor-Extensible Fields The Terminal Services Terminal Server Runtime Interface Protocol uses Win32 error codes defined in [MS-ERREF]. Vendors SHOULD reuse those values with their indicated meaning.<3> Choosing any other value might cause a collision in the future.
1.9 Standards Assignments In the following table, interfaces are based on binding and named pipes are based on the RPC Programming Model Overview as specified in [C706] section 2. Description Interface UUID Named pipe
LSM Session (tspubrpc.idl)<4> { 484809d6-4239-471b-b5bc- \PIPE\LSM_API_service 61df8c23ac48 } \PIPE\UNIFIED_API_service<5>
LSM Notification { 11899a43-2b68-4a76-92e3- \PIPE\LSM_API_service (tspubrpc.idl)<6> a3d6ad8c26ce } \PIPE\UNIFIED_API_service<7>
13 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 Description Interface UUID Named pipe
LSM Enumeration { 88143fd0-c28d-4b2b-8fef- \PIPE\LSM_API_service (tspubrpc.idl)<8> 8d882f6a9390 } \PIPE\UNIFIED_API_service<9>
TermSrv (RCMPublic.idl)<10> { bde95fdf-eee0-45de-9e12- \PIPE\TermSrv_API_service e5a61cd0d4fe }
TermSrv Listener { 497d95a6-2d27-4bf5-9bbd- \PIPE\TermSrv_API_service (RCMPublic.idl)<11> a6046957133c }
Legacy (Legacy.idl) { 5ca4a760-ebb1-11cf-8611- \PIPE\Ctx_WinStation_API_service 00a0245420ed }
TSVIPPublic (TSVIPRpc.idl) {53b46b02-c73b-4a3e-8dee- \PIPE\TSVIP_Service b16b80672fc0}
SessEnvPublicRpc {1257B580-CE2F-4109-82D6- \PIPE\SessEnvPublicRpc (SessEnvRpc.idl) A9459D0BF6BC}
14 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 2 Messages
2.1 Transport The Terminal Services Terminal Server Runtime Interface Protocol uses the RPC protocol sequences as specified in [MS-RPCE] section 2.1.1 and [MS- RPCH] section 1.4. The Terminal Services Terminal Server Runtime Interface Protocol uses the following static endpoints in addition to well-known endpoints. These endpoints are ports for [MS-RPCH] section 1.5 and [MS-RPCE] section 2.1 on the terminal server. Port 3389: This endpoint is used by the terminal server to listen for incoming RPC method calls. The authenticated RPC interface allows RPC to negotiate the use of authentication and the authentication level on behalf of the Terminal Services client and target server.
Both types of endpoints (Static endpoints and well-known endpoints) MUST be supported. The Terminal Services Terminal Server Runtime Interface Protocol MUST use the universally unique identifier (UUID) as specified in section 1.9.
2.2 Common Data Types In addition to RPC base types specified in [C706] and in [MS-RPCE], this document uses the following definitions, as specified in [MS-DTYP]: § BOOL § BOOLEAN § BYTE § CHAR § DWORD § HANDLE § HRESULT § hyper § LONG § UCHAR § UINT § ULONG § USHORT § VOID § WCHAR The document also uses the following definitions: § Some data structures described in this document, for example USERCONFIG and WINSTATIONCLIENT, use ULONG members to store sets of BOOLEAN flags defined using C bit-field syntax. § The variation in the use of data types is a result of the as-built interface. The data types in the following sections are defined in the Microsoft Interface Definition Language (MIDL) specification for this RPC interface, as specified in section 6.
15 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 2.2.1 Data Types
2.2.1.1 SESSION_HANDLE This type is declared as follows:
3 typedef [context_handle] void* SESSION_HANDLE;
A handle to a session on the terminal server. It is returned by RpcOpenSession.
3.1.1.1 ENUM_HANDLE This type is declared as follows:
4 typedef [context_handle] void* ENUM_HANDLE;
A handle representing the session enumeration object on the terminal server. It is returned by RpcOpenEnum.
4.1.1.1 HLISTENER This type is declared as follows:
5 typedef [context_handle] void* HLISTENER;
A handle representing a listener running on the terminal server.
5.1.1.1 SERVER_HANDLE This type is declared as follows:
6 typedef [context_handle] void* SERVER_HANDLE;
A handle returned by RpcWinStationOpenServer on the terminal server.
6.1.1.1 WINSTATIONNAME An array of WCHAR (WINSTATIONNAME) characters that represent the name of a session. This type is declared as follows:
7 typedef WCHAR WINSTATIONNAME[WINSTATIONNAME_LENGTH + 1];
7.1.1.1 DLLNAME The name of a DLL.
8 typedef WCHAR DLLNAME[DLLNAME_LENGTH + 1];
9 typedef WCHAR* PDLLNAME;
9.1.1.1 DEVICENAME The name of a device.
16 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 10 typedef WCHAR DEVICENAME[DEVICENAME_LENGTH + 1];
11 typedef WCHAR* PDEVICENAME;
11.1.1.1 WINSTATIONINFOCLASS The WINSTATIONINFOCLASS enumeration is used by RpcWinStationQueryInformation and RpcWinStationSetInformation to indicate the class of data for which to either query or set on the server. A brief description of each info class is appended to each enum value. See RpcWinStationQueryInformation for information about classes of data that can be queried and RpcWinStationSetInformation for classes of data that can be set. The enum value WinStationUnused1 MAY be used.<12>
12 typedef enum _WINSTATIONINFOCLASS
13 {
14 WinStationCreateData,
15 WinStationConfiguration,
16 WinStationPdParams,
17 WinStationWd,
18 WinStationPd,
19 WinStationPrinter,
20 WinStationClient,
21 WinStationModules,
22 WinStationInformation,
23 WinStationTrace,
24 WinStationBeep,
25 WinStationEncryptionOff,
26 WinStationEncryptionPerm,
27 WinStationNtSecurity,
28 WinStationUserToken,
29 WinStationUnused1,
30 WinStationVideoData,
31 WinStationInitialProgram,
32 WinStationCd,
17 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 33 WinStationSystemTrace,
34 WinStationVirtualData,
35 WinStationClientData,
36 WinStationSecureDesktopEnter,
37 WinStationSecureDesktopExit,
38 WinStationLoadBalanceSessionTarget,
39 WinStationLoadIndicator,
40 WinStationShadowInfo,
41 WinStationDigProductId,
42 WinStationLockedState,
43 WinStationRemoteAddress,
44 WinStationIdleTime,
45 WinStationLastReconnectType,
46 WinStationDisallowAutoReconnect,
47 WinStationUnused2,
48 WinStationUnused3,
49 WinStationUnused4,
50 WinStationUnused5,
51 WinStationReconnectedFromId,
52 WinStationEffectsPolicy,
53 WinStationType,
54 WinStationInformationEx
55 } WINSTATIONINFOCLASS;
WinStationCreateData: Query the data used to create an instance of WinStation.<13>
WinStationConfiguration: Query or set the WinStation parameters.
WinStationPdParams: Query or set the Protocol Drivers (PD) parameters.
WinStationWd: Query the Window Driver (WD) configuration. (Only one WD configuration can be loaded.)
WinStationPd: Query the PD configuration. (Many PD configurations can be loaded).
WinStationPrinter: Query or set the Line Printer Terminal (LPT) mapping to printer queues.<14>
18 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 WinStationClient: Query information about the client.
WinStationModules: Query information about all client modules.
WinStationInformation: Query information about the WinStation.
WinStationTrace: Enable or disable WinStation tracing.<15>
WinStationBeep: Sound a beep in the WinStation.<16>
WinStationEncryptionOff: Turn off encryption.<17>
WinStationEncryptionPerm: Encryption is permanently on.<18>
WinStationNtSecurity: Select logon service<19> security desktop.<20>
WinStationUserToken: Query the primary access token of the logged-on user.
WinStationUnused1: Not used.
WinStationVideoData: Query the horizontal resolution, vertical resolution, and color depth.<21>
WinStationInitialProgram: Identify the initial program run by Terminal Services when the user logs on.<22>
WinStationCd: Query the Client Device (CD) configuration. (Only one CD configuration can be loaded.)<23>
WinStationSystemTrace: Enable or disable system tracing.<24>
WinStationVirtualData: Query the client virtual data.
WinStationClientData: Send data to a client.<25>
WinStationSecureDesktopEnter: Turn encryption on, if enabled.<26>
WinStationSecureDesktopExit: Turn encryption off, if enabled.<27>
WinStationLoadBalanceSessionTarget: Load balance information from a redirected client.<28>
WinStationLoadIndicator: Query load capacity information.
WinStationShadowInfo: Query or set shadow state and parameters.<29>
WinStationDigProductId: Get the WINSTATIONPRODID, as specified in section 2.2.2.36.<30>
WinStationLockedState: Used by the logon service<31> to notify applications and services.
WinStationRemoteAddress: Query the client IP address.
WinStationIdleTime: Query for the amount of time the WinStation is idle.<32>
WinStationLastReconnectType: Query if the last reconnect for this WinStation was manual or auto- reconnect.<33>
WinStationDisallowAutoReconnect: Allow or disallow auto-reconnect for this WinStation.<34>
WinStationUnused2: Not used.
WinStationUnused3: Not used.
WinStationUnused4: Not used.
WinStationUnused5: Not used.
19 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 WinStationReconnectedFromId: In the case of reconnected sessions, return the session ID of the temporary session from which it was reconnected, or -1 if no temporary session was created.
WinStationEffectsPolicy: Return policies that differentiate among implementations.
WinStationType: Return the type of the session associated with this WinStation.<35>
WinStationInformationEx: Return the extended information about the WinStation.<36>
55.1.1.1 WINSTATIONSTATECLASS The WINSTATIONSTATECLASS enumeration represents the current state of a session.
56 typedef enum _WINSTATIONSTATECLASS
57 {
58 State_Active = 0,
59 State_Connected = 1,
60 State_ConnectQuery = 2,
61 State_Shadow = 3,
62 State_Disconnected = 4,
63 State_Idle = 5,
64 State_Listen = 6,
65 State_Reset = 7,
66 State_Down = 8,
67 State_Init = 9
68 } WINSTATIONSTATECLASS;
State_Active: A user is logged on to a session and the client is connected.
State_Connected: A client is connected to a session but the user has not yet logged on.
State_ConnectQuery: A session is in the process of connecting to a client.
State_Shadow: A session is shadowing another session.
State_Disconnected: A user is logged on to the session but the client is currently disconnected from the server.
State_Idle: A session is waiting for a client to connect to the server.
State_Listen: A listener is waiting for connections from the Terminal Services client.
State_Reset: A session is being reset. As a result, the user is logged off, the session is terminated, and the client is disconnected.<37>
State_Down: A session is currently tearing down or is in the down state, indicating an error.
State_Init: A session is in the process of being initialized.
20 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 68.1.1.1 SDCLASS The SDCLASS (stack driver class) enumeration is used to specify a type of binary or driver in the union PDPARAMS and to indicate which structure in the union PDPARAMS applies to a given instance of the PDPARAMS structure.
69 typedef enum _SDCLASS
70 {
71 SdNone = 0,
72 SdConsole = 1,
73 SdNetwork = 2,
74 SdAsync = 3,
75 SdOemTransport = 4
76 } SDCLASS;
SdNone: None.
SdConsole: Not used.
SdNetwork: Indicates the networking binaries.<38>
SdAsync: Indicates the async (modem) drivers.<39>
SdOemTransport: Indicates the user transport drivers.<40>
76.1.1.1 SHADOWCLASS The SHADOWCLASS enumeration is used to indicate the shadow-related settings for a session running on a terminal server.
77 typedef enum _SHADOWCLASS
78 {
79 Shadow_Disable = 0,
80 Shadow_EnableInputNotify = 1,
81 Shadow_EnableInputNoNotify = 2,
82 Shadow_EnableNoInputNotify = 3,
83 Shadow_EnableNoInputNoNotify = 4
84 } SHADOWCLASS;
Shadow_Disable: Shadowing is disabled.
Shadow_EnableInputNotify: Permission is asked first from the session being shadowed. The shadower is also permitted keyboard and mouse input.
Shadow_EnableInputNoNotify: Permission is not asked first from the session being shadowed. The shadower is also permitted keyboard and mouse input.
21 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 Shadow_EnableNoInputNotify: Permission is asked first from the session being shadowed. The shadower is not permitted keyboard and mouse input and MUST observe the shadowed session.
Shadow_EnableNoInputNoNotify: Permission is not asked first from the session being shadowed. The shadower is not permitted keyboard and mouse input and MUST observe the shadowed session.
84.1.1.1 RECONNECT_TYPE The RECONNECT_TYPE enumeration specifies the reconnect type of the last session reconnect.
85 typedef enum _RECONNECT_TYPE
86 {
87 NeverReconnected = 0,
88 ManualReconnect = 1,
89 AutoReconnect = 2
90 } RECONNECT_TYPE,
91 *PRECONNECT_TYPE;
NeverReconnected: Session has never been reconnected to. This is the default type until the first time the session has been reconnected to.
ManualReconnect: Session was disconnected from and was manually reconnected to by the user.
AutoReconnect: Session was disconnected from and was automatically reconnected to by the Terminal Services client and the server negotiating the reconnect without input from the user.
91.1.1.1 CLIENTDATANAME Specifies the name of the client data being provided.
92 typedef CHAR CLIENTDATANAME[CLIENTDATANAME_LENGTH + 1];
93 typedef CHAR* PCLIENTDATANAME;
The name has the following form:
94 name syntax: xxxyyyy
The elements are as follows: xxx: The OEM ID. yyyy: Client data name.
94.1.1.1 TNotificationId Specifies the type of notification for which to wait from the terminal server. It MUST be a bitwise OR of any of the values shown in the following table. This type is declared as follows:
22 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 95 typedef ULONG TNotificationId;
Value Meaning
WTS_NOTIFY_NONE No notification 0x0
WTS_NOTIFY_CREATE Session creation notification 0x1
WTS_NOTIFY_CONNECT Session connection notification 0x2
WTS_NOTIFY_DISCONNECT Session disconnection notification 0x4
WTS_NOTIFY_LOGON Session logon notification 0x8
WTS_NOTIFY_LOGOFF Session logoff notification 0x10
WTS_NOTIFY_SHADOW_START Session shadow start notification 0x20
WTS_NOTIFY_SHADOW_STOP Session shadow stop notification 0x40
WTS_NOTIFY_TERMINATE Session termination notification 0x80
WTS_NOTIFY_CONSOLE_CONNECT Console session connection notification 0x100
WTS_NOTIFY_CONSOLE_DISCONNECT Console session disconnect notification 0x200
WTS_NOTIFY_LOCK Session lock notification 0x400
WTS_NOTIFY_UNLOCK Session unlock notification 0x800
WTS_NOTIFY_ALL All notifications 0xffffffff
95.1.1.1 NOTIFY_HANDLE A handle to a notification object. Used in asynchronous calls such as RpcRegisterAsyncNotification and RpcWaitAsyncNotification. This type is declared as follows:
96 typedef [context_handle] void* NOTIFY_HANDLE;
96.1.1.1 BOUNDED_ULONG A bounded ULONG. This type is declared as follows:
23 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 97 typedef [range(0, 0x8000)] ULONG BOUNDED_ULONG;
97.1.1.1 UINT_PTR An unsigned integer, whose length is dependent on processor word size.
98 #if defined(_WIN64)
99 typedef unsigned __int64 UINT_PTR;
100 #else
101 typedef unsigned int UINT_PTR;
102 #endif
102.1.1.1 SESSIONTYPE The SESSIONTYPE enumeration defines the type of the session.
103 typedef enum
104 {
105 SESSIONTYPE_UNKNOWN = 0,
106 SESSIONTYPE_SERVICES,
107 SESSIONTYPE_LISTENER,
108 SESSIONTYPE_REGULARDESKTOP,
109 SESSIONTYPE_ALTERNATESHELL,
110 SESSIONTYPE_REMOTEAPP,
111 SESSIONTYPE_MEDIACENTEREXT
112 } SESSIONTYPE;
SESSIONTYPE_UNKNOWN: The type of the session cannot be determined.
SESSIONTYPE_SERVICES: The session is used only to run the operating system services, and that no user can be logged on to the session.
SESSIONTYPE_LISTENER: The session is used only to run the Terminal Services listeners, and that no user can be logged on to the session.
SESSIONTYPE_REGULARDESKTOP: The session is connected by using Terminal Services and is running the standard shell.<41>
SESSIONTYPE_ALTERNATESHELL: The session is connected by using Terminal Services and is running an alternate shell instead of the standard shell.
SESSIONTYPE_REMOTEAPP: The session is a RAIL (Remote Applications Integrated Locally) session as defined in [MS-RDPERP].
SESSIONTYPE_MEDIACENTEREXT: The session was connected by using a media center extender device. For more information about the media center, see [MSFT-WINMCE].
24 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 112.1.1.1 SHADOW_CONTROL_REQUEST The SHADOW_CONTROL_REQUEST enumeration specifies if a shadow of user input control is being requested.
113 typedef enum
114 {
115 SHADOW_CONTROL_REQUEST_VIEW = 0,
116 SHADOW_CONTROL_REQUEST_TAKECONTROL,
117 SHADOW_CONTROL_REQUEST_Count
118 } SHADOW_CONTROL_REQUEST;
SHADOW_CONTROL_REQUEST_VIEW: The shadow request is for a view-only session. User input is not being requested.
SHADOW_CONTROL_REQUEST_TAKECONTROL: User input control is being requested.
SHADOW_CONTROL_REQUEST_Count: Count of enum values.
118.1.1.1 SHADOW_PERMISSION_REQUEST The SHADOW_PERMISSION_REQUEST enumeration specifies whether user permission is being requested.
119 typedef enum
120 {
121 SHADOW_PERMISSION_REQUEST_SILENT = 0,
122 SHADOW_PERMISSION_REQUEST_REQUESTPERMISSION,
123 SHADOW_PERMISSION_REQUEST_Count
124 } SHADOW_PERMISSION_REQUEST;
SHADOW_PERMISSION_REQUEST_SILENT: Permission is not requested.
SHADOW_PERMISSION_REQUEST_REQUESTPERMISSION: User permission will be requested before the shadow session begins.
SHADOW_PERMISSION_REQUEST_Count: Count of enum values.
124.1.1.1 SHADOW_REQUEST_RESPONSE The SHADOW_REQUEST_RESPONSE enumeration defines the response to a shadow session request.
125 typedef enum
126 {
127 SHADOW_REQUEST_RESPONSE_ALLOW = 0,
128 SHADOW_REQUEST_RESPONSE_DECLINE,
25 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 129 SHADOW_REQUEST_RESPONSE_POLICY_PERMISSION_REQUIRED,
130 SHADOW_REQUEST_RESPONSE_POLICY_DISABLED,
131 SHADOW_REQUEST_RESPONSE_POLICY_VIEW_ONLY,
132 SHADOW_REQUEST_RESPONSE_POLICY_VIEW_ONLY_PERMISSION_REQUIRED,
133 SHADOW_REQUEST_RESPONSE_SESSION_ALREADY_CONTROLLED
134 } SHADOW_REQUEST_RESPONSE;
SHADOW_REQUEST_RESPONSE_ALLOW: The user has granted the request for permission to shadow the session.
SHADOW_REQUEST_RESPONSE_DECLINE: The user has declined the request for permission to shadow the session.
SHADOW_REQUEST_RESPONSE_POLICY_PERMISSION_REQUIRED: Permission was not requested, but group policy specifies that permission is required.
SHADOW_REQUEST_RESPONSE_POLICY_DISABLED: Shadowing has been disabled by group policy.
SHADOW_REQUEST_RESPONSE_POLICY_VIEW_ONLY: A request for control was made, but group policy exclusively allows view-only shadowing.
SHADOW_REQUEST_RESPONSE_POLICY_VIEW_ONLY_PERMISSION_REQUIRED: A request was made to take control without requesting permission, but group policy exclusively allows view-only shadowing and also requires permission.
SHADOW_REQUEST_RESPONSE_SESSION_ALREADY_CONTROLLED: The session cannot be shadowed because another shadow session is currently controlling the session.
134.1.1 Structures
134.1.1.1 SESSION_FILTER The SESSION_FILTER enumeration specifies the types of filters to apply when retrieving the list of session IDs running on a terminal server. There is only one type of filter exposed by RPC.
135 typedef enum _SESSION_FILTER
136 {
137 SF_SERVICES_SESSION_POPUP = 0
138 } SESSION_FILTER;
SF_SERVICES_SESSION_POPUP: Returns all sessions in a logged-on state.
138.1.1.1 PROTOCOLSTATUS_INFO_TYPE The PROTOCOLSTATUS_INFO_TYPE enumeration specifies the protocol status information requested for a particular session running on a terminal server.
26 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 139 typedef enum
140 {
141 PROTOCOLSTATUS_INFO_BASIC = 0,
142 PROTOCOLSTATUS_INFO_EXTENDED = 1
143 } PROTOCOLSTATUS_INFO_TYPE;
PROTOCOLSTATUS_INFO_BASIC: Returns basic information about the protocol status in a PROTOCOLSTATUS structure.
PROTOCOLSTATUS_INFO_EXTENDED: Returns extended information about the protocol status. Extended information is returned in a PROTOCOLSTATUSEX structure.
143.1.1.1 QUERY_SESSION_DATA_TYPE The QUERY_SESSION_DATA_TYPE enumeration specifies the type of session information that can be requested for a particular session running on a terminal server.
144 typedef enum
145 {
146 QUERY_SESSION_DATA_MODULE = 0,
147 QUERY_SESSION_DATA_WDCONFIG,
148 QUERY_SESSION_DATA_VIRTUALDATA,
149 QUERY_SESSION_DATA_LICENSE,
150 QUERY_SESSION_DATA_DEVICEID,
151 QUERY_SESSION_DATA_LICENSE_VALIDATION
152 } QUERY_SESSION_DATA_TYPE;
QUERY_SESSION_DATA_MODULE: Retrieves data about protocol-specific binaries loaded for the given Terminal Services session. The type of the data is PBYTE.
QUERY_SESSION_DATA_WDCONFIG: Retrieves protocol driver configuration data for the session. The data returned is of type WDCONFIG.
QUERY_SESSION_DATA_VIRTUALDATA: Retrieves data about virtual channels for the given Terminal Services session. The data returned is of type PBYTE.
QUERY_SESSION_DATA_LICENSE: Retrieves data about the licensing policies associated with a given Terminal Services session. <42> <43>
QUERY_SESSION_DATA_DEVICEID: Retrieves the device ID of the client connected to a given Terminal Services session. The data returned is of type PBYTE.<44>
QUERY_SESSION_DATA_LICENSE_VALIDATION: Retrieves the data required to validate the license associated with a given Terminal Services session. The data returned is of type WINSTATIONVALIDATIONINFORMATION.<45>
27 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 152.1.1.1 PSESSIONENUM PSESSIONENUM is a pointer to a structure containing information about the sessions running on the terminal server. It is returned by RpcGetEnumResult.
153 typedef struct _SESSIONENUM {
154 DWORD Level;
155 [switch_is(Level)] SessionInfo Data;
156 } SESSIONENUM,
157 *PSESSIONENUM;
Level: The level of information contained in the Data member; the valid values are 1 and 2.
Data: Contains information at a specified level of detail about sessions running on a computer.
157.1.1.1.1 SessionInfo The SessionInfo is a union of structures, each structure providing different levels of detail about sessions running on a computer, as specified in sections 2.2.2.4.1.1 and 2.2.2.4.1.2 respectively.
158 typedef
159 [switch_type(DWORD)]
160 union _SessionInfo {
161 [case(1)]
162 SESSIONENUM_LEVEL1 SessionEnum_Level1;
163 [case(2)]
164 SESSIONENUM_LEVEL2 SessionEnum_Level2;
165 } SessionInfo,
166 *PSessionInfo;
SessionEnum_Level1: A SESSIONENUM_LEVEL1 structure containing a level of information about sessions running on a computer.
SessionEnum_Level2: A SESSIONENUM_LEVEL2 structure containing a level of information about sessions running on a computer.
166.1.1.1.1.1SESSIONENUM_LEVEL1 The SESSIONENUM_LEVEL1 structure contains basic information about sessions running on a computer.
167 typedef struct _SESSIONENUM_LEVEL1 {
168 LONG SessionId;
169 LONG State;
28 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 170 WCHAR Name[33];
171 } SESSIONENUM_LEVEL1,
172 *PSESSIONENUM_LEVEL1;
SessionId: An identifier assigned by the operating system to the session contained in this structure.
State: The state of the session, as specified in section 3.3.4.1.8.
Name: A string that contains the name of the session assigned by Terminal Services followed by the terminating NULL character.
172.1.1.1.1.1SESSIONENUM_LEVEL2 The SESSIONENUM_LEVEL2 structure contains information about sessions running on a computer that is more detailed than the information contained in SESSIONENUM_LEVEL1.
173 typedef struct _SESSIONENUM_LEVEL2 {
174 LONG SessionId;
175 LONG State;
176 WCHAR Name[33];
177 ULONG Source;
178 BOOL bFullDesktop;
179 GUID SessionType;
180 } SESSIONENUM_LEVEL2,
181 *PSESSIONENUM_LEVEL2;
SessionId: An identifier assigned by the operating system to the session contained in this structure.
State: The state of the session, as specified in section 3.3.4.1.8.
Name: A string that contains the name of the session followed by the terminating NULL character.
Source: The parameter is always set to zero. bFullDesktop: The parameter is always set to TRUE.
SessionType: Describes the type of the session.<46>
181.1.1.1.1.1SESSIONENUM_LEVEL3 The SESSIONENUM_LEVEL3 structure contains information about sessions running on a computer that is more detailed than the information contained in SESSIONENUM_LEVEL1 and SESSIONENUM_LEVEL2.
182 typedef struct _SESSIONENUM_LEVEL3 {
183 LONG SessionId;
29 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 184 LONG State;
185 WCHAR Name[33];
186 ULONG Source;
187 BOOL bFullDesktop;
188 GUID SessionType;
189 ULONG ProtoDataSize;
190 [size_is(ProtoDataSize)] UCHAR* pProtocolData;
191 } SESSIONENUM_LEVEL3,
192 *PSESSIONENUM_LEVEL3;
SessionId: An identifier assigned by the operating system to the session contained in this structure.
State: The state of the session, as specified in section 3.3.4.1.8.
Name: A string that contains the name of the session followed by the terminating NULL character.
Source: The parameter is always set to zero. bFullDesktop: The parameter is always set to TRUE.
SessionType: The parameter is always set to zero.
ProtoDataSize: Size of data, in bytes, contained in the pProtocolData member. pProtocolData: Data about the protocol status between the terminal server client and server. This data will be of type PROTOCOLSTATUSEX.
192.1.1.1 PSESSIONENUM_EX The PSESSIONENUM_EX is a pointer to a structure containing information about the sessions running on the terminal server. It is returned by RpcGetEnumResultEx.
193 typedef struct _SESSIONENUM_EX {
194 DWORD Level;
195 [switch_is(Level)] SessionInfo_Ex Data;
196 } SESSIONENUM_EX,
197 *PSESSIONENUM_EX;
Level: The level of information contained in Data; the valid values are 1, 2, and 3.
Value Meaning
1 The union SessionInfo_Ex has the SessionEnum_Level1 structure.
2 The union SessionInfo_Ex has the SessionEnum_Level2 structure.
3 The union SessionInfo_Ex has the SessionEnum_Level3 structure.
30 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 Data: Contains information at a specified level of detail about sessions running on a computer. This parameter is of type SessionInfo_Ex. If Level is set to 1, the union SessionInfo_Ex has the SessionEnum_Level1 structure. If Level is set to 2, the union SessionInfo_Ex has the SessionEnum_Level2 structure. If Level is set to 3, the union SessionInfo_Ex has the SessionEnum_Level3 structure.
197.1.1.1.1 SessionInfo_Ex The SessionInfo_Ex is a union of structures, each structure providing different levels of detail about sessions running on a computer, as specified in sections 2.2.2.4.1.1, 2.2.2.4.1.2, and 2.2.2.4.1.3 respectively.
198 typedef
199 [switch_type(DWORD)]
200 union _SessionInfo_Ex {
201 [case(1)]
202 SESSIONENUM_LEVEL1 SessionEnum_Level1;
203 [case(2)]
204 SESSIONENUM_LEVEL2 SessionEnum_Level2;
205 [case(3)]
206 SESSIONENUM_LEVEL3 SessionEnum_Level3;
207 } SessionInfo_Ex,
208 *PSessionInfo_Ex;
SessionEnum_Level1: A SESSIONENUM_LEVEL1 structure containing a level of information about sessions running on a computer.
SessionEnum_Level2: A SESSIONENUM_LEVEL2 structure containing a level of information about sessions running on a computer.
SessionEnum_Level3: A SESSIONENUM_LEVEL3 structure containing a level of information about sessions running on a computer.
208.1.1.1 PEXECENVDATA PEXECENVDATA is a pointer to a structure containing information about the sessions running on the terminal server and the sessions running on virtual machines hosted on the server.<47> It is returned by RpcGetAllSessions.
209 typedef struct _EXECENVDATA {
210 DWORD Level;
211 [switch_is(Level)] ExecEnvData Data;
212 } EXECENVDATA,
213 *PEXECENVDATA;
31 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 Level: The level of information contained in Data; the valid values are 1 and 2.
Value Meaning
1 The union ExecEnvData has the EXECENVDATA_LEVEL1 structure.
2 The union ExecEnvData has the EXECENVDATA_LEVEL2 structure.
Data: Contains information at a specified level of detail about sessions running on a computer. This is of type ExecEnvData.
213.1.1.1.1 ExecEnvData The ExecEnvData is a union of structures, each structure providing different levels of detail about sessions running on a computer and sessions running on virtual machines hosted on the server,<48> as specified in sections 2.2.2.6.1.1 and 2.2.2.6.1.2 respectively.
214 typedef
215 [switch_type(DWORD)]
216 union _ExecEnvData {
217 [case(1)]
218 EXECENVDATA_LEVEL1 ExecEnvEnum_Level1;
219 [case(2)]
220 EXECENVDATA_LEVEL2 ExecEnvEnum_Level2;
221 } ExecEnvData,
222 *PExecEnvData;
ExecEnvEnum_Level1: An EXECENVDATA_LEVEL1 structure containing a level of information about sessions running on a computer and virtual machines hosted on the computer.<49>
ExecEnvEnum_Level2: An EXECENVDATA_LEVEL2 structure containing a level of information about sessions running on a computer and virtual machines hosted on the computer.<50>
222.1.1.1.1.1EXECENVDATA_LEVEL1 The EXECENVDATA_LEVEL1 structure contains basic information about sessions running on a computer.
223 typedef struct _EXECENVDATA_LEVEL1 {
224 LONG ExecEnvId;
225 LONG State;
226 WCHAR SessionName[33];
227 } EXECENVDATA_LEVEL1,
228 *PEXECENVDATA_LEVEL1;
32 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 ExecEnvId: An identifier assigned to the session contained in this structure by the component that aggregates the sessions on the server and sessions within virtual machines hosted on the server.<51>
State: The state of the session, as specified in section 3.3.4.1.8.
SessionName: A string that contains the name of the session assigned by Terminal Services followed by the terminating NULL character.
228.1.1.1.1.1EXECENVDATA_LEVEL2 The EXECENVDATA_LEVEL2 structure contains information about sessions running on a computer that is more detailed than the information contained in EXECENVDATA_LEVEL1.
229 typedef struct _EXECENVDATA_LEVEL2 {
230 LONG ExecEnvId;
231 LONG State;
232 WCHAR SessionName[33];
233 LONG AbsSessionId;
234 WCHAR HostName[33];
235 WCHAR UserName[33];
236 WCHAR DomainName[33];
237 WCHAR FarmName[33];
238 } EXECENVDATA_LEVEL2,
239 *PEXECENVDATA_LEVEL2;
ExecEnvId: An identifier assigned to the session contained in this structure by the component that aggregates the sessions on the server and sessions within virtual machines hosted on the server.<52>
State: The state of the session, as specified in section 3.3.4.1.8.
SessionName: A string that contains the name of the session followed by the terminating NULL character.
AbsSessionId: An identifier assigned by the operating system running in the virtual machine to the session contained in this structure. If the session contained in this structure is not running under the virtual machine, the value of AbsSessionId is same as ExecEnvId.
HostName: A string that contains the name of the machine that hosts the session contained in this structure followed by the terminating NULL character.
UserName: A string that contains the name of the user logged onto the session followed by the terminating NULL character.
DomainName: A string that contains the domain of the user logged onto the session followed by the terminating NULL character.
FarmName: A string that contains the farm name associated with the session followed by the terminating NULL character.
33 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 239.1.1.1 PEXECENVDATAEX PEXECENVDATAEX is a pointer to a structure containing information about the sessions running on the terminal server and the sessions running on virtual machines hosted on the server.<53> It is returned by RpcGetAllSessionsEx.
240 typedef struct _EXECENVDATAEX {
241 DWORD Level;
242 [switch_is(Level)] ExecEnvDataEx Data;
243 } EXECENVDATAEX,
244 *PEXECENVDATAEX;
Level: The level of information contained in the Data member; the only valid value is 1.
Value Meaning
1 The union ExecEnvDataEx has the EXECENVDATAEX_LEVEL1 structure.
Data: Contains information at a specified level of detail about sessions running on a computer. This is of type ExecEnvDataEx.
244.1.1.1.1 ExecEnvDataEx ExecEnvDataEx is a union of structures that provides information about sessions running on a computer and sessions running on virtual machines hosted on the server,<54> as specified in section 2.2.2.7.1.1.
245 typedef
246 [switch_type(DWORD)]
247 union _ExecEnvDataEx {
248 [case(1)]
249 EXECENVDATAEX_LEVEL1 ExecEnvEnum_Level1;
250 } ExecEnvDataEx,
251 *PExecEnvDataEx;
ExecEnvEnum_Level1: An EXECENVDATAEX_LEVEL1 structure that contains information about sessions running on a computer and virtual machines hosted on the computer.<55>
251.1.1.1.1.1EXECENVDATAEX_LEVEL1 The EXECENVDATAEX_LEVEL1 structure contains information about sessions running on a computer.
252 typedef struct _EXECENVDATA_LEVEL1 {
253 LONG ExecEnvId;
254 LONG State;
34 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 255 LONG AbsSessionId;
256 [string, max is (256)] LPWSTR pszSessionName;
257 [string, max is (256)] LPWSTR pszHostName;
258 [string, max is (256)] LPWSTR pszUserName;
259 [string, max is (256)] LPWSTR pszDomainName;
260 [string, max is (256)] LPWSTR pszFarmName;
261 } EXECENVDATAEX_LEVEL1,
262 *PEXECENVDATAEX_LEVEL1;
ExecEnvId: An identifier assigned to the session contained in this structure by the component that aggregates the sessions on the server and sessions within virtual machines hosted on the server.
State: The state of the session, as specified in section 3.3.4.1.8.
AbsSessionId: An identifier assigned by the operating system running in the virtual machine to the session contained in this structure. If the session contained in this structure is not running under the virtual machine, the value of AbsSessionId is the same as the value of the ExecEnvId member. pszSessionName: A string that contains the name of the session followed by the terminating NULL character. pszHostName: A string that contains the name of the machine that hosts the session contained in this structure, followed by the terminating NULL character. pszUserName: A string that contains the name of the user logged onto the session followed by the terminating NULL character. pszDomainName: A string that contains the domain of the user logged onto the session followed by the terminating NULL character. pszFarmName: A string that contains the farm name associated with the session followed by the terminating NULL character.
262.1.1.1 PLSMSESSIONINFORMATION PLSMSESSIONINFORMATION is a pointer to a LSMSESSIONINFORMATION structure containing information about a session running on a terminal server.
263 typedef struct _LSMSessionInformation {
264 [string] WCHAR* pszUserName;
265 [string] WCHAR* pszDomain;
266 [string] WCHAR* pszTerminalName;
267 LONG SessionState;
268 BOOL DesktopLocked;
269 hyper ConnectTime;
35 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 270 hyper DisconnectTime;
271 hyper LogonTime;
272 } LSMSESSIONINFORMATION,
273 *PLSMSESSIONINFORMATION; pszUserName: The name of the user logged on to the session. pszDomain: The domain to which the currently logged-on user belongs. pszTerminalName: The name of the terminal associated with the specific session.
SessionState: The state of the session, as described in section 3.3.4.1.8.
DesktopLocked: Set to TRUE if the session is currently locked; FALSE otherwise.
ConnectTime: The time of the most recent connection to the session.
Time is measured as the number of 100-nanosecond intervals since January 1, 1601 (UTC).
DisconnectTime: The time of the most recent disconnection from the session.
Time is measured as the number of 100-nanosecond intervals since January 1, 1601 (UTC).
LogonTime: The time of the most recent logon to the session.
Time is measured as the number of 100-nanosecond intervals since January 1, 1601 (UTC).
273.1.1.1 PLSMSESSIONINFORMATION_EX The PLSMSESSIONINFORMATION_EX is a pointer to a LSMSESSIONINFORMATION_EX structure containing information about a session running on a terminal server and the level of detail of the information provided.
274 typedef struct _LSMSESSIONINFORMATION_EX {
275 DWORD Level;
276 [switch_is(Level)] LSM_SESSIONINFO_EX Data;
277 } LSMSESSIONINFORMATION_EX,
278 *PLSMSESSIONINFORMATION_EX;
Level: The level of detail provided about the session. This field MUST be set to 1.
Data: Information about the session. This is of type LSM_SESSIONINFO_EX.
278.1.1.1 LSM_SESSIONINFO_EX The LSM_SESSIONINFO_EX is a union of structures, each member containing a different level of information about a terminal server session.
279 typedef
36 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 280 [switch_type(DWORD)]
281 union _LSM_SESSIONINFO_EX {
282 [case(1)]
283 LSM_SESSIONINFO_EX_LEVEL1 LSM_SessionInfo_Level1;
284 } LSM_SESSIONINFO_EX,
285 *PLSM_SESSIONINFO_EX;
LSM_SessionInfo_Level1: The only supported member of the union. It contains session information of level 1. It is of type LSM_SESSIONINFO_EX_LEVEL1.
285.1.1.1 LSM_SESSIONINFO_EX_LEVEL1 The LSM_SESSIONINFO_EX_LEVEL1 is a structure containing information about a session running on a terminal server.
286 typedef struct _LSM_SESSIONINFO_EX_LEVEL1 {
287 LONG SessionState;
288 LONG SessionFlags;
289 WCHAR SessionName[33];
290 WCHAR DomainName[18];
291 WCHAR UserName[21];
292 hyper ConnectTime;
293 hyper DisconnectTime;
294 hyper LogonTime;
295 hyper LastInputTime;
296 ULONG ProtocolDataSize;
297 [size_is(ProtocolDataSize)] PBYTE ProtocolData;
298 } LSM_SESSIONINFO_EX_LEVEL1,
299 *PLSM_SESSIONINFO_EX_LEVEL1;
SessionState: The state of the session, as described in section 3.3.4.1.8.
SessionFlags: The state of the session. The SessionFlags member MUST be one of the values shown in the following table.
Value Meaning
WTS_SESSIONSTATE_UNKNOWN Unknown session state 0xFFFFFFFF
WTS_SESSIONSTATE_LOCK Session is locked
37 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 Value Meaning
0x00000000
WTS_SESSIONSTATE_UNLOCK Session is unlocked 0x00000001
SessionName: The name of the terminal associated with the specific session.
DomainName: The domain to which the currently logged-on user belongs.
UserName: The name of the user logged on to the session.
ConnectTime: The time of the most recent connection to the session.
Time is measured as the number of 100-nanosecond intervals since January 1, 1601 (UTC).
DisconnectTime: The time of the most recent disconnection from the session.
Time is measured as the number of 100-nanosecond intervals since January 1, 1601 (UTC).
LogonTime: The time of the most recent logon to the session.
Time is measured as the number of 100-nanosecond intervals since January 1, 1601 (UTC).
LastInputTime: The time the session last received input. This is an indicator of how long a session has been idle.
Time is measured as the number of 100-nanosecond intervals since January 1, 1601 (UTC).
ProtocolDataSize: Size of data, in bytes, contained in ProtocolData.
ProtocolData: Data about the protocol status between the terminal server client and server. This data is of type PROTOCOLSTATUSEX.
299.1.1.1 PLISTENERENUM PLISTENERENUM contains information about one terminal server listener and the level of detail of the information provided.
300 typedef struct _LISTENERENUM {
301 DWORD Level;
302 [switch_is(Level)] ListenerInfo Data;
303 } LISTENERENUM,
304 *PLISTENERENUM;
Level: The level of detail provided about the listener. The only supported value is 1.
Data: Information about the listener. This is of the type ListenerInfo.
304.1.1.1.1 ListenerInfo ListenerInfo is a union of structures, each member containing a different level of information about a terminal server listener.
305 typedef
306 [switch_type(DWORD)]
38 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 307 union _ListenerInfo {
308 [case(1)]
309 LISTENERENUM_LEVEL1 ListenerEnum_Level1;
310 [default] ;
311 } ListenerInfo,
312 *PListenerInfo;
ListenerEnum_Level1: The only supported member of the union. It contains listener information of level 1. It is of the type LISTENERENUM_LEVEL1.
312.1.1.1.1.1LISTENERENUM_LEVEL1 LISTENERENUM_LEVEL1 is a structure containing information of level 1 detail about a Terminal Services listener.
313 typedef struct _LISTENERENUM_LEVEL1 {
314 LONG Id;
315 BOOL bListening;
316 WCHAR Name[33];
317 } LISTENERENUM_LEVEL1,
318 *PLISTENERENUM_LEVEL1;
Id: The identifier associated with the listener. bListening: Set to TRUE if the listener is listening for incoming connections; FALSE otherwise.
Name: A string that contains the name of the listener followed by the terminating NULL character.
318.1.1.1 LOGONID LOGONID is a macro defined to be the structure SESSIONID. This type represents information about the session or WinStation identified by the identifier SessionId. For more information, see the macro definition in section 6.5.
319 typedef struct _SESSIONID {
320 union {
321 ULONG SessionId;
322 ULONG LogonId;
323 } _SessionId_LogonId_union;
324 WINSTATIONNAME WinStationName;
39 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 325 WINSTATIONSTATECLASS State;
326 } SESSIONID,
327 *PSESSIONID;
SessionId: In a union with LogonId. It represents WinStation or session identifier numbered 0 through 65535 for Terminal Services sessions. A number of 65536 or greater indicates that the WinStation is a listening WinStation.
LogonId: In a union with SessionId. It is used internally only, within Terminal Services code.
WinStationName: The name of the WinStation represented by this structure. See section 2.2.1.5 for more information on the type WINSTATIONNAME.
State: The current state of the WinStation. See section 2.2.1.9 for more information on the type WINSTATIONSTATECLASS.
327.1.1.1 TS_PROCESS_INFORMATION_NT4 The TS_PROCESS_INFORMATION_NT4 structure is returned by RpcWinStationEnumerateProcesses.
328 typedef struct _TS_PROCESS_INFORMATION_NT4 {
329 ULONG MagicNumber;
330 ULONG LogonId;
331 PVOID ProcessSid;
332 ULONG Pad;
333 } TS_PROCESS_INFORMATION_NT4,
334 *PTS_PROCESS_INFORMATION_NT4;
MagicNumber: MUST be set to TS_PROCESS_INFO_MAGIC_NT4 (0x23495452).
LogonId: The session ID of the process.
ProcessSid: The security identifier (SID), as specified in [MS-DTYP] section 2.4.2, of the owner of the process.
Pad: MUST be set to 0.
334.1.1.1 TS_ALL_PROCESSES_INFO TS_ALL_PROCESSES_INFO contains data on all the processes on the system accessible to the user who issued the call.
335 typedef struct _TS_ALL_PROCESSES_INFO {
336 PTS_SYS_PROCESS_INFORMATION pTsProcessInfo;
337 DWORD SizeOfSid;
338 #ifdef MIDL_PASS
40 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 339 [size_is(SizeOfSid)] PBYTE pSid;
340 #else
341 PBYTE pSid;
342 #endif
343 } TS_ALL_PROCESSES_INFO,
344 *PTS_ALL_PROCESSES_INFO; pTsProcessInfo: Pointer to the process information TS_SYS_PROCESS_INFORMATION.
SizeOfSid: Size of pSid, in bytes. pSid: The security identifier (SID), as specified in [MS-DTYP], of the owner of the process.
344.1.1.1.1 TS_SYS_PROCESS_INFORMATION The TS_SYS_PROCESS_INFORMATION structure contains information about a process running on a system.
345 typedef struct _TS_SYS_PROCESS_INFORMATION {
346 ULONG NextEntryOffset;
347 ULONG NumberOfThreads;
348 LARGE_INTEGER SpareLi1;
349 LARGE_INTEGER SpareLi2;
350 LARGE_INTEGER SpareLi3;
351 LARGE_INTEGER CreateTime;
352 LARGE_INTEGER UserTime;
353 LARGE_INTEGER KernelTime;
354 TS_UNICODE_STRING ImageName;
355 LONG BasePriority;
356 DWORD UniqueProcessId;
357 DWORD InheritedFromUniqueProcessId;
358 ULONG HandleCount;
359 ULONG SessionId;
360 ULONG SpareUl3;
361 SIZE_T PeakVirtualSize;
362 SIZE_T VirtualSize;
41 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 363 ULONG PageFaultCount;
364 ULONG PeakWorkingSetSize;
365 ULONG WorkingSetSize;
366 SIZE_T QuotaPeakPagedPoolUsage;
367 SIZE_T QuotaPagedPoolUsage;
368 SIZE_T QuotaPeakNonPagedPoolUsage;
369 SIZE_T QuotaNonPagedPoolUsage;
370 SIZE_T PagefileUsage;
371 SIZE_T PeakPagefileUsage;
372 SIZE_T PrivatePageCount;
373 } TS_SYS_PROCESS_INFORMATION,
374 *PTS_SYS_PROCESS_INFORMATION;
NextEntryOffset: Offset to the start of data for the next process.
NumberOfThreads: Number of threads in the process.
SpareLi1: Reserved.
SpareLi2: Reserved.
SpareLi3: Reserved.
CreateTime: Creation time of the process. Time is measured as the number of 100-nanosecond intervals since January 1, 1601 (UTC).
UserTime: Amount of time in milliseconds the process has spent running in user mode.
KernelTime: Amount of time in milliseconds the process has spent running in kernel mode.
ImageName: String containing the process's image name.
BasePriority: Base priority of the process.
UniqueProcessId: Process's unique process ID.
InheritedFromUniqueProcessId: Parent process's unique process ID.
HandleCount: Current number of handles open in the process.
SessionId: Session identifier of the process session.
SpareUl3: Reserved.
PeakVirtualSize: Peak size of virtual memory, in bytes, used by the process.
VirtualSize: Current size of virtual memory, in bytes, used by the process.
PageFaultCount: Number of page faults in the process.
PeakWorkingSetSize: Peak size of the working set in kilobytes of the process.
42 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 WorkingSetSize: Current size, in bytes, of the working set of the process.
QuotaPeakPagedPoolUsage: Peak quota charged to the process for paged pool usage.
QuotaPagedPoolUsage: Current quota charged to the process for paged pool usage.
QuotaPeakNonPagedPoolUsage: Peak quota charged to the process for nonpaged pool usage.
QuotaNonPagedPoolUsage: Current quota charged to the process for nonpaged pool usage.
PagefileUsage: Amount of bytes of page file storage in use by the process.
PeakPagefileUsage: Peak amount of bytes of page file storage in use by the process.
PrivatePageCount: Current number of memory pages allocated by the process.
374.1.1.1.1.1TS_UNICODE_STRING A Unicode string.
375 typedef struct _TS_UNICODE_STRING {
376 USHORT Length;
377 USHORT MaximumLength;
378 [size_is(MaximumLength), length_is(Length)]
379 PWSTR Buffer;
380 } TS_UNICODE_STRING;
Length: The actual length of the string currently stored in the Buffer member, in bytes.
MaximumLength: The maximum length of the string that can be stored in Buffer, in bytes.
Buffer: A wide character string that MUST NOT be followed by the terminating NULL character.
380.1.1.1 TS_ALL_PROCESSES_INFO_NT6 The TS_ALL_PROCESSES_INFO_NT6 structure contains data on all the processes on the system that are accessible using the user's credentials.
381 typedef struct _TS_ALL_PROCESSES_INFO_NT6 {
382 PTS_SYS_PROCESS_INFORMATION_NT6 pTsProcessInfo;
383 DWORD SizeOfSid;
384 [size_is(SizeOfSid)] PBYTE pSid;
385 } TS_ALL_PROCESSES_INFO_NT6,
386 *PTS_ALL_PROCESSES_INFO_NT6; pTsProcessInfo: Pointer to the process information.
SizeOfSid: Size, in bytes, of the security identifier (SID) structure pointed to by pSid. pSid: Security identifier (SID), as specified in [MS-DTYP] section 2.4.2, of the process.
43 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 386.1.1.1.1 TS_SYS_PROCESS_INFORMATION_NT6 The TS_SYS_PROCESS_INFORMATION_NT6 structure contains information about a process running on a system.
387 typedef struct _TS_SYS_PROCESS_INFORMATION_NT6 {
388 ULONG NextEntryOffset;
389 ULONG NumberOfThreads;
390 LARGE_INTEGER SpareLi1;
391 LARGE_INTEGER SpareLi2;
392 LARGE_INTEGER SpareLi3;
393 LARGE_INTEGER CreateTime;
394 LARGE_INTEGER UserTime;
395 LARGE_INTEGER KernelTime;
396 NT6_TS_UNICODE_STRING ImageName;
397 LONG BasePriority;
398 DWORD UniqueProcessId;
399 DWORD InheritedFromUniqueProcessId;
400 ULONG HandleCount;
401 ULONG SessionId;
402 ULONG SpareUl3;
403 SIZE_T PeakVirtualSize;
404 SIZE_T VirtualSize;
405 ULONG PageFaultCount;
406 ULONG PeakWorkingSetSize;
407 ULONG WorkingSetSize;
408 SIZE_T QuotaPeakPagedPoolUsage;
409 SIZE_T QuotaPagedPoolUsage;
410 SIZE_T QuotaPeakNonPagedPoolUsage;
411 SIZE_T QuotaNonPagedPoolUsage;
412 SIZE_T PagefileUsage;
413 SIZE_T PeakPagefileUsage;
414 SIZE_T PrivatePageCount;
44 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 415 } TS_SYS_PROCESS_INFORMATION_NT6,
416 *PTS_SYS_PROCESS_INFORMATION_NT6;
NextEntryOffset: Offset to the start of data for the next process.
NumberOfThreads: Number of threads in the process.
SpareLi1: Reserved.
SpareLi2: Reserved.
SpareLi3: Reserved.
CreateTime: Creation time of the process. Time is measured as the number of 100-nanosecond intervals since January 1, 1601 (UTC).
UserTime: Amount of time in milliseconds the process has spent running in user mode.
KernelTime: Amount of time in milliseconds the process has spent running in kernel mode.
ImageName: String containing the process's image name.
BasePriority: Base priority of the process, which is the starting priority for threads created within the associated process.
UniqueProcessId: Process's unique process ID.
InheritedFromUniqueProcessId: Parent process's unique process ID.
HandleCount: Current number of handles open in the process.
SessionId: Session identifier of the process session.
SpareUl3: Reserved.
PeakVirtualSize: Peak size, in bytes, of the virtual memory used by the process.
VirtualSize: Current size, in bytes, of virtual memory used by the process.
PageFaultCount: Number of page faults in the process.
PeakWorkingSetSize: Peak size, in kilobytes, of the working set of the process.
WorkingSetSize: Current size, in bytes, of the working set of the process.
QuotaPeakPagedPoolUsage: Peak quota charged to the process for paged pool usage.
QuotaPagedPoolUsage: Current quota charged to the process for paged pool usage.
QuotaPeakNonPagedPoolUsage: Peak quota charged to the process for nonpaged pool usage.
QuotaNonPagedPoolUsage: Current quota charged to the process for nonpaged pool usage.
PagefileUsage: Number of bytes of page file storage in use by the process.
PeakPagefileUsage: Peak number of bytes of page file storage in use by the process.
PrivatePageCount: Current number of memory pages allocated by the process.
416.1.1.1.1.1NT6_TS_UNICODE_STRING A Unicode string.
45 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 417 typedef struct _NT6_TS_UNICODE_STRING {
418 USHORT Length;
419 USHORT MaximumLength;
420 [size_is(MaximumLength/2), length_is(Length/2)]
421 PWSTR Buffer;
422 } NT6_TS_UNICODE_STRING;
Length: The actual length of the string currently stored in Buffer, in bytes.
MaximumLength: The maximum length of the string that could be stored in Buffer, in bytes.
Buffer: A wide character string that MUST NOT be followed by the terminating NULL character.
422.1.1.1.1 SYSTEM_THREAD_INFORMATION The SYSTEM_THREAD_INFORMATION structure contains information about a thread running on a system.
423 typedef struct {
424 LARGE_INTEGER KernelTime;
425 LARGE_INTEGER UserTime;
426 LARGE_INTEGER CreateTime;
427 ULONG WaitTime;
428 PVOID StartAddress;
429 CLIENT_ID ClientId;
430 LONG Priority;
431 LONG BasePriority;
432 ULONG ContextSwitches;
433 ULONG ThreadState;
434 ULONG WaitReason;
435 } SYSTEM_THREAD_INFORMATION,
436 *PSYSTEM_THREAD_INFORMATION;
KernelTime: Number of 100-nanosecond intervals spent executing kernel code.
UserTime: Number of 100-nanosecond intervals spent executing user code.
CreateTime: System time when the thread was created.
WaitTime: Time spent in ready queue or waiting (depending on the thread state).
46 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 StartAddress: Start address of the thread.
ClientId: ID of the thread and the process owning the thread.
Priority: Dynamic thread priority.
BasePriority: Base thread priority.
ContextSwitches: Total context switches.
ThreadState: Current thread state.
WaitReason: The reason the thread is waiting.
436.1.1.1.1.1CLIENT_ID The CLIENT_ID structure contains identifiers of a process and a thread.
437 typedef struct {
438 HANDLE UniqueProcess;
439 HANDLE UniqueThread;
440 } CLIENT_ID;
UniqueProcess: Unique process identifier.
UniqueThread: Unique thread identifier.
440.1.1.1 TS_COUNTER A Terminal Services performance counter structure used to represent a single performance counter.
441 typedef struct _TS_COUNTER {
442 TS_COUNTER_HEADER counterHead;
443 DWORD dwValue;
444 LARGE_INTEGER startTime;
445 } TS_COUNTER,
446 *PTS_COUNTER; counterHead: A header identifying the counter. dwValue: The value of the counter. This indicates different things based on the counter. startTime: Always set to zero because time stamps are not supported.
446.1.1.1.1 TS_COUNTER_HEADER The header of the Terminal Services performance counter structure providing general information on the counter.
447 typedef struct _TS_COUNTER_HEADER {
448 DWORD dwCounterID;
47 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 449 BOOLEAN bResult;
450 } TS_COUNTER_HEADER,
451 *PTS_COUNTER_HEADER; dwCounterID: The identifier of the counter. Set by the caller of RpcWinStationGetTermSrvCountersValue to indicate the counter on which to retrieve data. This will be set to zero by RpcWinStationGetTermSrvCountersValue if the dwCounterId isn't recognized.
The following values for dwCounterId are supported.
Value Meaning
TERMSRV_TOTAL_SESSIONS Total number of sessions: Value will indicate the total 0x01 number of reconnections to the server since startup.
TERMSRV_DISC_SESSIONS Number of disconnected sessions: Value will indicate 0x02 the total number of disconnections from the server since startup.
TERMSRV_RECON_SESSIONS Number of reconnected sessions: Value will indicate 0x03 the total number of all reconnected sessions that have existed on the server since startup.
TERMSRV_CURRENT_ACTIVE_SESSIONS Current number of active sessions: Value will indicate 0x04 the current number of active sessions on the server.
TERMSRV_CURRENT_DISC_SESSIONS Current number of disconnected sessions: Value will 0x05 indicate the current number of disconnected sessions on the server.
TERMSRV_PENDING_SESSIONS Current number of pending sessions: Value will 0x06 indicate the current number of pending connections to the server.<56>
TERMSRV_SUCC_TOTAL_LOGONS Total number of successful logons: Value will indicate 0x07 the total number of successful logons on the server, both locally and remotely.<57>
TERMSRV_SUCC_LOCAL_LOGONS Total number of successful local logons: Value will 0x08 indicate the total number of successful local logons on the server.<58>
TERMSRV_SUCC_REMOTE_LOGONS Total number of successful remote logons: Value will 0x09 indicate the total number of successful remote logons on the server.<59>
TERMSRV_SUCC_SESSION0_LOGONS Total number of successful session 0 logons: Value 0x0A will indicate the total number of successful connects on the server to session 0.<60>
TERMSRV_CURRENT_TERMINATING_SESSIONS Number of terminating sessions: Value will indicate 0x0B the current number of terminating sessions on the server.<61>
TERMSRV_CURRENT_LOGGEDON_SESSIONS Number of logged on sessions: Value will indicate the 0x0C current number of logged-on sessions on the server.<62> bResult: Set to TRUE if counter information is returned. Set to FALSE if counter data isn't being returned because the counter ID being requested was unrecognized.
48 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 451.1.1.1 USERCONFIG For a specific terminal server session, USERCONFIG indicates the user and session configuration.
452 typedef struct _USERCONFIG {
453 ULONG fInheritAutoLogon :1;
454 ULONG fInheritResetBroken :1;
455 ULONG fInheritReconnectSame :1;
456 ULONG fInheritInitialProgram :1;
457 ULONG fInheritCallback :1;
458 ULONG fInheritCallbackNumber :1;
459 ULONG fInheritShadow :1;
460 ULONG fInheritMaxSessionTime :1;
461 ULONG fInheritMaxDisconnectionTime :1;
462 ULONG fInheritMaxIdleTime :1;
463 ULONG fInheritAutoClient :1;
464 ULONG fInheritSecurity :1;
465 ULONG fPromptForPassword :1;
466 ULONG fResetBroken :1;
467 ULONG fReconnectSame :1;
468 ULONG fLogonDisabled :1;
469 ULONG fWallPaperDisabled :1;
470 ULONG fAutoClientDrives :1;
471 ULONG fAutoClientLpts :1;
472 ULONG fForceClientLptDef :1;
473 ULONG fRequireEncryption :1;
474 ULONG fDisableEncryption :1;
475 ULONG fUnused1 :1;
476 ULONG fHomeDirectoryMapRoot :1;
477 ULONG fUseDefaultGina :1;
478 ULONG fCursorBlinkDisabled :1;
479 ULONG fPublishedApp :1;
49 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 480 ULONG fHideTitleBar :1;
481 ULONG fMaximize :1;
482 ULONG fDisableCpm :1;
483 ULONG fDisableCdm :1;
484 ULONG fDisableCcm :1;
485 ULONG fDisableLPT :1;
486 ULONG fDisableClip :1;
487 ULONG fDisableExe :1;
488 ULONG fDisableCam :1;
489 ULONG fDisableAutoReconnect :1;
490 ULONG ColorDepth :3;
491 ULONG fInheritColorDepth :1;
492 ULONG fErrorInvalidProfile :1;
493 ULONG fPasswordIsScPin :1;
494 ULONG fDisablePNPRedir :1;
495 WCHAR UserName[USERNAME_LENGTH + 1];
496 WCHAR Domain[DOMAIN_LENGTH + 1];
497 WCHAR Password[PASSWORD_LENGTH + 1];
498 WCHAR WorkDirectory[DIRECTORY_LENGTH + 1];
499 WCHAR InitialProgram[INITIALPROGRAM_LENGTH + 1];
500 WCHAR CallbackNumber[CALLBACK_LENGTH + 1];
501 CALLBACKCLASS Callback;
502 SHADOWCLASS Shadow;
503 ULONG MaxConnectionTime;
504 ULONG MaxDisconnectionTime;
505 ULONG MaxIdleTime;
506 ULONG KeyboardLayout;
507 BYTE MinEncryptionLevel;
508 WCHAR NWLogonServer[NASIFILESERVER_LENGTH + 1];
50 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 509 APPLICATIONNAME PublishedName;
510 WCHAR WFProfilePath[DIRECTORY_LENGTH + 1];
511 WCHAR WFHomeDir[DIRECTORY_LENGTH + 1];
512 WCHAR WFHomeDirDrive[4];
513 } USERCONFIG,
514 *PUSERCONFIG; fInheritAutoLogon: The prompt for the password setting. TRUE indicates the use of client-specified autologon settings, FALSE specifies the use of machine autologon settings. fInheritResetBroken: Reset the session when the connection is broken. TRUE indicates the value to use for fResetBroken from the user properties if the machine/user policy is not set, FALSE otherwise. fInheritReconnectSame: Reconnect from the same client setting. TRUE indicates the value to use for fReconnectSame from the user properties if the machine/user policy is not set, FALSE otherwise. fInheritInitialProgram: The initial program setting. TRUE indicates the value to use for InitialProgram from the user properties if the machine/user policy is not set, FALSE otherwise. fInheritCallback: The callback setting. TRUE indicates the value to use for Callback from the user properties if the machine/user policy is not set, FALSE otherwise.<63> fInheritCallbackNumber: The callback number setting. TRUE indicates the value to use for CallbackNumber from the user properties if the machine/user policy is not set, FALSE otherwise.<64> fInheritShadow: The shadow setting. TRUE indicates the value to use for Shadow from the user properties if the machine/user policy is not set, FALSE otherwise. fInheritMaxSessionTime: The maximum allowed session connection time setting. TRUE indicates the value to use for MaxSessionTime from the user properties if the machine/user policy is not set, FALSE otherwise. fInheritMaxDisconnectionTime: The maximum allowed session disconnect time setting. TRUE indicates the value to use for MaxDisconnectionTime from the user properties if the machine/user policy is not set, FALSE otherwise. fInheritMaxIdleTime: The maximum allowed session idle time. TRUE indicates the value to use for MaxIdleTime from the user properties if the machine/user policy is not set, FALSE otherwise. fInheritAutoClient: The auto client setting. TRUE indicates the value to use for fAutoClientDrivers and fAutoClientLpts from the user properties if the machine/user policy is not set, FALSE otherwise. fInheritSecurity: Inherit security setting. TRUE indicates the use of security settings from the user properties if the machine/user policy is not set, FALSE otherwise. fPromptForPassword: Set to TRUE to ignore the credential sent from the client and always prompt for a password, FALSE otherwise. fResetBroken: Set to TRUE to log off the session when the idle timers for the session expire. Otherwise, the session will be disconnected when the timer expires. fReconnectSame: FALSE indicates that the user can reconnect from any client computer to a disconnected session.
51 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 TRUE indicates that the user must reconnect to a disconnected session from the same client computer that initially established the disconnected session. Logging on from a different client computer will lead to a new terminal server session being created. fLogonDisabled: TRUE indicates that a user cannot log on to a session remotely, FALSE otherwise.<65> fWallPaperDisabled: TRUE indicates display of the desktop wallpaper in the session has been disabled, FALSE otherwise. fAutoClientDrives: TRUE specifies to automatically redirect local drives on the client so they are accessible to the user in the remote terminal server session, FALSE otherwise. fAutoClientLpts: TRUE specifies to automatically redirect printers on the client so they are accessible to the user in the remote terminal server session, FALSE otherwise. fForceClientLptDef: TRUE indicates to force the client's redirected printer to be the default printer for the user, FALSE otherwise. fRequireEncryption: TRUE indicates the connection must be encrypted, FALSE otherwise. fDisableEncryption: TRUE indicates the connection does not need encryption, FALSE otherwise. fUnused1: Not used. fHomeDirectoryMapRoot: Not used. fUseDefaultGina: TRUE indicates to override a third-party GINA so that only the default GINA is used for the terminal server session, FALSE otherwise.<66> fCursorBlinkDisabled: TRUE indicates disable the blinking of the mouse cursor, FALSE otherwise.<67> fPublishedApp: Not used. fHideTitleBar: Not used. fMaximize: Not used. fDisableCpm: TRUE indicates disable client printer redirection, FALSE otherwise. fDisableCdm: TRUE indicates disable client drive redirection, FALSE otherwise. fDisableCcm: TRUE indicates disable client COM port redirection, FALSE otherwise. fDisableLPT: TRUE indicates disable client printer (LPT) port redirection, FALSE otherwise. fDisableClip: TRUE indicates disable client clipboard redirection, FALSE otherwise. fDisableExe: TRUE indicates disable .exe file execution, FALSE otherwise. fDisableCam: TRUE indicates disable client audio redirection, FALSE otherwise. fDisableAutoReconnect: TRUE indicates disable auto-reconnect functionality, FALSE otherwise.<68>
ColorDepth: The color depth of the session.<69> fInheritColorDepth: Set to TRUE to inherit color depth from the user or client configuration, FALSE otherwise.<70> fErrorInvalidProfile: Set to TRUE if WFProfilePath, WFHomeDir, or WFHomeDirDrive is invalid (too long), FALSE otherwise.<71> fPasswordIsScPin: Set to TRUE if the password field contains a smart card PIN.<72> fDisablePNPRedir: Set to TRUE if Plug and Play (PnP) redirection is disabled, FALSE otherwise.
52 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 UserName: The user name used in autologon scenarios.
Domain: The domain name used in autologon scenarios.
Password: The password used in autologon scenarios.
WorkDirectory: The work directory for the initial program.
InitialProgram: The program to run instead of the default.<73>
CallbackNumber: The telephone number that will be returned by the Terminal Services server to the client when the server is unable to complete the connection request from the client. The user on the client side can use this number to call back for technical support.<74>
Callback: The callback class for callback operations.<75>
Shadow: The shadow setting of the session.
MaxConnectionTime: The maximum allowed session connection time setting of the session in milliseconds. The session will disconnect/logoff once the limit is reached.
MaxDisconnectionTime: The maximum allowed session disconnect time of the session in milliseconds. The session will logoff once the limit is reached.
MaxIdleTime: The maximum allowed session idle time setting of the session in milliseconds. The session will disconnect/logoff once the limit is reached.
KeyboardLayout: The keyboard layout (HKL) of the session.
MinEncryptionLevel: The minimum allowed encryption level. Possible numeric values for this parameter include 1 (Low), 2 (Client Compatible), 3 (High), and 4 (FIPS). Detailed description of these encryption levels is included in [MS-RDPBCGR] sections 5.3.1 and 5.4.1.
NWLogonServer: The NetWare logon server name.<76>
PublishedName: Not used.
WFProfilePath: The terminal server profile path. Overrides the standard profile path.
WFHomeDir: The terminal server home directory path. Overrides the standard home directory.
WFHomeDirDrive: The terminal server home directory drive. Overrides the standard home directory.
514.1.1.1.1 CALLBACKCLASS The class used for callback options to indicate the type of callback.<77>
515 typedef enum _CALLBACKCLASS
516 {
517 Callback_Disable,
518 Callback_Roving,
519 Callback_Fixed
520 } CALLBACKCLASS;
Callback_Disable: Callback is disabled.
Callback_Roving: The callback number is a roving number.
Callback_Fixed: The callback number is a fixed number.
53 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 520.1.1.1.1 APPLICATIONNAME This data type represents an application name.
521 typedef WCHAR APPLICATIONNAME[MAX_BR_NAME];
522 typedef WCHAR* PAPPLICATIONNAME;
522.1.1.1 WINSTATIONCLIENT The WINSTATIONCLIENT structure defines the client-requested configuration when connecting to a session.
523 typedef struct _WINSTATIONCLIENT {
524 ULONG fTextOnly :1;
525 ULONG fDisableCtrlAltDel :1;
526 ULONG fMouse :1;
527 ULONG fDoubleClickDetect :1;
528 ULONG fINetClient :1;
529 ULONG fPromptForPassword :1;
530 ULONG fMaximizeShell :1;
531 ULONG fEnableWindowsKey :1;
532 ULONG fRemoteConsoleAudio :1;
533 ULONG fPasswordIsScPin :1;
534 ULONG fNoAudioPlayback :1;
535 ULONG fUsingSavedCreds :1;
536 ULONG fRestrictedLogon :1;
537 WCHAR ClientName[CLIENTNAME_LENGTH + 1 ];
538 WCHAR Domain[DOMAIN_LENGTH + 1 ];
539 WCHAR UserName[USERNAME_LENGTH + 1 ];
540 WCHAR Password[PASSWORD_LENGTH + 1 ];
541 WCHAR WorkDirectory[DIRECTORY_LENGTH + 1 ];
542 WCHAR InitialProgram[INITIALPROGRAM_LENGTH + 1 ];
543 ULONG SerialNumber;
544 BYTE EncryptionLevel;
545 ULONG ClientAddressFamily;
546 WCHAR ClientAddress[CLIENTADDRESS_LENGTH + 1 ];
54 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 547 USHORT HRes;
548 USHORT VRes;
549 USHORT ColorDepth;
550 USHORT ProtocolType;
551 ULONG KeyboardLayout;
552 ULONG KeyboardType;
553 ULONG KeyboardSubType;
554 ULONG KeyboardFunctionKey;
555 WCHAR imeFileName[IMEFILENAME_LENGTH + 1 ];
556 WCHAR ClientDirectory[DIRECTORY_LENGTH + 1 ];
557 WCHAR ClientLicense[CLIENTLICENSE_LENGTH + 1 ];
558 WCHAR ClientModem[CLIENTMODEM_LENGTH + 1 ];
559 ULONG ClientBuildNumber;
560 ULONG ClientHardwareId;
561 USHORT ClientProductId;
562 USHORT OutBufCountHost;
563 USHORT OutBufCountClient;
564 USHORT OutBufLength;
565 WCHAR AudioDriverName[9];
566 TS_TIME_ZONE_INFORMATION ClientTimeZone;
567 ULONG ClientSessionId;
568 WCHAR clientDigProductId[CLIENT_PRODUCT_ID_LENGTH];
569 ULONG PerformanceFlags;
570 ULONG ActiveInputLocale;
571 } WINSTATIONCLIENT,
572 *PWINSTATIONCLIENT; fTextOnly: Text-only client session. This is always FALSE. fDisableCtrlAltDel: Set to TRUE to specify that CTRL+ALT+DEL is disabled. fMouse: TRUE indicates the mouse is connected to the client, FALSE otherwise. fDoubleClickDetect: Double-click the detect flag. TRUE indicates detect double-click, FALSE otherwise.
55 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 fINetClient: Always set to FALSE. fPromptForPassword: TRUE indicates the user will always be prompted for a password, even if the password is saved from previous connection; FALSE otherwise. fMaximizeShell: TRUE indicates maximize the shell, FALSE otherwise. fEnableWindowsKey: TRUE indicates that the Windows key (E0_5B) is enabled in the terminal server session. FALSE indicates that it is disabled. fRemoteConsoleAudio: Set to TRUE if audio for the console session is left remotely at the server, FALSE otherwise.<78> fPasswordIsScPin: Set to TRUE if the password field contains a smart card PIN, FALSE otherwise.<79> fNoAudioPlayback: Set to TRUE to disable audio playback, or FALSE to enable audio playback.<80> fUsingSavedCreds: Set to TRUE if the terminal server connection was made using a credential saved on the client computer, FALSE otherwise. fRestrictedLogon: Set to TRUE if the client is running in Restricted Administration mode, FALSE otherwise. In Restricted Administration mode, user credentials are not sent to the server, which can protect the user if the server has been compromised.<81>
ClientName: The name of the client computer.
Domain: The user's domain name.
UserName: The user's user name.
Password: The user's password.
WorkDirectory: The work directory for the initial program.
InitialProgram: The program to run instead of the default.<82>
SerialNumber: The client computer's unique serial number.
EncryptionLevel: The encryption level.
ClientAddressFamily: The address family of the client's address.<83>
ClientAddress: The client's address. The format depends on the value of ClientAddressFamily. See [MSDN-SOCKET] for more information.
HRes: The horizontal resolution, in pixels.
VRes: The vertical resolution, in pixels.
ColorDepth: The color depth. <84>
ProtocolType: The type of protocol.<85>
KeyboardLayout: The keyboard layout (HKL).
KeyboardType: The keyboard type.
KeyboardSubType: The keyboard subtype.
KeyboardFunctionKey: The number of keyboard function keys. imeFileName: The file name of the input method editor (IME), if any, used for the session. For more information on IMEs, see [MSFT-IME].
ClientDirectory: The directory in which the client was installed.
56 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 ClientLicense: The client's license.<86>
ClientModem: The client's modem.<87>
ClientBuildNumber: The client's build number.
ClientHardwareId: The client-specific hardware identifier.
ClientProductId: The client-specific product identifier.
OutBufCountHost: The number of output buffers on the host computer.
OutBufCountClient: The number of output buffers on the client computer.
OutBufLength: The length of the output buffer, in bytes.
AudioDriverName: The audio driver's name.
ClientTimeZone: The client's time zone.<88>
ClientSessionId: The client's session ID.<89> clientDigProductId: The client-specific product ID.<90>
PerformanceFlags: Protocol-specific performance flags.<91> It MUST be any bitwise OR combination of the following except TS_PERF_DISABLE_NOTHING.
Value Meaning
TS_PERF_DISABLE_NOTHING Disable nothing. 0x00000000
TS_PERF_DISABLE_WALLPAPER Disable wallpaper. 0x00000001
TS_PERF_DISABLE_FULLWINDOWDRAG Disable full window drag animation. 0x00000002
TS_PERF_DISABLE_MENUANIMATIONS Disable menu animations. 0x00000004
TS_PERF_DISABLE_THEMING Disable themes. 0x00000008
TS_PERF_ENABLE_ENHANCED_GRAPHICS Enable enhanced graphics. 0x00000010
TS_PERF_DISABLE_CURSOR_SHADOW Disable cursor shadow. 0x00000020
TS_PERF_DISABLE_CURSORSETTINGS Disable cursor settings. 0x00000040
TS_PERF_ENABLE_FONT_SMOOTHING Enable font smoothing.<92> 0x00000080
TS_PERF_ENABLE_DESKTOP_COMPOSITION Enable desktop composition.<93> 0x00000100
TS_PERF_DEFAULT_NONPERFCLIENT_SETTING Reserved and used internally by the client. 0x40000000
TS_PERF_RESERVED1 Reserved and used internally by the client. 0x80000000
ActiveInputLocale: Client language locale HKL.<94>
57 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 For information about keyboard functions and handling, see [MSFT-W2KDDK].
572.1.1.1.1 TS_TIME_ZONE_INFORMATION The TS_TIME_ZONE_INFORMATION structure contains client time zone information.
573 typedef struct _TS_TIME_ZONE_INFORMATION {
574 LONG Bias;
575 WCHAR StandardName[32 ];
576 TS_SYSTEMTIME StandardDate;
577 LONG StandardBias;
578 WCHAR DaylightName[32 ];
579 TS_SYSTEMTIME DaylightDate;
580 LONG DaylightBias;
581 } TS_TIME_ZONE_INFORMATION;
Bias: A 32-bit integer. Current bias for local time translation on the client, in minutes. The bias is the difference, in minutes, between Coordinated Universal Time (UTC) and local time. All translations between UTC and local time are based on the following formula:
UTC = local time + bias
StandardName: A description for standard time on the client. For example, this field could contain the string "Pacific Standard Time" to indicate Pacific Standard Time. An array of 32 Unicode characters.
StandardDate: A TS_SYSTEMTIME structure that contains the date and local time when the transition from daylight saving time to standard time occurs on the client. If this field is specified, the DaylightDate field is also specified.
StandardBias: A 32-bit integer that defines the bias value in number of minutes to be used during local time translations that occur during standard time. This field SHOULD be ignored if a value is not supplied in the StandardDate field. This value is added to the value of the Bias field to form the bias used during standard time. In most time zones, the value of this field is 0.
DaylightName: An array of 32 Unicode characters that describes daylight time on the client. For example, this field could contain "Pacific Daylight Time" to indicate Pacific Daylight Time.
DaylightDate: A TS_SYSTEMTIME that contains a date and local time when the transition from standard time to daylight saving time occurs on the client. If this field is specified, the StandardDate field is also specified.
DaylightBias: A 32-bit integer that defines the bias value to be used during local time translations that occur during daylight saving time. This field SHOULD be ignored if a value for the DaylightDate field is not supplied. This value is added to the value of the Bias field to form the bias used during daylight saving time. In most time zones, the value of this field is 60.
581.1.1.1.1.1TS_SYSTEMTIME Information about a time zone. This structure is identical to the structure SYSTEMTIME. For more information, see [MSDN-SYSTIME].
582 typedef struct _TS_SYSTEMTIME {
58 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 583 USHORT wYear;
584 USHORT wMonth;
585 USHORT wDayOfWeek;
586 USHORT wDay;
587 USHORT wHour;
588 USHORT wMinute;
589 USHORT wSecond;
590 USHORT wMilliseconds;
591 } TS_SYSTEMTIME; wYear: The year when transition from daylight saving time to standard time occurs (1601 to 30827). wMonth: The month when transition from daylight saving time to standard time occurs.
This member can be one of the following values.
Value Meaning
1 January
2 February
3 March
4 April
5 May
6 June
7 July
8 August
9 September
10 October
11 November
12 December wDayOfWeek: The day of the week when the transition from daylight saving time to standard time occurs.
This member can be one of the following values.
Value Meaning
0 Sunday
1 Monday
2 Tuesday
3 Wednesday
4 Thursday
5 Friday
59 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 Value Meaning
6 Saturday wDay: The occurrence of wDayOfWeek within the month when the transition from daylight saving time to standard time takes place.
This member can be one of the following values.
Value Meaning
1 First occurrence of wDayOfWeek
2 Second occurrence of wDayOfWeek
3 Third occurrence of wDayOfWeek
4 Fourth occurrence of wDayOfWeek
5 Last occurrence of wDayOfWeek wHour: The hour when transition from daylight saving time to standard time occurs (0 to 23). wMinute: The minute when transition from daylight saving time to standard time occurs (0 to 59). wSecond: The second when transition from daylight saving time to standard time occurs (0 to 59). wMilliseconds: The millisecond when transition from daylight saving time to standard time occurs (0 to 999).
591.1.1.1 WINSTATIONINFORMATION Provides the current values of various properties such as state, connect time, last input time, and so on, for a session.
592 typedef struct _WINSTATIONINFORMATION {
593 WINSTATIONSTATECLASS ConnectState;
594 WINSTATIONNAME WinStationName;
595 ULONG LogonId;
596 LARGE_INTEGER ConnectTime;
597 LARGE_INTEGER DisconnectTime;
598 LARGE_INTEGER LastInputTime;
599 LARGE_INTEGER LogonTime;
600 PROTOCOLSTATUS Status;
601 WCHAR Domain[DOMAIN_LENGTH + 1];
602 WCHAR UserName[USERNAME_LENGTH + 1];
603 LARGE_INTEGER CurrentTime;
604 } WINSTATIONINFORMATION,
605 *PWINSTATIONINFORMATION;
60 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 ConnectState: The current connect state of the session.
WinStationName: The name of the session.
LogonId: The session identifier of the session.
ConnectTime: The time of the most recent connection to the session. This is a 64-bit value representing the number of 100-nanosecond intervals since January 1, 1601 (UTC).
DisconnectTime: The time of the most recent disconnection from the session. This is a 64-bit value representing the number of 100-nanosecond intervals since January 1, 1601 (UTC).
LastInputTime: The time the session last received input. This is an indicator of how long a session has been idle. This is a 64-bit value representing the number of 100-nanosecond intervals since January 1, 1601 (UTC).
LogonTime: The time of the logon to the session. This is a 64-bit value representing the number of 100-nanosecond intervals since January 1, 1601 (UTC).
Status: The status of the protocol, as specified in section 2.2.2.20.1.
Domain: The user's domain name.
UserName: The user's user name.
CurrentTime: The current time in the session. This is a 64-bit value representing the number of 100- nanosecond intervals since January 1, 1601 (UTC).
605.1.1.1.1 PROTOCOLSTATUS The status of the protocol used by the session.
606 typedef struct _PROTOCOLSTATUS {
607 PROTOCOLCOUNTERS Output;
608 PROTOCOLCOUNTERS Input;
609 CACHE_STATISTICS Cache;
610 ULONG AsyncSignal;
611 ULONG AsyncSignalMask;
612 } PROTOCOLSTATUS,
613 *PPROTOCOLSTATUS;
Output: A PROTOCOLCOUNTERS structure containing the output protocol counters.
Input: A PROTOCOLCOUNTERS structure containing the input protocol counters.
Cache: A CACHE_STATISTICS structure containing statistics for the cache.
AsyncSignal: Indicator of async signal, such as MS_CTS_ON, for async protocols. For more information on asynchronous protocols, see [MSDN-SERIAL].
AsyncSignalMask: Mask of async signal events, such as EV_CTS, for async protocols. For more information on asynchronous protocols, see [MSDN-SERIAL].
613.1.1.1.1.1PROTOCOLSTATUSEX
61 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 The PROTOCOLSTATUSEX structure defines the extended status of the protocol used by the session.
614 typedef struct {
615 PROTOCOLSTATUS ProtocolStatus;
616 LARGE_INTEGER Counters[MAX_COUNTER_EXTENSIONS];
617 } PROTOCOLSTATUSEX,
618 *PPROTOCOLSTATUSEX;
ProtocolStatus: The status of the protocol as described in section 2.2.2.20.1.
Counters: The value of the various counters associated with the protocol as specified in PROTOCOLCOUNTERS.
618.1.1.1.1.1PROTOCOLCOUNTERS Protocol performance counters.
619 typedef struct _PROTOCOLCOUNTERS {
620 ULONG WdBytes;
621 ULONG WdFrames;
622 ULONG WaitForOutBuf;
623 ULONG Frames;
624 ULONG Bytes;
625 ULONG CompressedBytes;
626 ULONG CompressFlushes;
627 ULONG Errors;
628 ULONG Timeouts;
629 ULONG AsyncFramingError;
630 ULONG AsyncOverrunError;
631 ULONG AsyncOverflowError;
632 ULONG AsyncParityError;
633 ULONG TdErrors;
634 USHORT ProtocolType;
635 USHORT Length;
636 union {
637 TSHARE_COUNTERS TShareCounters;
62 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 638 ULONG Reserved[100];
639 } Specific;
640 } PROTOCOLCOUNTERS,
641 *PPROTOCOLCOUNTERS;
WdBytes: WinStation driver number of bytes sent and received.
WdFrames: WinStation driver number of frames sent and received.
WaitForOutBuf: The number of times waited for an output buffer to become available.
Frames: Transport driver number of frames.
Bytes: Transport driver number of bytes.
CompressedBytes: Number of compressed bytes.
CompressFlushes: Number of compress flushes. A compress flush occurs when compression for a packet fails and the original uncompressed packet replaces it.
Errors: Number of packets that were in error during the session.
Timeouts: Number of time-outs.
AsyncFramingError: Number of async framing errors.
AsyncOverrunError: Number of async overrun errors.
AsyncOverflowError: Number of async overflow errors.
AsyncParityError: Number of async parity errors.
TdErrors: Number of transport protocol errors.
ProtocolType: Protocol type.
Length: Length of data in the protocol-specific area. Can be up to 100 * sizeof(ULONG) in size.
Specific: Specifies which types of counters are to be queried. It can be one of the following:
TShareCounters: Protocol performance counters.
Reserved: Reserved for future use.
641.1.1.1.1.1.1 TSHARE_COUNTERS TSHARE_COUNTERS is not used.
642 typedef struct _TSHARE_COUNTERS {
643 ULONG Reserved;
644 } TSHARE_COUNTERS,
645 *PTSHARE_COUNTERS;
Reserved: This value is not used.
63 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 645.1.1.1.1.1CACHE_STATISTICS Cache statistics on the protocol.
646 typedef struct CACHE_STATISTICS {
647 USHORT ProtocolType;
648 USHORT Length;
649 union {
650 RESERVED_CACHE ReservedCacheStats;
651 TSHARE_CACHE TShareCacheStats;
652 ULONG Reserved[20];
653 } Specific;
654 } CACHE_STATISTICS,
655 *PCACHE_STATISTICS;
ProtocolType: Protocol type.
Length: Length of data in the protocol-specific area. Can be up to 20 * sizeof(ULONG) in size.
Specific: The union of the following members:
ReservedCacheStats: Not used.
TShareCacheStats: Protocol cache statistics.
Reserved: Reserved for future use.
655.1.1.1.1.1.1 RESERVED_CACHE Cache statistics.<95>
656 typedef struct _RESERVED_CACHE {
657 THINWIRECACHE ThinWireCache[MAX_THINWIRECACHE ];
658 } RESERVED_CACHE,
659 *PRESERVED_CACHE;
ThinWireCache: The ThinWireCache structure used for the terminal server's display for RESERVED_CACHE.
659.1.1.1.1.1.1.1 THINWIRECACHE The ThinWireCache structure used for the terminal server's display for RESERVED_CACHE.
660 typedef struct _THINWIRECACHE {
661 ULONG CacheReads;
662 ULONG CacheHits;
64 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 663 } THINWIRECACHE,
664 *PTHINWIRECACHE;
CacheReads: Number of cache reads.
CacheHits: Number of cache hits.
664.1.1.1.1.1.1 TSHARE_CACHE TSHARE_CACHE is not used.
665 typedef struct _TSHARE_CACHE {
666 ULONG Reserved;
667 } TSHARE_CACHE,
668 *PTSHARE_CACHE;
Reserved: This value is not used.
668.1.1.1 PDPARAMS The protocol driver parameters structure. The core Terminal Services binaries only read this data from the system data store and pass it to callers of RpcWinStationQueryInformation and other places. The core Terminal Services binaries do not process this data in any way before returning it to callers. The actual use of this configuration data is in lower-level protocol drivers.
669 typedef struct _PDPARAMS {
670 SDCLASS SdClass;
671 union {
672 NETWORKCONFIG Network;
673 ASYNCCONFIG Async;
674 NASICONFIG Nasi;
675 OEMTDCONFIG OemTd;
676 };
677 } PDPARAMS,
678 *PPDPARAMS;
SdClass: Stack driver class. Indicates which one of the union's structures is valid.
Network: Configuration of network drivers. Used if SdClass is SdNetwork.
Async: Configuration of async (modem) driver. Used if SdClass is SdAsync.<96>
Nasi: Reserved.
65 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 OemTd: Configuration of OEM transport driver. Used if SdClass is SdOemTransport.<97>
678.1.1.1 NETWORKCONFIG The network protocol driver's configuration structure. The following block determines NETWORKCONFIG.
679 typedef struct _NETWORKCONFIG {
680 LONG LanAdapter;
681 DEVICENAME NetworkName;
682 ULONG Flags;
683 } NETWORKCONFIG,
684 *PNETWORKCONFIG;
LanAdapter: The LANA ID of the network adapter.
NetworkName: Not used.
Flags: Not used.
684.1.1.1 ASYNCCONFIG The asynchronous protocol driver's configuration structure.
685 typedef struct _ASYNCCONFIG {
686 DEVICENAME DeviceName;
687 MODEMNAME ModemName;
688 ULONG BaudRate;
689 ULONG Parity;
690 ULONG StopBits;
691 ULONG ByteSize;
692 ULONG fEnableDsrSensitivity :1;
693 ULONG fConnectionDriver :1;
694 FLOWCONTROLCONFIG FlowControl;
695 CONNECTCONFIG Connect;
696 } ASYNCCONFIG,
697 *PASYNCCONFIG;
DeviceName: The device's name.
ModemName: The modem's name.
BaudRate: The baud rate of the modem.
66 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 Parity: The parity setting.
StopBits: The number of stop bits.
ByteSize: The size of a byte. fEnableDsrSensitivity: TRUE indicates enable Data Set Ready (DSR) sensitivity, FALSE otherwise. fConnectionDriver: Set to TRUE if there is a connection driver, FALSE otherwise.
FlowControl: The flow control setting of the modem.
Connect: The connect configuration.
697.1.1.1.1 MODEMNAME The name of a modem.
698 typedef WCHAR MODEMNAME[MODEMNAME_LENGTH + 1];
699 typedef WCHAR* PMODEMNAME;
699.1.1.1.1 FLOWCONTROLCONFIG Flow control configuration of an async driver.
700 typedef struct _FLOWCONTROLCONFIG {
701 ULONG fEnableSoftwareTx :1;
702 ULONG fEnableSoftwareRx :1;
703 ULONG fEnableDTR :1;
704 ULONG fEnableRTS :1;
705 CHAR XonChar;
706 CHAR XoffChar;
707 FLOWCONTROLCLASS Type;
708 RECEIVEFLOWCONTROLCLASS HardwareReceive;
709 TRANSMITFLOWCONTROLCLASS HardwareTransmit;
710 } FLOWCONTROLCONFIG,
711 *PFLOWCONTROLCONFIG; fEnableSoftwareTx: TRUE indicates software transmit flow control, FALSE otherwise. fEnableSoftwareRx: TRUE indicates software receive flow control, FALSE otherwise. fEnableDTR: TRUE indicates Data Terminal Ready (DTR) enabled, FALSE otherwise. fEnableRTS: TRUE indicates Request to Send (RTS) enabled, FALSE otherwise.
XonChar: Xon flow control character.
XoffChar: Xoff flow control character.
Type: The type of flow control in use.
67 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 HardwareReceive: Hardware receive flow control information.
HardwareTransmit: Hardware transmit flow control information.
711.1.1.1.1.1FLOWCONTROLCLASS The FLOWCONTROLCLASS enumeration specifies the type of flow control, if any, supported.
712 typedef enum _FLOWCONTROLCLASS
713 {
714 FlowControl_None,
715 FlowControl_Hardware,
716 FlowControl_Software
717 } FLOWCONTROLCLASS;
FlowControl_None: Flow control is not enabled.
FlowControl_Hardware: Hardware flow control is enabled.
FlowControl_Software: Software flow control is enabled.
717.1.1.1.1.1RECEIVEFLOWCONTROLCLASS The RECEIVEFLOWCONTROLCLASS enumeration specifies which, if any, means of receive flow control are supported.
718 typedef enum _RECEIVEFLOWCONTROLCLASS
719 {
720 ReceiveFlowControl_None,
721 ReceiveFlowControl_RTS,
722 ReceiveFlowControl_DTR
723 } RECEIVEFLOWCONTROLCLASS;
ReceiveFlowControl_None: No receive flow control currently.
ReceiveFlowControl_RTS: Receive flow control Request to Send (RTS).
ReceiveFlowControl_DTR: Receive flow control Data Terminal Ready (DTR).
723.1.1.1.1.1TRANSMITFLOWCONTROLCLASS The TRANSMITFLOWCONTROLCLASS enumeration specifies which, if any, means of transit flow control is supported.
724 typedef enum _TRANSMITFLOWCONTROLCLASS
725 {
726 TransmitFlowControl_None,
68 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 727 TransmitFlowControl_CTS,
728 TransmitFlowControl_DSR
729 } TRANSMITFLOWCONTROLCLASS;
TransmitFlowControl_None: No transmit flow control currently.
TransmitFlowControl_CTS: Transmit flow control Clear to Send (CTS).
TransmitFlowControl_DSR: Transmit flow control Data Set Ready (DSR).
729.1.1.1.1 CONNECTCONFIG The CONNECTCONFIG structure specifies connectivity parameters.
730 typedef struct _CONNECTCONFIG {
731 ASYNCCONNECTCLASS Type;
732 ULONG fEnableBreakDisconnect :1;
733 } CONNECTCONFIG,
734 *PCONNECTCONFIG;
Type: Type of asynchronous connection. This value is not used. fEnableBreakDisconnect: If TRUE, enable break disconnect.
734.1.1.1.1.1ASYNCCONNECTCLASS The ASYNCCONNECTCLASS enumeration is not used.
735 typedef enum
736 {
737 Connect_CTS,
738 Connect_DSR,
739 Connect_RI,
740 Connect_DCD,
741 Connect_FirstChar,
742 Connect_Perm
743 } ASYNCCONNECTCLASS;
743.1.1.1 NASICONFIG This determines the data type of NASICONFIG.
744 typedef struct _NASICONFIG {
745 NASISPECIFICNAME SpecificName;
69 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 746 NASIUSERNAME UserName;
747 NASIPASSWORD PassWord;
748 NASISESIONNAME SessionName;
749 NASIFILESERVER FileServer;
750 unsigned char GlobalSession;
751 } NASICONFIG,
752 *PNASICONFIG;
SpecificName: The NASI-specific (Netware Asynchronous Services Interface) name.
UserName: The NASI user's user name.
PassWord: The NASI user's password.
SessionName: The NASI session name.
FileServer: The NASI file server name.
GlobalSession: Set to TRUE if the session is a global session.
752.1.1.1.1 NASIUSERNAME The NASI user's user name. This type is declared as follows:
753 typedef WCHAR NASIUSERNAME[NASIUSERNAME_LENGTH + 1];
753.1.1.1.1 NASIPASSWORD The NASI user's password. This type is declared as follows:
754 typedef WCHAR NASIPASSWORD[NASIPASSWORD_LENGTH + 1];
754.1.1.1.1 NASISESIONNAME The NASI session name. This type is declared as follows:
755 typedef WCHAR NASISESIONNAME[NASISESSIONNAME_LENGTH + 1];
755.1.1.1.1 NASISPECIFICNAME The NASI-specific name. This type is declared as follows:
756 typedef WCHAR NASISPECIFICNAME[NASISPECIFICNAME_LENGTH + 1];
756.1.1.1.1 NASIFILESERVER The NASI file server name. This type is declared as follows:
70 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 757 typedef WCHAR NASIFILESERVER[NASIFILESERVER_LENGTH + 1];
757.1.1.1 OEMTDCONFIG The OEM transport driver configuration structure.
758 typedef struct _OEMTDCONFIG {
759 LONG Adapter;
760 DEVICENAME DeviceName;
761 ULONG Flags;
762 } OEMTDCONFIG,
763 *POEMTDCONFIG;
Adapter: The ID of the adapter (OEM driver-specific).
DeviceName: The network name (OEM driver-specific).
Flags: Driver flags (OEM driver-specific).
763.1.1.1 PDCONFIG The protocol driver configuration structure.
764 typedef struct _PDCONFIG {
765 PDCONFIG2 Create;
766 PDPARAMS Params;
767 } PDCONFIG,
768 *PPDCONFIG;
Create: The software configuration of the driver.
Params: The hardware configuration for the driver.
768.1.1.1.1 PDCONFIG2 The protocol driver's software configuration.
769 typedef struct _PDCONFIG2 {
770 PDNAME PdName;
771 SDCLASS SdClass;
772 DLLNAME PdDLL;
773 ULONG PdFlag;
774 ULONG OutBufLength;
71 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 775 ULONG OutBufCount;
776 ULONG OutBufDelay;
777 ULONG InteractiveDelay;
778 ULONG PortNumber;
779 ULONG KeepAliveTimeout;
780 } PDCONFIG2,
781 *PPDCONFIG2;
PdName: The descriptive name of the protocol driver.
SdClass: The type of driver.
PdDLL: The driver's image name.
PdFlag: Driver flags MUST be any bitwise OR combination of the following values:
Value Meaning
PD_UNUSED Unused. 0x00000001
PD_RELIABLE Error-free protocol. 0x00000002
PD_FRAME Frame-oriented protocol. 0x00000004
PD_CONNECTION Connection-oriented protocol. 0x00000008
PD_CONSOLE Directly connected console. 0x00000010
PD_LANA Network class uses LANAs (NetBIOS). 0x00000020
PD_TRANSPORT Transport driver (lowest level). 0x00000040
PD_SINGLE_INST Single instance only (async). 0x00000080
PD_NOLOW_WATERMARK Low water mark to resume transmission. 0x00000100
OutBufLength: Optimal output buffers length, in bytes.
OutBufCount: Optimal number of output buffers.
OutBufDelay: Write delay, in milliseconds.
InteractiveDelay: Write delay during active input.
PortNumber: Network listen port number.
KeepAliveTimeout: Frequency to send keep-alives, in milliseconds.
72 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 781.1.1.1.1 PDNAME The protocol driver name (PDNAME) data type.
782 typedef WCHAR PDNAME[PDNAME_LENGTH + 1];
783 typedef WCHAR* PPDNAME;
783.1.1.1 WDCONFIG The WinStation (session) driver configuration.<98>
784 typedef struct _WDCONFIG {
785 WDNAME WdName;
786 DLLNAME WdDLL;
787 DLLNAME WsxDLL;
788 ULONG WdFlag;
789 ULONG WdInputBufferLength;
790 DLLNAME CfgDLL;
791 WDPREFIX WdPrefix;
792 } WDCONFIG,
793 *PWDCONFIG;
WdName: The descriptive name of the WinStation driver.
WdDLL: The driver's image name.
WsxDLL: Used by the Terminal Services service to communicate with the WinStation driver.<99>
WdFlag: Driver flags. It MUST be any bitwise OR combination of the following values.
Value Meaning
WDF_UNUSED Not used. 0x00000001
WDF_SHADOW_SOURCE Valid shadow source. 0x00000002
WDF_SHADOW_TARGET Valid shadow target. 0x00000004
WDF_OTHER Other protocol. 0x00000008
WDF_TSHARE Remote Protocol used by Terminal Services. 0x00000010
WDF_DYNAMIC_RECONNECT Session can resize display at reconnect.<100> 0x00000020
WDF_USER_VCIOCTL User mode applications can send virtual channel IOCTL. 0x00000040
WDF_SUBDESKTOP Sub-desktop session.<101>
73 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 Value Meaning
0x00008000
WdInputBufferLength: Length, in bytes, of the input buffer used by the driver. Defaults to 2048.
CfgDLL: Configuration DLL used by Terminal Services administrative tools for configuring the driver.<102>
WdPrefix: Used as the prefix of the WinStation name generated for the connected sessions with this WinStation driver.<103>
793.1.1.1.1 WDNAME The WDNAME data type.
794 typedef WCHAR WDNAME[WDNAME_LENGTH + 1];
795 typedef WCHAR* PWDNAME;
795.1.1.1.1 WDPREFIX The WDPREFIX data type.
796 typedef WCHAR WDPREFIX[WDPREFIX_LENGTH + 1];
797 typedef WCHAR* PWDPREFIX;
797.1.1.1 CDCONFIG Connection driver configuration.<104> It is used for connecting via modem to a server.
798 typedef struct _CDCONFIG {
799 CDCLASS CdClass;
800 CDNAME CdName;
801 DLLNAME CdDLL;
802 ULONG CdFlag;
803 } CDCONFIG,
804 *PCDCONFIG;
CdClass: Connection driver type.
CdName: Connection driver descriptive name.
CdDLL: Connection driver image name.
CdFlag: Connection driver flags. Connection driver specific.
804.1.1.1.1 CDCLASS The CDCLASS enumeration specifies a type of connection driver.
805 typedef enum _CDCLASS
74 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 806 {
807 CdNone,
808 CdModem,
809 CdClass_Maximum
810 } CDCLASS;
CdNone: No connection driver.
CdModem: Connection driver is a modem.
CdClass_Maximum: A given CdClass variable will always be less than this value.
810.1.1.1.1 CDNAME Connection driver name.
811 typedef WCHAR CDNAME[CDNAME_LENGTH + 1];
812 typedef WCHAR* PCDNAME;
812.1.1.1 WINSTATIONCREATE Specifies a session to which the user can connect.
813 typedef struct _WINSTATIONCREATE {
814 ULONG fEnableWinStation :1;
815 ULONG MaxInstanceCount;
816 } WINSTATIONCREATE,
817 *PWINSTATIONCREATE; fEnableWinStation: TRUE if enabled.
MaxInstanceCount: Maximum number of instances that can connect to the WinStation.
817.1.1.1 WINSTATIONCONFIG2 Specifies configuration of a session that the user can connect to.
818 typedef struct _WINSTATIONCONFIG2 {
819 WINSTATIONCREATE Create;
820 PDCONFIG Pd[MAX_PDCONFIG];
821 WDCONFIG Wd;
822 CDCONFIG Cd;
823 WINSTATIONCONFIG Config;
75 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 824 } WINSTATIONCONFIG2,
825 *PWINSTATIONCONFIG2;
Create: General creation information.
Pd: An array of protocol data configuration structures for this WinStation.
Wd: The WinStation (session) driver for this WinStation configuration.
Cd: The connection driver for this WinStation configuration.
Config: The specific configuration values for the WinStation (session).
825.1.1.1.1 WINSTATIONCONFIG WinStation configuration data. Included inside a WINSTATIONCONFIG2 structure.
826 typedef struct _WINSTATIONCONFIG {
827 WCHAR Comment[WINSTATIONCOMMENT_LENGTH + 1];
828 USERCONFIG User;
829 char OEMId[4];
830 } WINSTATIONCONFIG,
831 *PWINSTATIONCONFIG;
Comment: The WinStation descriptive comment.
User: The user configuration data for the session (WinStation).
OEMId: Value identifying who implemented the TermService Listener that this session (WinStation) belongs to. This can be any value defined by the implementer (OEM) of the listener.
831.1.1.1 POLICY_TS_MACHINE The POLICY_TS_MACHINE structure defines the machine policy of the server. Each item in the policy has a flag to indicate if the policy is present and a value for the policy.<105>
832 typedef struct _POLICY_TS_MACHINE {
833 ULONG fPolicyDisableClip :1;
834 ULONG fPolicyDisableCam :1;
835 ULONG fPolicyDisableCcm :1;
836 ULONG fPolicyDisableLPT :1;
837 ULONG fPolicyDisableCpm :1;
838 ULONG fPolicyPromptForPassword :1;
76 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 839 ULONG fPolicyMaxInstanceCount :1;
840 ULONG fPolicyMinEncryptionLevel :1;
841 ULONG fPolicyFipsEnabled :1;
842 ULONG fPolicyDisableAutoReconnect :1;
843 ULONG fPolicyWFProfilePath :1;
844 ULONG fPolicyWFHomeDir :1;
845 ULONG fPolicyWFHomeDirDrive :1;
846 ULONG fPolicyDenyTSConnections :1;
847 ULONG fPolicyTempFoldersPerSession :1;
848 ULONG fPolicyDeleteTempFoldersOnExit :1;
849 ULONG fPolicyColorDepth :1;
850 ULONG fPolicySessionDirectoryActive :1;
851 ULONG fPolicySessionDirectoryLocation :1;
852 ULONG fPolicySessionDirectoryClusterName :1;
853 ULONG fPolicySessionDirectoryAdditionalParams :1;
854 ULONG fPolicySessionDirectoryExposeServerIP :1;
855 ULONG fPolicyPreventLicenseUpgrade :1;
856 ULONG fPolicySecureLicensing :1;
857 ULONG fPolicyWritableTSCCPermissionsTAB :1;
858 ULONG fPolicyDisableCdm :1;
859 ULONG fPolicyForceClientLptDef :1;
860 ULONG fPolicyShadow :1;
861 ULONG fPolicyResetBroken :1;
862 ULONG fPolicyReconnectSame :1;
863 ULONG fPolicyMaxSessionTime :1;
864 ULONG fPolicyMaxDisconnectionTime :1;
865 ULONG fPolicyMaxIdleTime :1;
866 ULONG fPolicyInitialProgram :1;
867 ULONG fPolicySingleSessionPerUser :1;
77 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 868 ULONG fPolicyDisableWallpaper :1;
869 ULONG fPolicyKeepAlive :1;
870 ULONG fPolicyEnableTimeZoneRedirection :1;
871 ULONG fPolicyDisableForcibleLogoff :1;
872 ULONG fPolicyLicensingMode :1;
873 ULONG fPolicyExplicitLSDiscovery :1;
874 ULONG fPolicyDisableTerminalServerTooltip :1;
875 ULONG fDisableClip :1;
876 ULONG fDisableCam :1;
877 ULONG fDisableCcm :1;
878 ULONG fDisableLPT :1;
879 ULONG fDisableCpm :1;
880 ULONG fPromptForPassword :1;
881 ULONG ColorDepth :3;
882 ULONG fDenyTSConnections :1;
883 ULONG fTempFoldersPerSession :1;
884 ULONG fDeleteTempFoldersOnExit :1;
885 ULONG fWritableTSCCPermissionsTAB :1;
886 ULONG fDisableCdm :1;
887 ULONG fForceClientLptDef :1;
888 ULONG fResetBroken :1;
889 ULONG fReconnectSame :1;
890 ULONG fSingleSessionPerUser :1;
891 ULONG fDisableWallpaper :1;
892 ULONG fKeepAliveEnable :1;
893 ULONG fPreventLicenseUpgrade :1;
894 ULONG fSecureLicensing :1;
895 ULONG fEnableTimeZoneRedirection :1;
896 ULONG fDisableAutoReconnect :1;
78 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 897 ULONG fDisableForcibleLogoff :1;
898 ULONG fPolicyEncryptRPCTraffic :1;
899 ULONG fEncryptRPCTraffic :1;
900 ULONG fErrorInvalidProfile :1;
901 ULONG fPolicyFallbackPrintDriver :1;
902 ULONG FallbackPrintDriverType :3;
903 ULONG fDisableTerminalServerTooltip :1;
904 BYTE bSecurityLayer;
905 ULONG fPolicySecurityLayer :1;
906 BYTE bUserAuthentication;
907 ULONG fPolicyUserAuthentication :1;
908 ULONG fPolicyTurnOffSingleAppMode :1;
909 ULONG fTurnOffSingleAppMode :1;
910 ULONG fDisablePNPPolicyIsEnfored :1;
911 ULONG fDisablePNPPolicyValue :1;
912 ULONG MaxInstanceCount;
913 ULONG LicensingMode;
914 BYTE MinEncryptionLevel;
915 WCHAR WFProfilePath[DIRECTORY_LENGTH + 1];
916 WCHAR WFHomeDir[DIRECTORY_LENGTH + 1];
917 WCHAR WFHomeDirDrive[257];
918 ULONG SessionDirectoryActive;
919 WCHAR SessionDirectoryLocation[DIRECTORY_LENGTH+1];
920 WCHAR SessionDirectoryClusterName[DIRECTORY_LENGTH+1];
921 WCHAR SessionDirectoryAdditionalParams[DIRECTORY_LENGTH+1];
922 ULONG SessionDirectoryExposeServerIP;
923 ULONG KeepAliveInterval;
924 SHADOWCLASS Shadow;
925 ULONG MaxConnectionTime;
79 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 926 ULONG MaxDisconnectionTime;
927 ULONG MaxIdleTime;
928 WCHAR WorkDirectory[DIRECTORY_LENGTH+1];
929 WCHAR InitialProgram[INITIALPROGRAM_LENGTH + 1];
930 WCHAR LicenseServers[MAX_LICENSE_SERVER_LENGTH + 1];
931 } POLICY_TS_MACHINE,
932 *PPOLICY_TS_MACHINE; fPolicyDisableClip: TRUE indicates the policy for DisableClip is set; FALSE otherwise. fPolicyDisableCam: TRUE indicates the policy for DisableCam is set; FALSE otherwise. fPolicyDisableCcm: TRUE indicates the policy for DisableCcm is set; FALSE otherwise. fPolicyDisableLPT: TRUE indicates the policy for DisableLPT is set; FALSE otherwise. fPolicyDisableCpm: TRUE indicates the policy for DisableCpm is set; FALSE otherwise. fPolicyPromptForPassword: TRUE indicates the policy for PromptForPassword is set; FALSE otherwise. fPolicyMaxInstanceCount: TRUE indicates the policy for MaxInstanceCount is set; FALSE otherwise. fPolicyMinEncryptionLevel: TRUE indicates the policy for MinEncryptionLevel is set; FALSE otherwise. fPolicyFipsEnabled: TRUE indicates the policy for Fips is enabled; FALSE otherwise.<106> fPolicyDisableAutoReconnect: TRUE indicates the policy for DisableAutoReconnect is set; FALSE otherwise. fPolicyWFProfilePath: TRUE indicates the policy for WFProfilePath is set; FALSE otherwise. fPolicyWFHomeDir: TRUE indicates the policy for WFHomeDir is set; FALSE otherwise. fPolicyWFHomeDirDrive: TRUE indicates the policy for WFHomeDirDrive is set; FALSE otherwise. fPolicyDenyTSConnections: TRUE indicates the policy for DenyTSConnections is set; FALSE otherwise. fPolicyTempFoldersPerSession: TRUE indicates the policy for TempFoldersPerSession is set; FALSE otherwise. fPolicyDeleteTempFoldersOnExit: TRUE indicates the policy for DeleteTempFoldersOnExit is set; FALSE otherwise. fPolicyColorDepth: TRUE indicates the policy for ColorDepth is set; FALSE otherwise. fPolicySessionDirectoryActive: TRUE indicates the policy for SessionDirectoryActive is set; FALSE otherwise. fPolicySessionDirectoryLocation: TRUE indicates the policy for SessionDirectoryLocation is set; FALSE otherwise. fPolicySessionDirectoryClusterName: TRUE indicates the policy for SessionDirectoryClusterName is set; FALSE otherwise. fPolicySessionDirectoryAdditionalParams: TRUE indicates the policy for SessionDirectoryAdditionalParams is set; FALSE otherwise.
80 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 fPolicySessionDirectoryExposeServerIP: TRUE indicates the policy for SessionDirectoryExposeServerIP is set; FALSE otherwise. fPolicyPreventLicenseUpgrade: TRUE indicates the policy for PreventLicenseUpgrade is set; FALSE otherwise. fPolicySecureLicensing: TRUE indicates the policy for SecureLicensing is set; FALSE otherwise.<107> fPolicyWritableTSCCPermissionsTAB: TRUE indicates the policy for WritableTSCCPermissionsTAB is set; FALSE otherwise. fPolicyDisableCdm: TRUE indicates the policy for DisableCdm is set; FALSE otherwise. fPolicyForceClientLptDef: TRUE indicates the policy for ForceClientLptDef is set; FALSE otherwise. fPolicyShadow: TRUE indicates the policy for Shadow is set; FALSE otherwise. fPolicyResetBroken: TRUE indicates the policy for ResetBroken is set; FALSE otherwise. fPolicyReconnectSame: TRUE indicates the policy for ReconnectSame is set; FALSE otherwise. fPolicyMaxSessionTime: TRUE indicates the policy for MaxSessionTime is set; FALSE otherwise. fPolicyMaxDisconnectionTime: TRUE indicates the policy for MaxDisconnectionTime is set; FALSE otherwise. fPolicyMaxIdleTime: TRUE indicates the policy for MaxIdleTime is set; FALSE otherwise. fPolicyInitialProgram: TRUE indicates the policy for InitialProgram is set; FALSE otherwise. fPolicySingleSessionPerUser: TRUE indicates the policy for SingleSessionPerUser is set; FALSE otherwise. fPolicyDisableWallpaper: TRUE indicates the policy for DisableWallpaper is set; FALSE otherwise. fPolicyKeepAlive: TRUE indicates the policy for KeepAlive is set; FALSE otherwise. fPolicyEnableTimeZoneRedirection: TRUE indicates the policy for EnableTimeZoneRedirection is set; FALSE otherwise.<108> fPolicyDisableForcibleLogoff: TRUE indicates the policy for DisableForcibleLogoff is set; FALSE otherwise.<109> fPolicyLicensingMode: TRUE indicates the policy for LicensingMode is set; FALSE otherwise.<110> fPolicyExplicitLSDiscovery: TRUE indicates the policy for ExplicitLSDiscovery is set; FALSE otherwise.<111> fPolicyDisableTerminalServerTooltip: TRUE indicates the policy for DisableTerminalServerTooltip is set; FALSE otherwise.<112> fDisableClip: TRUE indicates disable client clipboard redirection; FALSE otherwise. fDisableCam: TRUE indicates disable client audio redirection; FALSE otherwise. fDisableCcm: TRUE indicates disable client COM port redirection; FALSE otherwise. fDisableLPT: TRUE indicates disable client LPT port redirection; FALSE otherwise. fDisableCpm: TRUE indicates disable client printer redirection; FALSE otherwise. fPromptForPassword: Set to FALSE to log on user with previously provided credentials, or TRUE to prompt the user for password.
81 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 ColorDepth: The color depth of the session. The supported values 1, 2, 3, 4, 5 are translated, respectively, as the following number of colors supported: 256 (8 bpp), 32,768 (15 bpp), 65,536 (16 bpp), 16 million (24 bpp), 16 million with transparency (32 bpp).<113> fDenyTSConnections: If set to TRUE, Terminal Services is effectively disabled since remote connections will be declined; FALSE otherwise. fTempFoldersPerSession: Set to TRUE if there are temporary folders per session instead of one common temp folder, FALSE otherwise. fDeleteTempFoldersOnExit: If set to TRUE, delete temporary folders on session exit; FALSE otherwise. fWritableTSCCPermissionsTAB: If set to TRUE, an administrator can change the per-connection security description, FALSE otherwise. fDisableCdm: TRUE indicates disable client drive redirection; FALSE otherwise. fForceClientLptDef: TRUE indicates force the client's redirected printer to be the default printer for the user; FALSE otherwise. fResetBroken: TRUE indicates reset the session if the connection is broken or if the connection or idle timers expire; FALSE otherwise. fReconnectSame: Set to FALSE to indicate that the user can reconnect from any client computer to a disconnected session. TRUE indicates that the user can reconnect to a disconnected session only from the same client computer that initially established the disconnected session. Logging on from a different client computer will lead to a new Terminal Services session being created. fSingleSessionPerUser: TRUE indicates each user can have only a single session; FALSE otherwise. fDisableWallpaper: TRUE indicates display of the desktop wallpaper in the session has been disabled; FALSE otherwise. fKeepAliveEnable: TRUE indicates KeepAlive is enabled; FALSE otherwise. fPreventLicenseUpgrade: TRUE indicates licenses are prevented from being upgraded; FALSE otherwise. fSecureLicensing: TRUE indicates secure licensing is enabled; FALSE otherwise.<114> fEnableTimeZoneRedirection: TRUE indicates Client time zone redirection is enabled; FALSE otherwise.<115> fDisableAutoReconnect: TRUE indicates disable auto-reconnect functionality; FALSE otherwise. fDisableForcibleLogoff: TRUE indicates disable forcible logoff; FALSE otherwise.<116> fPolicyEncryptRPCTraffic: TRUE indicates policy for EncryptRpcTraffic is set; FALSE otherwise.<117> fEncryptRPCTraffic: TRUE indicates the policy for EncryptRpcTraffic is set; FALSE otherwise. fErrorInvalidProfile: Set to TRUE if WFProfilePath, WFHomeDir, or WFHomeDirDrive is invalid (too long), FALSE otherwise.<118> fPolicyFallbackPrintDriver: TRUE indicates the policy for FallbackPrintDriver is set; FALSE otherwise.<119>
FallbackPrintDriverType: The fallback printer driver type. Can be NO_FALLBACK_DRIVERS, FALLBACK_BESTGUESS, FALLBACK_PCL, FALLBACK_PS, or FALLBACK_PCLANDPS.<120> fDisableTerminalServerTooltip: TRUE indicates disable terminal server tooltip; FALSE otherwise.<121>
82 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 bSecurityLayer: If non-zero, indicates the SSL security layer in use.<122> fPolicySecurityLayer: TRUE indicates the policy for SecurityLayer is set; FALSE otherwise.<123> bUserAuthentication: The user authentication level. It can be any of the following values: § TS_USER_AUTHENTICATION_NONE § TS_USER_AUTHENTICATION_VIA_HYBRID § TS_USER_AUTHENTICATION_VIA_SSL § TS_USER_AUTHENTICATION_DEFAULT (same as TS_USER_AUTHENTICATION_NONE) fPolicyUserAuthentication: TRUE indicates the policy for UserAuthentication is set; FALSE otherwise.<124> fPolicyTurnOffSingleAppMode: TRUE indicates the policy for TurnOffSingleAppMode is set; FALSE otherwise.<125> fTurnOffSingleAppMode: TRUE specifies that the desktop is always displayed when a client connects to a remote computer. FALSE specifies an initial program can be specified that runs on the remote computer after the client connects to the remote computer. fDisablePNPPolicyIsEnfored: TRUE indicates policy for PnP redirection is set, FALSE otherwise. fDisablePNPPolicyValue: TRUE indicates disable PnP redirection, FALSE otherwise.
MaxInstanceCount: The maximum number of instances that can connect.
LicensingMode: The licensing mode of the server.
MinEncryptionLevel: The minimum allowed encryption level. Possible numeric values for this parameter include 1 (Low), 2 (Client Compatible), 3 (High), and 4 (FIPS). Detailed description of these encryption levels is included in [MS-RDPBCGR] sections 5.3.1 and 5.4.1.
WFProfilePath: The Terminal Services profile path. Overrides standard profile path.
WFHomeDir: The Terminal Services home directory path. Overrides standard home directory.
WFHomeDirDrive: The Terminal Services home directory drive. Overrides standard home directory.
SessionDirectoryActive: Set to TRUE if the machine is part of a Terminal Server Farm, FALSE otherwise. For information about Terminal Server Farms, see [MSFT-SDLBTS].
SessionDirectoryLocation: The name of the Session Directory Server. For information about Session Directory, see [MSFT-SDLBTS].
SessionDirectoryClusterName: The name of the Terminal Server Farm to which this machine belongs. For information about Terminal Server Farms, see [MSFT-SDLBTS].
SessionDirectoryAdditionalParams: Additional parameters to pass to the session directory. This is an opaque type.
SessionDirectoryExposeServerIP: If set to TRUE, expose the server's IP address to the client; otherwise FALSE.
KeepAliveInterval: Specifies the interval between keep-alives.
Shadow: Specifies whether shadowing of the session is allowed.
MaxConnectionTime: The maximum allowed session connection time setting of the session in milliseconds.
MaxDisconnectionTime: The maximum allowed session disconnect time of the session in milliseconds.
83 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 MaxIdleTime: The maximum allowed session idle time setting of the session in milliseconds.
WorkDirectory: The work directory for the initial program.
InitialProgram: The program to run instead of the default, if set.<126>
LicenseServers: A hardcoded array of license servers that the server will use instead of using license server discovery.
932.1.1.1 WINSTATIONUSERTOKEN The WINSTATIONUSERTOKEN structure defines the user token for a session.
933 typedef struct _WINSTATIONUSERTOKEN {
934 HANDLE ProcessId;
935 HANDLE ThreadId;
936 HANDLE UserToken;
937 } WINSTATIONUSERTOKEN,
938 *PWINSTATIONUSERTOKEN;
ProcessId: Specifies the Process ID.
ThreadId: Specifies the handle to the calling thread.
UserToken: Returns the user token that is currently logged on to the session.
938.1.1.1 WINSTATIONVIDEODATA The WINSTATIONVIDEODATA structure defines the resolution and color depth of a session.
939 typedef struct _WINSTATIONVIDEODATA {
940 USHORT HResolution;
941 USHORT VResolution;
942 USHORT fColorDepth;
943 } WINSTATIONVIDEODATA,
944 *PWINSTATIONVIDEODATA;
HResolution: Specifies the horizontal resolution, in pixels.
VResolution: Specifies the vertical resolution, in pixels. fColorDepth: Specifies the color depth. The supported values 1, 2, 4, 8, and 16 are translated, respectively, as the following number of colors supported: 16 (4 bpp), 256 (8 bpp), 65,536 (16 bpp), 16 million (24 bpp), 32,768 (15 bpp).<127>
944.1.1.1 WINSTATIONLOADINDICATORDATA The WINSTATIONLOADINDICATORDATA structure defines data used for the load balancing of a server.
84 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 945 typedef struct _WINSTATIONLOADINDICATORDATA {
946 ULONG RemainingSessionCapacity;
947 LOADFACTORTYPE LoadFactor;
948 ULONG TotalSessions;
949 ULONG DisconnectedSessions;
950 LARGE_INTEGER IdleCPU;
951 LARGE_INTEGER TotalCPU;
952 ULONG RawSessionCapacity;
953 ULONG reserved[9];
954 } WINSTATIONLOADINDICATORDATA,
955 *PWINSTATIONLOADINDICATORDATA;
RemainingSessionCapacity: The estimated number of additional sessions that can be supported given the CPU constraint.
LoadFactor: Indicates the most constrained current resource.
TotalSessions: The total number of sessions.
DisconnectedSessions: The number of disconnected sessions.
IdleCPU: This is always set to 0.
TotalCPU: This is always set to 0.
RawSessionCapacity: The raw number of sessions capacity. reserved: Reserved.
955.1.1.1.1 LOADFACTORTYPE The LOADFACTORTYPE enumeration specifies the most constrained resource affecting load balancing.
956 typedef enum _LOADFACTORTYPE
957 {
958 ErrorConstraint,
959 PagedPoolConstraint,
960 NonPagedPoolConstraint,
961 AvailablePagesConstraint,
962 SystemPtesConstraint,
963 CPUConstraint
85 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 964 } LOADFACTORTYPE;
ErrorConstraint: An error occurred while obtaining constraint data.
PagedPoolConstraint: The amount of paged pool is the constraint.
NonPagedPoolConstraint: The amount of non-paged pool is the constraint.
AvailablePagesConstraint: The amount of available pages is the constraint.
SystemPtesConstraint: The number of system page table entries (PTEs) is the constraint.
CPUConstraint: CPU usage is the constraint.
964.1.1.1 WINSTATIONSHADOW The WINSTATIONSHADOW structure is used for RpcWinStationQueryInformation and RpcWinStationSetInformation operations.
965 typedef struct _WINSTATIONSHADOW {
966 SHADOWSTATECLASS ShadowState;
967 SHADOWCLASS ShadowClass;
968 ULONG SessionId;
969 ULONG ProtocolType;
970 } WINSTATIONSHADOW,
971 *PWINSTATIONSHADOW;
ShadowState: Specifies the current state of shadowing.
ShadowClass: Specifies the type of shadowing.
SessionId: Specifies the session ID of the session.
ProtocolType: Specifies the type of protocol on the session. Can be the following values.
Name Value
PROTOCOL_OTHERS 1
PROTOCOL_RDP 2
PROTOCOL_CONSOLE 3<128>
971.1.1.1.1 SHADOWSTATECLASS The SHADOWSTATECLASS enumeration specifies WinStation shadow states.
972 typedef enum _SHADOWSTATECLASS
973 {
974 State_NoShadow = 0,
86 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 975 State_Shadowing = 1,
976 State_Shadowed = 2
977 } SHADOWSTATECLASS;
State_NoShadow: No shadow operations are currently being performed on this session.
State_Shadowing: The session is shadowing a different session. The current session is referred to as a shadow client.
State_Shadowed: The session is being shadowed by a different session. The current session is referred to as a shadow target.
977.1.1.1 WINSTATIONPRODID Represents a product ID for the session.
978 typedef struct _WINSTATIONPRODID {
979 WCHAR DigProductId[CLIENT_PRODUCT_ID_LENGTH];
980 WCHAR ClientDigProductId[CLIENT_PRODUCT_ID_LENGTH];
981 WCHAR OuterMostDigProductId[CLIENT_PRODUCT_ID_LENGTH];
982 ULONG curentSessionId;
983 ULONG ClientSessionId;
984 ULONG OuterMostSessionId;
985 } WINSTATIONPRODID,
986 *PWINSTATIONPRODID;
DigProductId: The product ID of the server. For information about the ProductID property, see [MSDN- ProductID].<129>
ClientDigProductId: The product ID of the client.<130>
OuterMostDigProductId: Not used. curentSessionId: The current session identifier.
ClientSessionId: The client's session identifier.
OuterMostSessionId: Not used.
986.1.1.1 WINSTATIONREMOTEADDRESS The WINSTATIONREMOTEADDRESS structure specifies the client's remote address. Only TCP/IP addresses are supported.<131>
987 typedef struct {
988 unsigned short sin_family;
989 union {
87 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 990 struct {
991 USHORT sin_port;
992 ULONG in_addr;
993 UCHAR sin_zero[8];
994 } ipv4;
995 struct {
996 USHORT sin6_port;
997 ULONG sin6_flowinfo;
998 USHORT sin6_addr[8];
999 ULONG sin6_scope_id;
1000 } ipv6;
1001 };
1002 } WINSTATIONREMOTEADDRESS,
1003 *PWINSTATIONREMOTEADDRESS; sin_family: MUST be AF_INET to indicate that IPv4 is supported or AF_INET6 to indicate that IPv6 is supported. For more information on AF_INET and AF_INET6, see [MSDN-SOCKET]. ipv4: IPv4 address. For more information, see [MSDN-TDIADDRESS]. sin_port: Specifies a TCP or User Datagram Protocol (UDP) port number. in_addr: Indicates the IP address. sin_zero: An array filled with zeros. ipv6: IPv6 address. sin6_port: Specifies a TCP or UDP port number. sin6_flowinfo: Ipv6 flow information. sin6_addr: Indicates the IP address. sin6_scope_id: Set of interfaces for a scope. For more information, see [MSDN-SOCKADDR_IN6].
1003.1.1.1 ExtendedClientCredentials The ExtendedClientCredentials structure holds longer user name, password, and domain fields.<132>
1004 typedef struct _ExtendedClientCredentials {
1005 WCHAR UserName[EXTENDED_USERNAME_LEN + 1];
1006 WCHAR Password[EXTENDED_PASSWORD_LEN + 1];
88 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 1007 WCHAR Domain[EXTENDED_DOMAIN_LEN + 1];
1008 } ExtendedClientCredentials,
1009 *pExtendedClientCredentials;
UserName: Specifies the user's username.
Password: Specifies the user's password.
Domain: Specifies the user's domain name.
1009.1.1.1 TS_TRACE The TS_TRACE structure specifies fields used for configuring tracing operations in TS binaries if they are checked.
1010 typedef struct _TS_TRACE {
1011 WCHAR TraceFile[256];
1012 BOOLEAN fDebugger;
1013 BOOLEAN fTimestamp;
1014 ULONG TraceClass;
1015 ULONG TraceEnable;
1016 WCHAR TraceOption[64];
1017 } TS_TRACE,
1018 *PTS_TRACE;
TraceFile: Specifies the file name, if any, to which to write debug information. fDebugger: Specifies whether debugger is attached. fTimestamp: Specifies whether to append time stamp to the traces logged.
TraceClass: Classes of tracing to log. They enable tracing for the various terminal server binaries/functionalities. It MUST be a bitwise OR combination of one or more of the following values.
Value Meaning
TC_ICASRV Enable tracing for the Terminal Services Service.<133> 0x00000001
TC_ICAAPI Enable tracing for the DLL providing the API for Terminal Services to communicate with the 0x00000002 WinStation Driver.<134>
TC_ICADD Enable tracing for the Terminal Services Device Driver.<135> 0x00000004
TC_WD Enable tracing for the WinStation Driver.<136> 0x00000008
TC_CD Enable tracing for the Connection Driver.<137> 0x00000010
89 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 Value Meaning
TC_PD Enable tracing for the Protocol Driver.<138> 0x00000020
TC_TD Enable tracing for the Transport Driver.<139> 0x00000040
TC_RELIABLE Not used. 0x00000100
TC_FRAME Enable tracing for the Frame Protocol Driver.<140> 0x00000200
TC_COMP Enable tracing for the Compression library.<141> 0x00000400
TC_CRYPT Enable tracing for the Encryption binary.<142> 0x00000800
TC_TW Not used. 0x10000000
TC_DISPLAY Enable tracing for the Display Driver.<143> 0x10000000
TC_WFSHELL Not used. 0x20000000
TC_WX Enable tracing for the WinStation Extension.<144> 0x40000000
TC_LOAD Enable tracing for the Load balancing binary.<145> 0x80000000
TC_ALL Everything. 0xffffffff
TraceEnable: Type of tracing calls log. It MUST be a bitwise OR combination of one or more of the following values.
Value Meaning
TT_API1 API level 1. 0x00000001
TT_API2 API level 2. 0x00000002
TT_API3 API level 3. 0x00000004
TT_API4 API level 4. 0x00000008
TT_OUT1 Output level 1. 0x00000010
TT_OUT2 Output level 2. 0x00000020
TT_OUT3 Output level 3. 0x00000040
TT_OUT4 Output level 4. 0x00000080
90 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 Value Meaning
TT_IN1 Input level 1. 0x00000100
TT_IN2 Input level 2. 0x00000200
TT_IN3 Input level 3. 0x00000400
TT_IN4 Input level 4. 0x00000800
TT_ORAW Raw output data. 0x00001000
TT_IRAW Raw input data. 0x00002000
TT_OCOOK Cooked output data. 0x00004000
TT_ICOOK Cooked input data. 0x00008000
TT_SEM Semaphores. 0x00010000
TT_NONE Only view errors. 0x10000000
TT_ERROR Error condition. 0xffffffff
TraceOption: Trace option string. This SHOULD be in the format "
1018.1.1.1 BEEPINPUT The BEEPINPUT structure performs a beep in the session.
1019 typedef struct _BEEPINPUT {
1020 ULONG uType;
1021 } BEEPINPUT,
1022 *PBEEPINPUT; uType: If the session ID is 0, this can be any of the values that can be passed to the standard MessageBeep function ([MSDN-MSGBeep]). If the session ID is not 0, a frequency and duration is chosen by the server to send as a beep to the session.
1022.1.1.1 WINSTATIONCLIENTDATA The WINSTATIONCLIENTDATA structure is a ClientData structure used to send data through RpcWinStationSetInformation to the client.
1023 typedef struct _WINSTATIONCLIENTDATA {
91 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 1024 CLIENTDATANAME DataName;
1025 BOOLEAN fUnicodeData;
1026 } WINSTATIONCLIENTDATA,
1027 *PWINSTATIONCLIENTDATA;
DataName: Identifies the type of data sent in this WINSTATIONCLIENTDATA structure. The definition is dependent on the caller and on the client receiving it. This MUST be a data name following a format similar to that of the CLIENTDATANAME data type. fUnicodeData: TRUE indicates data is in Unicode format; FALSE otherwise.
1027.1.1.1 SESSION_CHANGE The SESSION_CHANGE structure contains the ID of a session running on a terminal server and a mask of the notifications that were received for that session.
1028 typedef struct _SESSION_CHANGE {
1029 LONG SessionId;
1030 TNotificationId NotificationId;
1031 } SESSION_CHANGE,
1032 *PSESSION_CHANGE;
SessionId: Identifies the session for which notification was received.
NotificationId: Mask of the notifications that were received for this session.
1032.1.1.1 RCM_REMOTEADDRESS The RCM_REMOTEADDRESS structure defines a remote address.
1033 typedef struct {
1034 USHORT sin_family;
1035 union switch (sin_family) {
1036 case 2: struct {
1037 USHORT sin_port;
1038 ULONG in_addr;
1039 UCHAR sin_zero[8];
1040 } ipv4;
1041 case 23: struct {
1042 USHORT sin6_port;
92 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 1043 ULONG sin6_flowinfo;
1044 USHORT sin6_addr[8];
1045 ULONG sin6_scope_id;
1046 } ipv6;
1047 };
1048 } RCM_REMOTEADDRESS,
1049 *PRCM_REMOTEADDRESS; sin_family: Specifies the type of IP address. Valid values are 2 for IPv4 addresses, and 23 for IPv6 addresses. ipv4: IPv4 address. For more information, see [MSDN-TDIADDRESS]. sin_port: Specifies a TCP or UDP port number. in_addr: Indicates the IP address. sin_zero: An array filled with zeros. ipv6: IPv6 address. sin6_port: Specifies a TCP or UDP port number. sin6_flowinfo: IPv6 flow information. sin6_addr: Indicates the IP address. sin6_scope_id: Set of interfaces for a scope. For more information about these interfaces, see [MSDN- SOCKADDR_IN6].
1049.1.1.1 CLIENT_STACK_ADDRESS The CLIENT_STACK_ADDRESS structure represents the client network address.<146>
1050 typedef struct _SESSION_CHANGE {
1051 BYTE Address[STACK_ADDRESS_LENGTH];
1052 } CLIENT_STACK_ADDRESS,
1053 *PCLIENT_STACK_ADDRESS;
Address: The first two bytes represent the address family to which the client network address belongs. For more information, see [MSDN-SOCKET]. The remaining bytes represent the client network address in a TDI_ADDRESS_IP structure. For more information, see [MSDN-TDIADDRESS].
1053.1.1.1 VARDATA_WIRE The VARDATA_WIRE structure defines the size and offset of the variable-length data succeeding it. This structure is used before variable-length data fields that
93 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 are returned by using specific WinStationInformationClass classes (see section 3.7.4.1.6).
1054 typedef struct _VARDATA_WIRE {
1055 USHORT Size;
1056 USHORT Offset;
1057 } VARDATA_WIRE,
1058 *PVARDATA_WIRE;
Size: Size of the variable length data, in bytes, succeeding this structure.
Offset: Offset, in bytes, of the succeeding variable-length structure in the whole data BLOB.
1058.1.1.1 PDPARAMSWIRE The PDPARAMSWIRE structure precedes a PDPARAMS structure and defines the size and offset of the PDPARAMS structures in the complete data BLOB.
1059 typedef struct _PDPARAMSWIRE {
1060 SDCLASS SdClass;
1061 VARDATA_WIRE SdClassSpecific;
1062 } PDPARAMSWIRE,
1063 *PPDPARAMSWIRE;
SdClass: Value of SDCLASS that the succeeding PDPARAMS structure corresponds to.
SdClassSpecific: VARDATA_WIRE structure defining the size and offset of the variable-length PDPARAMS data succeeding it.
1063.1.1.1 WINSTACONFIGWIRE The WINSTACONFIGWIRE structure precedes a variable-length user configuration data BLOB and defines the size and offset of the user configuration data.
1064 typedef struct _WINSTACONFIGWIRE {
1065 WCHAR Comment[61];
1066 CHAR OEMId[4];
1067 VARDATA_WIRE UserConfig;
1068 VARDATA_WIRE NewFields;
1069 } WINSTACONFIGWIRE,
1070 *PWINSTACONFIGWIRE;
Comment: The WinStation descriptive comment.
94 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 OEMId: Value identifying the OEM implementor of the TermService Listener to which this session (WinStation) belongs. This can be any value defined by the implementer (OEM) of the listener.
UserConfig: VARDATA_WIRE structure defining the size and offset of the variable-length user configuration data succeeding it.
NewFields: VARDATA_WIRE structure defining the size and offset of the variable-length new data succeeding it. This field is not used and is a placeholder for any new data, if and when added.
1070.1.1.1 TSVIP_SOCKADDR The TSVIP_SOCKADDR structure defines a socket address.
1071 typedef struct {
1072 union switch (unsigned short sin_family) {
1073 case 2: struct {
1074 USHORT sin_port;
1075 ULONG in_addr;
1076 UCHAR sin_zero[8];
1077 } ipv4;
1078 case 23: struct {
1079 USHORT sin6_port;
1080 ULONG sin6_flowinfo;
1081 USHORT sin6_addr[8];
1082 ULONG sin6_scope_id;
1083 } ipv6;
1084 } u;
1085 } TSVIP_SOCKADDR,
1086 *PTSVIP_SOCKADDR; ipv4: IPv4 address. For more information, see [MSDN-TDIADDRESS]. sin_port: Specifies a TCP or UDP port number. in_addr: Indicates the IP address. sin_zero: An array filled with zeros. ipv6: IPv6 flow information. sin6_port: Specifies a TCP or UDP port number. sin6_flowinfo: IPv6 flow information. sin6_addr: Indicates the IP address. sin6_scope_id: Set of interfaces for a scope. For more information, see [MSDN-SOCKADDR_IN6].
95 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 1086.1.1.1 TSVIPAddress The TSVIPAddress structure defines a session's IP address.
1087 typedef struct _TSVIPAddress {
1088 DWORD dwVersion;
1089 TSVIP_SOCKADDR IPAddress;
1090 ULONG PrefixOrSubnetMask;
1091 UINT PhysicalAddressLength;
1092 BYTE PhysicalAddress[PhysicalAddressLength];
1093 ULONG LeaseExpires;
1094 ULONG T1;
1095 ULONG T2;
1096 } TSVIPAddress,
1097 *PTSVIPAddress; dwVersion: Specifies the current TSVIPAddress structure version. This field MUST be set to 0x01, the only supported version.
IPAddress: Specifies the IP address.
PrefixOrSubnetMask: Subnet mask of the IP address.
PhysicalAddressLength: Number of bytes in the PhysicalAddress.
Where TSVIP_MAX_ADAPTER_ADDRESS_LENGTH is defined as
1098 #define TSVIP_MAX_ADAPTER_ADDRESS_LENGTH 16
PhysicalAddress: The MAC address used to acquire the IP address.
LeaseExpires: The lease expiration time for the IP address.
T1: The time at which a request to renew the IP address will be made.
T2: Not used.
1098.1.1.1 TSVIPSession The TSVIPSession structure defines a session with its IP address information.
1099 typedef struct _TSVIPSession {
1100 DWORD dwVersion;
1101 DWORD SessionId;
1102 TSVIPAddress SessionIP;
1103 } TSVIPSession,
96 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 1104 *PTSVIPSession; dwVersion: Specifies the version of the structure. This field MUST be set to 0x01, the only supported version.
SessionId: Specifies the ID of the session.
SessionIP: Specifies the IP address for the session. This is of type TSVIPAddress.
1104.1.1.1 WINSTATIONVALIDATIONINFORMATION The WINSTATIONVALIDATIONINFORMATION structure contains information that is required to identify and validate a per-device terminal server (TS) client access license (CAL) associated with the session. A TS CAL is a license that is issued to a user or device to allow remote access to sessions on a terminal server. A per-device TS CAL is a license that is issued to a specific client device. For more information, see [MSFT-WSTSL].
1105 typedef struct _WINSTATIONVALIDATIONINFORMATION {
1106 WINSTATIONPRODUCTINFO ProductInfo;
1107 BYTE License[VALIDATIONINFORMATION_LICENSE_LENGTH];
1108 ULONG LicenseLength;
1109 BYTE HardwareID[VALIDATIONINFORMATION_HARDWAREID_LENGTH];
1110 ULONG HardwareIDLength;
1111 } WINSTATIONVALIDATIONINFORMATION,
1112 *PWINSTATIONVALIDATIONINFORMATION;
ProductInfo: Specifies information that identifies the type of license.
License: The per-device license BLOB associated with the session.
LicenseLength: The length, in bytes, of License.
HardwareID: An identifier that uniquely identifies the client device.
HardwareIDLength: The length, in bytes, of HardwareID.
1112.1.1.1 WINSTATIONPRODUCTINFO The WINSTATIONPRODUCTINFO structure defines the type of license.
1113 typedef struct _WINSTATIONPRODUCTINFO {
1114 WCHAR CompanyName;
1115 WCHAR ProductID;
1116 } WINSTATIONPRODUCTINFO,
1117 PWINSTATIONPRODUCTINFO;
97 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 CompanyName: The name associated with the license. All licenses are associated with "Microsoft Corporation".
ProductID: An ID identifying the type of license. The product ID for per-device licenses is "A02".
1117.1 Directory Service Schema Elements The Terminal Services Terminal Server Runtime Interface accesses the following directory service attributes in the user class listed in the following table. For the syntactic specifications of the following attributes, see Active Directory Domain Services (AD DS) ([MS-ADA1], [MS-ADA2], [MS-ADA3], and [MS- ADSC]). Directory service attributes Description msTSAllowLogon Not used by Terminal Services. msTSBrokenConnectionAction Not used by Terminal Services. msTSConnectClientDrives Not used by Terminal Services. msTSConnectPrinterDrives Not used by Terminal Services. msTSDefaultToMainPrinter Not used by Terminal Services. msTSHomeDirectory Not used by Terminal Services; CtxWFHomeDir defined in section 2.3.2 is used instead. msTSHomeDrive Not used by Terminal Services; CtxWFHomeDirDrive defined in section 2.3.2 is used instead. msTSInitialProgram Not used by Terminal Services; CtxInitialProgram defined in section 2.3.2 is used instead. msTSMaxConnectionTime Not used by Terminal Services; CtxMaxConnectionTime defined in section 2.3.2 is used instead. msTSMaxDisconnectionTime Not used by Terminal Services; CtxMaxDisconnectionTime defined in section 2.3.2 is used instead. msTSMaxIdleTime Not used by Terminal Services; CtxMaxIdleTime defined in section 2.3.2 is used instead. msTSProfilePath Not used by Terminal Services; CtxWFProfilePath defined in section 2.3.2 is used instead. msTSReconnectionAction Not used by Terminal Services. msTSRemoteControl Not used by Terminal Services; CtxShadow defined in section 2.3.2 is used instead. msTSWorkDirectory Not used by Terminal Services; CtxWorkDirectory defined in section 2.3.2 is used instead. userParameters This attribute contains a binary BLOB composed of various fields of the USERCONFIG structure returned by RpcGetConfigData. For the binary BLOB structure, see UserParameters (section 2.3.1). msTSProperty01 This attribute contains multi-strings that represent the personal desktop assigned to the user. For the structure of this attribute, see msTSProperty01 (section 2.3.4). Note Any of the previously defined properties can be set for either a user or a machine. Machine properties MAY override user properties and hence the value returned by the RPC calls as previously defined will depend on whether machine properties are set in addition to the user properties.
98 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 1117.1.1 userParameters The userParameters attribute is used by Terminal Services to store the configuration data associated with the user connected to a session running on a terminal server. This configuration data is returned in a USERCONFIG structure by the RpcGetConfigData method. Terminal Services does not use UTF-8 or UTF-16 encoding to store the configuration data in the userParameters attribute. Terminal Services stores the user configuration data in the userParameters attribute in the following format: 1 2 3 01 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
ReservedData (96 bytes)
...
...
Signature TSPropertyCount
TSPropertyArray (variable)
...
ReservedData (96 bytes): A 96-byte array of reserved data.<147>
Signature (2 bytes): A 2-byte Unicode character. This field is used by Terminal Services to assert the validity of the TSPropertyCount and TSPropertyArray fields. Terminal Services compares the data contained in this field with Unicode character "P". If this field contains the aforementioned character, then the information inside the TSPropertyArray and TSPropertyCount fields is considered valid. If it contains a different value, then all information inside the TSPropertyCount and TSPropertyArray fields is considered invalid.
TSPropertyCount (2 bytes): A 2-byte unsigned integer indicating the number of elements in TSPropertyArray.
TSPropertyArray (variable): A variable-length array of TSProperty structures. The number of elements in this array is specified by the field TSPropertyCount.
1117.1.2 TSProperty Following is the format of each TSProperty structure: 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
NameLength ValueLength
Type PropName (variable)
...
PropValue (variable)
...
NameLength (2 bytes): A 2-byte unsigned integer indicating the length of the PropName field in bytes.
99 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 ValueLength (2 bytes): A 2-byte unsigned integer indicating the length of the PropValue field in bytes.
Type (2 bytes): A 2-byte unsigned integer indicating the type of the PropValue field. It can have the following values:
Value Meaning
PROP_TYPE_ITEM Indicates that the property contains one item. 0x01
PropName (variable): A Unicode string whose length is indicated by the NameLength field. The string indicates the name of the property.
PropValue (variable): An encoded binary BLOB of length indicated by the ValueLength field. This field either contains a 32-bit unsigned integer or an array of ASCII characters. See Encoding and decoding PropValue field for encoding and decoding this BLOB.
The following table describes various PropName fields and associated PropValue fields used by Terminal Services.
[MS-TSTS] RPC call PropValue that can be used to PropName type Description query this value
CtxCfgPresent 32-bit It indicates presence of valid TSProperty None. unsigned structures in TSPropertyArray. If the integer TSPropertyArray does not contain a TSProperty structure containing this PropName and PropValue, Terminal Services ignore the remaining contents of TSPropertyArray. The PropValue field can only contain value 0xB00B1E55.
CtxCfgFlags1 32-bit Each bit in the PropValue maps to a RpcGetConfigData. unsigned Boolean field of the USERCONFIG integer structure returned by the RpcGetConfigData method. For details about each bit, see the table of CtxCfgFlags1 values in this section.
CtxCallBack 32-bit The callback class for callback operations. Returned by unsigned RpcGetConfigData integer method in Callback field of USERCONFIG structure.
CtxKeyboardLayout 32-bit The keyboard layout (HKL) of the user Returned by the unsigned session. RpcGetConfigData integer method in the KeyboardLayout field of the USERCONFIG structure.
CtxMinEncryptionLevel 8-bit The minimum allowed encryption level of Returned by the integer the user session. RpcGetConfigData method in the MinEncryptionLevel field of the USERCONFIG structure.
CtxNWLogonServer 32-bit The NetWare logon server name. Returned by the unsigned RpcGetConfigData integer method in the NWLogonServer field of the USERCONFIG structure.
100 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 [MS-TSTS] RPC call PropValue that can be used to PropName type Description query this value
CtxWFHomeDir Variable- This attribute specifies the home directory Returned by the length for the user. Each user on a terminal RpcGetConfigData ASCII server has a unique home directory. This method in the character ensures that application information is WFHomeDir field of array stored separately for each user in a multi- the USERCONFIG user environment. To set a home structure. directory on the local computer, the implementer specifies a local path; for example, C:\Path. To set a home directory in a network environment, the implementer MUST first set the CtxWFHomeDirDrive property, and then set this property to a Universal Naming Convention (UNC) path.
CtxWFHomeDirDrive Variable- This attribute specifies a home drive for Returned by the length the user. In a network environment, this RpcGetConfigData ASCII property is a string containing a drive method in the character specification (a drive letter followed by a WFHomeDirDrive field array colon) to which the UNC path specified in of the USERCONFIG the TerminalServicesCtxWFHomeDir structure. property is mapped. To set a home directory in a network environment, the implementer MUST first set this property, and then set the CtxWFHomeDir property.
CtxInitialProgram Variable- This attribute specifies the path and file Returned by the length name of the application that the user RpcGetConfigData ASCII requires to start automatically when the method in the character user logs on to the terminal server. To set InitialProgram field of array an initial application to start when the the USERCONFIG user logs on, the implementer MUST first structure. set this property, and then set the CtxWorkDirectory property. If the implementer sets only the CtxInitialProgram property, the application starts in the user's session in the default user directory.
CtxMaxConnectionTime 32-bit This attribute specifies the maximum Returned by the unsigned duration (in minutes) of the Terminal RpcGetConfigData integer Services session. After the specified method in the number of minutes has elapsed, the MaxConnectionTime session can be disconnected or field of the terminated. USERCONFIG structure.
CtxMaxDisconnectionTime 32-bit This attribute specifies the maximum Returned by the unsigned amount of time (in minutes) that a RpcGetConfigData integer disconnected Terminal Services session method in the remains active on the terminal server. MaxDisconnectionTime After the specified number of minutes has field of the elapsed, the session is terminated. USERCONFIG structure.
CtxMaxIdleTime 32-bit This attribute specifies the maximum Returned by the unsigned amount of time (in minutes) that the RpcGetConfigData integer Terminal Services session can remain idle. method in the After the specified number of minutes has MaxIdleTime field of elapsed, the session can be disconnected the USERCONFIG or terminated. structure.
CtxWFProfilePath Variable- This attribute specifies a roaming or Returned by the length mandatory profile path to use when the RpcGetConfigData ASCII user logs on to the terminal server. The method in the character profile path is in the following network WFProfilePath field of
101 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 [MS-TSTS] RPC call PropValue that can be used to PropName type Description query this value
array path format: \\servername\profiles folder the USERCONFIG name\username. structure.
CtxShadow 32-bit This attribute specifies whether to allow Returned by the unsigned remote observation or remote control of RpcGetConfigData integer the user's Terminal Services session. The method in the Shadow values are as follows: field of the 0. Disable USERCONFIG structure. 1. EnableInputNotify 2. EnableInputNoNotify 3. EnableNoInputNotify 4. EnableNoInputNoNotify For a description of these values, see [MSDN-RCMWin32_TSRCS].
CtxWorkDirectory Variable- This attribute specifies the working Returned by the length directory path for the user. To set an RpcGetConfigData ASCII initial application to start when the user method in the character logs on to the terminal server, the WorkDirectory field of array implementer MUST first set the the USERCONFIG CtxInitialProgram property, and then set structure. this property.
CtxCallbackNumber Variable- This attribute specifies the call back Returned by the length number provided to the user on the client RpcGetConfigData ASCII side for technical support. method in the character CallbackNumber field array of the USERCONFIG structure. The following table provides the details of each bit in the PropValue associated with the PropName 'CtxCfgFlags1'. Bit mask in CtxCfgFlags1 PropValue [MS-TSTS] RPC call that can be used to query this value
0x10000000 Returned by the RpcGetConfigData method in fInheritInitialProgram field of the USERCONFIG structure.
F1MSK_INHERITCALLBACK Returned by the RpcGetConfigData method in the 0x08000000 fInheritCallback field of the USERCONFIG structure.
F1MSK_INHERITCALLBACKNUMBER Returned by the RpcGetConfigData method in the 0x04000000 fInheritCallbackNumber field of the USERCONFIG structure.
F1MSK_INHERITSHADOW Returned by the RpcGetConfigData method in the fInheritShadow 0x02000000 field of the USERCONFIG structure.
F1MSK_INHERITMAXSESSIONTIME Returned by the RpcGetConfigData method in the 0x01000000 fInheritMaxSessionTime field of the USERCONFIG structure.
F1MSK_INHERITMAXDISCONNECTIONTIME Returned by the RpcGetConfigData method in the 0x00800000 fInheritMaxDisconnectionTime field the USERCONFIG structure.
F1MSK_INHERITMAXIDLETIME Returned by the RpcGetConfigData method in the 0x00400000 fInheritMaxIdleTime field of the USERCONFIG structure.
F1MSK_INHERITAUTOCLIENT Returned by the RpcGetConfigData method in the 0x00200000 fInheritAutoClient field of the USERCONFIG structure.
F1MSK_INHERITSECURITY Returned by the RpcGetConfigData method in the fInheritSecurity 0x00100000 field of the USERCONFIG structure.
F1MSK_PROMPTFORPASSWORD Returned by the RpcGetConfigData method in the fPromptForPassword field of the USERCONFIG structure.
102 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 Bit mask in CtxCfgFlags1 PropValue [MS-TSTS] RPC call that can be used to query this value
0x00080000
F1MSK_RESETBROKEN Returned by the RpcGetConfigData method in the fResetBroken 0x00040000 field of the USERCONFIG structure.
F1MSK_RECONNECTSAME Returned by the RpcGetConfigData method in the 0x00020000 fReconnectSame field of the USERCONFIG structure.
F1MSK_LOGONDISABLED Returned by the RpcGetConfigData method in the fLogonDisabled 0x00010000 field of the USERCONFIG structure.
F1MSK_AUTOCLIENTDRIVES Returned by the RpcGetConfigData method in the 0x00008000 fAutoClientDrives field of the USERCONFIG structure.
F1MSK_AUTOCLIENTLPTS Returned by the RpcGetConfigData method in the fAutoClientLpts 0x00004000 field of the USERCONFIG structure.
F1MSK_FORCECLIENTLPTDEF Returned by the RpcGetConfigData method in the 0x00002000 fForceClientLptDef field of the USERCONFIG structure.
F1MSK_DISABLEENCRYPTION Returned by the RpcGetConfigData method in the 0x00001000 fDisableEncryption field of the USERCONFIG structure.
F1MSK_HOMEDIRECTORYMAPROOT Returned by the RpcGetConfigData method in the 0x00000800 fHomeDirectoryMapRoot field of the USERCONFIG structure.
F1MSK_USEDEFAULTGINA Returned by the RpcGetConfigData method in the 0x00000400 fUseDefaultGina field of the USERCONFIG structure.
F1MSK_DISABLECPM Returned by the RpcGetConfigData method in the fDisableCpm 0x00000200 field of the USERCONFIG structure.
F1MSK_DISABLECDM Returned by the RpcGetConfigData method in the fDisableCdm 0x00000100 field of the USERCONFIG structure.
F1MSK_DISABLECCM Returned by the RpcGetConfigData method in the fDisableCcm 0x00000080 field of the USERCONFIG structure.
F1MSK_DISABLELPT Returned by the RpcGetConfigData method in the fDisableLPT 0x00000040 field of the USERCONFIG structure.
F1MSK_DISABLECLIP Returned by the RpcGetConfigData method in the fDisableClip 0x00000020 field of the USERCONFIG structure.
F1MSK_DISABLEEXE Returned by the RpcGetConfigData method in the fDisableExe 0x00000010 field of the USERCONFIG structure.
F1MSK_WALLPAPERDISABLED Returned by the RpcGetConfigData method in the 0x00000008 fWallPaperDisabled field of the USERCONFIG structure.
F1MSK_DISABLECAM Returned by the RpcGetConfigData method in the fDisableCam 0x00000004 field of the USERCONFIG structure.
1117.1.3 Encoding PropValue Field in TSProperty Structure To create the encoded binary BLOB for the PropValue field, for each byte of the input create its ASCII-encoded hexadecimal representation and place this representation in 2 consecutive bytes of the output buffer, the most significant hexadecimal digit first followed by the least significant hexadecimal digit. For example, if the input byte contains the ASCII representation of character 'A', the resulting output will be a sequence of two ASCII characters: character '4'
103 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 followed by character '1' because the hexadecimal representation of a byte that contains the ASCII character 'A' is 41. Hence, the output buffer corresponding to the input buffer byte containing character 'A' will be a sequence of 2 bytes whose hexadecimal representations are 34 and 31. As another example, the input buffer containing the ASCII string "ABCDE\0" would be encoded into the ASCII string "414243444500" (without the terminating 0), which is the same as a sequence of 12 bytes whose hexadecimal representations are 34, 31, 34, 32, 34, 33, 34, 34, 34, 35, 30, and 30. See Encoding/Decoding Example (section 4.5) for an example of code that demonstrates encoding and decoding of the PropValue field.
1117.1.4 msTSProperty01 The personal desktop information stored in the msTSProperty01 attribute consists of multiple strings. Each string has the format
104 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 1118 Protocol Details The methods comprising this RPC interface all return a value greater than or equal to 0 on success and a nonzero, implementation-specific error code on failure. If the return type of the function is HRESULT as specified in section 2.2, a negative number will be treated as failure. If the return type of the function is Boolean as specified in section 2.2, a nonzero value will be treated as success. Unless otherwise specified in the following sections, a server-side implementation of this protocol may choose any nonzero Win32 error value to signify an error condition, as specified in section 1.8. The client side of the Terminal Services Terminal Server Runtime Interface Protocol MUST return error codes to the caller without modification. The client side of the Terminal Services Terminal Server Runtime Interface Protocol MUST simply return error codes to the invoking application without taking any protocol action. Note that the terms "client side" and "server side" refer to the initiating and receiving ends of the protocol, respectively, rather than to client or server versions of an operating system. These methods MUST all behave the same way regardless of whether the "server side" of the protocol is running in a client or server version of an operating system.
1118.1 Determining a Caller's Permissions and Access Rights To determine access rights, the caller's token is retrieved from the RPC transport, as described for RpcImpersonationAccessToken in [MS-RPCE] section 3.3.3.4.3. It MAY use the security identifier (SID) that represents the user account in the caller's token. For more information about tokens, see [MS-DTYP] section 2.5.2. For more information about SIDs, see [MS-DTYP] section 2.4.2.
1118.1.1 Determining a Caller's Permissions During processing of methods that implement access checks, this protocol performs access security verification on the caller's identity by using the algorithm specified by the Access Check Algorithm Pseudo code ([MS-DTYP] section 2.5.3.2). The input parameters of that algorithm are mapped as follows: § SecurityDescriptor: This MUST be the SECURITY_DESCRIPTOR of the session.<148> For more information about SECURITY_DESCRIPTOR, see [MS-DTYP] section 2.4.6. § Token / Authorization Context: This MUST be the caller's token. § Access Request mask: This is specified by each method's processing logic and MUST be one or more of the WinStationOpen access values specified in section 6.5. § Object Tree: This parameter MUST be NULL. § PrincipalSelfSubst SID: This parameter MUST be NULL.
105 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 1118.1.2 Determining Whether a Caller Is SYSTEM During processing of methods that implement access checks of whether the caller is SYSTEM, this protocol performs access security verification on the caller's identity by checking whether the SID of the SYSTEM is the same as the SID that represents the user account in the caller's token.
1118.1.3 Determining Whether a Caller Is an Administrator During processing of methods that implement access checks of whether the caller is an administrator, this protocol performs access security verification on the caller's identity by using the support function SidInToken ([MS-DTYP] section 2.5.3.1.1). The input parameters of that algorithm are mapped as follows: § Token: MUST be the caller's token. § SidToTest: MUST be the SID of administrators. § PrincipalSelfSubstitute: MUST be NULL.
1118.1.4 Determining Whether a Caller Is the Same User Who Logged onto the Session During processing of methods that implement access checks of whether the caller is the same user who logged onto the session, this protocol performs access security verification on the caller's identity by checking whether the SID of the user logged onto the session is the same as the SID that represents the user account in the caller's token.
1118.2 Local Session Manager Client Details
1118.2.1 Abstract Data Model None.
1118.2.2 Timers No protocol timers are required beyond those used internally by RPC to implement resiliency to network outages, as specified in [MS-RPCE].
1118.2.3 Initialization The client MUST create an RPC connection to the terminal server by using the details specified in section 2.1.
1118.2.4 Processing Events and Sequencing Rules When a method completes, the values returned by RPC MUST be returned unmodified to the upper layer.
1118.2.5 Timer Events No protocol timer events are required on the client except those that are required in the underlying RPC transport.
106 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 1118.2.6 Other Local Events None.
1118.3 Local Session Manager Server Details
1118.3.1 Abstract Data Model This section describes a conceptual model of possible data organization that an implementation maintains to participate in this protocol. The described organization is provided to facilitate the explanation of how the protocol behaves. This document does not mandate that implementations adhere to this model as long as their external behavior is consistent with that described in this document.
1118.3.1.1 Abstract Data Types
TS_COUNTER: A Terminal Services performance counter structure used to represent a single performance counter. It is described in section 2.2.2.17. An array of these structures is returned by the RpcGetSessionCounters method. dwCounterID: Identifier of a performance counter. It is used with RpcGetSessionCounters and MUST be set to one of the values described in section 2.2.2.17.1.
SessionHandle: Handle to a session. It is defined in section 2.2.1.1. The following list shows how SessionHandle is used with various methods. § RpcOpenSession as the phSession parameter. § RpcCloseSession as the phSession parameter. § RpcConnect as the hSession parameter. § RpcDisconnect as the hSession parameter. § RpcLogoff as the hSession parameter. § RpcGetUserName as the hSession parameter. § RpcGetTerminalName as the hSession parameter. § RpcGetState as the hSession parameter. § RpcIsSessionDesktopLocked as the hSession parameter. § RpcShowMessageBox as the hSession parameter. § RpcGetTimes as the hSession parameter.
ExecutionEnvironmentData: A structure containing information about the sessions running on the terminal server and the sessions running on virtual machines hosted on the server. It is used with RpcGetAllSessions and returned as the ppSessionData parameter.
SessionState: Current state of a session. It MUST be set to one of the values of the WINSTATIONSTATECLASS enumeration as defined in section 2.2.1.9. The following list shows how SessionState is used with various methods. § RpcGetState as the plState parameter. § RpcGetSessionInformationEx as the SessionState member of the LSM_SESSIONINFO_EX_LEVEL1 structure. § RpcWaitForSessionState as the State parameter. § RpcFilterByState as the State parameter.
107 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 § RpcGetEnumResultEx as the State member of the SESSIONENUM_LEVEL1, SESSIONENUM_LEVEL2, and SESSIONENUM_LEVEL3 structures. § RpcGetAllSessions as the State member of the EXECENVDATA_LEVEL1 and EXECENVDATA_LEVEL2 structures. hEnum: Handle to the session enumeration object. This is of type ENUM_HANDLE. It is used with TermSrvEnumeration methods. hNotify: Handle to the notification object. It is of type NOTIFY_HANDLE. It is used with TermSrvNotification methods.
UserSessions: The number of sessions which are of SESSIONTYPE_REGULARDESKTOP, or SESSIONTYPE_ALTERNATESHELL, or SESSIONTYPE_REMOTEAPP as defined in SESSIONTYPE (section 2.2.1.18). It is used with the RpcGetLoggedOnCount method and is returned as the pUserSessions parameter.
DeviceSessions: The number of sessions connected using media center extender device only. These sessions are of SESSIONTYPE_MEDIACENTEREXT as defined in SESSIONTYPE (section 2.2.1.18). It is used with the RpcGetLoggedOnCount method and is returned as the pDeviceSessions parameter. For more information on media center, see [MSFT-WINMCE].
PSESSIONENUM: Pointer to a structure containing information about the sessions running on the terminal server. This structure is described in detail in section 2.2.2.4. It is used with the RpcGetEnumResult method and returned as the ppSessionEnumResult parameter.
SessionInfo: Union of structures, each structure providing different levels of detail about sessions running on a computer. This union is described in detail in section 2.2.2.4.1. It is used with the RpcGetEnumResult method and returned as the Data field of the ppSessionEnumResult parameter.
SessionInfo_Ex: Union of structures, each structure providing different levels of detail about sessions running on a computer. This union is described in detail in section 2.2.2.5.1. It is used with the RpcGetEnumResultEx method and returned as the Data field of the ppSessionEnumResult parameter.
PSESSIONENUM_EX: Pointer to a structure containing information about the sessions running on the terminal server. This structure is described in detail in section 2.2.2.5. It is used with the RpcGetEnumResultEx method and returned as the ppSessionEnumResult parameter.
SESSIONTYPE: Represents the type of the session as described in section 2.2.1.18. It is used with the RpcGetSessionType method and returned as the pSessionType parameter.
ConnectTime: Represents the most recent time of a connection to the session. It is used with the RpcGetTimes method and returned as the pConnectTime parameter.
DisconnectTime: Represents the most recent time of a disconnection from the session. It is used with the RpcGetTimes method and returned as the pDisconnectTime parameter.
LogonTime: Represents the most recent time of a logon to the session. It is used with the RpcGetTimes method and returned as the pLogonTime parameter.
PLSMSESSIONINFORMATION: Pointer to a structure containing information about a session running on the terminal server. This structure is described in detail in section 2.2.2.8. It is used with the RpcGetSessionInformation method and returned as the pSessionInfo parameter.
PLSMSESSIONINFORMATION_EX: Pointer to a structure containing information about a session running on the terminal server. This structure is described in detail in section 2.2.2.9. It is used with the RpcGetSessionInformationEx method and returned as the LSMSessionInfoExPtr parameter.
PEXECENVDATA: Pointer to a structure containing information about the sessions running on the terminal server and the sessions running on virtual machines hosted on the server. This structure is described in detail in section 2.2.2.6. It is returned by the RpcGetAllSessions method.
108 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 EXECENVDATA_LEVEL1: Structure that contains basic information about sessions running on a computer. This structure is described in detail in section 2.2.2.6.1.1. It is used with the RpcGetAllSessions method.
EXECENVDATA_LEVEL2: Structure that contains information about sessions running on a computer that is more detailed than the information contained in EXECENVDATA_LEVEL1. This structure is described in detail in section 2.2.2.6.1.2. It is used with the RpcGetAllSessions method.
SESSION_FILTER: Represents the type of filter to apply when retrieving the list of session IDs running on a terminal server. It is described in section 2.2.2.1. It is used with the RpcGetSessionIds method as the Filter parameter.
SESSION_CHANGE: Structure containing the ID of a session running on a terminal server and a mask of the notifications that were received for that session. This structure is described in detail in section 2.2.2.42. It is used with the RpcWaitAsyncNotification method.
PEXECENVDATAEX: Pointer to a structure containing information about the sessions running on the terminal server and the sessions running on virtual machines hosted on the server. This structure is described in detail in section 2.2.2.7. It is returned by the RpcGetAllSessionsEx method.
EXECENVDATAEX_LEVEL1: Structure that contains basic information about sessions running on a computer. This structure is described in detail in section 2.2.2.7.1.1. It is used with the RpcGetAllSessionsEx method.
1118.3.2 Timers None.
1118.3.3 Initialization Parameters necessary to initialize the RPC protocol are specified in section 2.1.
1118.3.4 Processing Events and Sequencing Rules This protocol asks the RPC runtime to perform a strict Network Data Representation (NDR) data consistency check at target level 6.0 for all methods unless otherwise specified, as defined in [MS-RPCE] section 1.3. When a method completes, the values returned by RPC MUST be returned unmodified to the upper layer. The methods MAY throw exceptions and the Terminal Services client MUST handle these exceptions by returning the unmodified exception code to the upper layer.
1118.3.4.1 TermSrvSession Methods TermSrvSession provides methods that manage, and provide information about, a session on a given terminal server. The version for this interface is 1.0. For information about endpoints, UUID values, and versions, see sections 2.1 and 1.9. Methods in RPC Opnum Order Method Description
RpcOpenSession Returns a handle to a specified session on the terminal server. Opnum: 0
RpcCloseSession Closes the connection to the specified session on the terminal server. Opnum: 1
109 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 Method Description
RpcConnect Reconnects a session handle returned by RpcOpenSession to another specified session on the terminal server. Opnum: 2
RpcDisconnect Disconnects the specified session on the terminal server. Opnum: 3
RpcLogoff Logs off the specified session on the terminal server. Opnum: 4
RpcGetUserName Gets the username and domain name of the user logged on to the specified session on the terminal server. Opnum: 5
RpcGetTerminalName Gets the name of the terminal associated with the specified session on the terminal server. Opnum: 6
RpcGetState Gets the state of the specified session on the terminal server. Opnum: 7
RpcIsSessionDesktopLocked Checks whether the specified session on the terminal server is locked. Opnum: 8
RpcShowMessageBox Displays a message box, with a specified message and title, in the target user session running on the terminal server. Opnum: 9
RpcGetTimes Gets the connected, disconnected, and logged on time for the specified session on the terminal server. Opnum: 10
RpcGetSessionCounters Returns the various performance counters associated with the terminal server. Opnum: 11
RpcGetSessionInformation Retrieves information about a specified session running on a terminal server. Opnum: 12
Opnum13NotUsedOnWire Not implemented. Opnum: 13
Opnum14NotUsedOnWire Not implemented. Opnum: 14
RpcGetLoggedOnCount Gets the number of user-connected and device-connected sessions. Opnum: 15
RpcGetSessionType Gets the type of the specified session on a terminal server. Opnum: 16
RpcGetSessionInformationEx Retrieves extended information about a specified session running on a terminal server. Opnum: 17
Opnum18NotUsedOnWire Not implemented. Opnum: 18
Opnum19NotUsedOnWire Not implemented. Opnum: 19
1118.3.4.1.1 RpcOpenSession (Opnum 0)
110 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 The RpcOpenSession method returns a handle to a specified session on the terminal server. No special permissions are required to call this method.
1119 HRESULT RpcOpenSession(
1120 [in] handle_t hBinding,
1121 [in] LONG SessionId,
1122 [out] SESSION_HANDLE* phSession
1123 ); hBinding: The RPC binding handle. For more information, see [MSDN-RPCBIND].
SessionId: The identifier of the session to open. This session MUST be present on the terminal server, or this call will fail. This MUST NOT be the session ID of any of the listener sessions. phSession: A handle to the session. This is of type SESSION_HANDLE.
Return Values: The method MUST return S_OK (0x00000000) on success; otherwise, it MUST return an implementation-specific negative value.
Return value/code Description
0x00000000 Successful completion. S_OK
1123.1.1.1.1 RpcCloseSession (Opnum 1) The RpcCloseSession method closes the connection to the specified session on the terminal server. This method MUST be called after RpcOpenSession. The call to this method MUST be serialized if there are multiple threads running otherwise the behavior of this function is unknown. No special permissions are required to call this method.
1124 HRESULT RpcCloseSession(
1125 [in, out] SESSION_HANDLE* phSession
1126 ); phSession: Pointer to a handle to the session to close. The pointer is returned by RpcOpenSession. This is of type SESSION_HANDLE. The handle is set to NULL when the call returns.
Return Values: The method MUST return S_OK (0x00000000) on success; otherwise, it MUST return an implementation-specific negative value.
Return value/code Description
0x00000000 Successful completion. S_OK
1126.1.1.1.1 RpcConnect (Opnum 2)
111 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 The RpcConnect method reconnects a session handle returned by RpcOpenSession to another specified session on the terminal server. This method MUST be called after RpcOpenSession. If the method succeeds, the state of the session is State_Active as defined in the WINSTATIONSTATECLASS enumeration (section 2.2.1.9). The caller MUST have WINSTATION_CONNECT permission to connect the current session and the caller MUST have WINSTATION_DISCONNECT permission to disconnect the target session. For each aforementioned required permission, the method checks whether the caller has the permission (section 3.1.1) by setting the Access Request mask to the specific permission, and fails if the caller does not have the permission.
1127 HRESULT RpcConnect(
1128 [in] SESSION_HANDLE hSession,
1129 [in] LONG TargetSessionId,
1130 [in, string] WCHAR* szPassword
1131 ); hSession: The handle to a session returned by RpcOpenSession. This is of type SESSION_HANDLE.
TargetSessionId: The identifier of the session on the terminal server to which to reconnect the session handle. This session MUST be present on the terminal server or this call will fail. szPassword: The password of the user connected to the current session. This is an optional field. If not specified, the terminal server will impersonate the current user, making the call and checking whether it has permission to disconnect the current session.
Return Values: The method MUST return S_OK (0x00000000) on success; otherwise, it MUST return an implementation-specific negative value.
Return value/code Description
0x00000000 Successful completion. S_OK
1131.1.1.1.1 RpcDisconnect (Opnum 3) The RpcDisconnect method disconnects the specified session on the terminal server. This method MUST be called after RpcOpenSession. If the method succeeds, the state of the session is State_Disconnected as defined in the WINSTATIONSTATECLASS enumeration (section 2.2.1.9). The caller MUST have WINSTATION_DISCONNECT permission to disconnect the session. The method checks whether the caller has WINSTATION_DISCONNECT permission (section 3.1.1) by setting it as the Access Request mask, and fails if the caller does not have the permission.
1132 HRESULT RpcDisconnect(
1133 [in] SESSION_HANDLE hSession
112 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 1134 ); hSession: The handle to the session returned by RpcOpenSession. This is of type SESSION_HANDLE.
Return Values: The method MUST return S_OK (0x00000000) on success; otherwise, it MUST return an implementation-specific negative value.
Return value/code Description
0x00000000 Successful completion. S_OK
1134.1.1.1.1 RpcLogoff (Opnum 4) The RpcLogoff method logs off the specified session on the terminal server. This method MUST be called after RpcOpenSession. The caller MUST have WINSTATION_LOGOFF permission to log off the session. The method checks whether the caller has WINSTATION_LOGOFF permission (section 3.1.1) by setting it as the Access Request mask, and fails if the caller does not have the permission.
1135 HRESULT RpcLogoff(
1136 [in] SESSION_HANDLE hSession
1137 ); hSession: The handle to the session returned by RpcOpenSession. This is of type SESSION_HANDLE.
Return Values: The method MUST return S_OK (0x00000000) on success; otherwise, it MUST return an implementation-specific negative value.
Return value/code Description
0x00000000 Successful completion. S_OK
1137.1.1.1.1 RpcGetUserName (Opnum 5) The RpcGetUserName method gets the username and domain name of the user logged on to the specified session on the terminal server. This method MUST be called after RpcOpenSession. The caller MUST have WINSTATION_QUERY permission for the session. The method checks whether the caller has WINSTATION_QUERY permission (section 3.1.1) by setting it as the Access Request mask, and fails if the caller does not have the permission.
1138 HRESULT RpcGetUserName(
1139 [in] SESSION_HANDLE hSession,
1140 [out, string] WCHAR** pszUserName,
1141 [out, string] WCHAR** pszDomain
113 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 1142 ); hSession: The handle to the session returned by RpcOpenSession. This is of type SESSION_HANDLE. pszUserName: The name of the user who is logged on to the specific session. pszDomain: The domain to which the currently logged-on user belongs. If the terminal server is not joined to a domain, pszDomain will be the name of the terminal server computer.
Return Values: The method MUST return S_OK (0x00000000) on success; otherwise, it MUST return an implementation-specific negative value.
Return value/code Description
0x00000000 Successful completion. S_OK
1142.1.1.1.1 RpcGetTerminalName (Opnum 6) The RpcGetTerminalName method gets the name of the terminal associated with the specified session on the terminal server. This method MUST be called after RpcOpenSession. The caller MUST have WINSTATION_QUERY permission for the session. The method checks whether the caller has WINSTATION_QUERY permission (section 3.1.1) by setting it as the Access Request mask, and fails if the caller does not have the permission.
1143 HRESULT RpcGetTerminalName(
1144 [in] SESSION_HANDLE hSession,
1145 [out, string] WCHAR** pszTerminalName
1146 ); hSession: The handle to the session returned by RpcOpenSession. This is of type SESSION_HANDLE. pszTerminalName: The name of the terminal associated with the specific session.
Return Values: The method MUST return S_OK (0x00000000) on success; otherwise, it MUST return an implementation-specific negative value.
Return value/code Description
0x00000000 Successful completion. S_OK
1146.1.1.1.1 RpcGetState (Opnum 7) The RpcGetState method gets the state of the specified session on the terminal server. This method MUST be called after RpcOpenSession. The caller MUST have WINSTATION_QUERY permission for the session. The method checks whether the caller has WINSTATION_QUERY permission (section 3.1.1) by
114 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 setting it as the Access Request mask, and fails if the caller does not have the permission.
1147 HRESULT RpcGetState(
1148 [in] SESSION_HANDLE hSession,
1149 [out] LONG* plState
1150 ); hSession: The handle to the session returned by RpcOpenSession. This is of type SESSION_HANDLE. plState: The current state of the session as defined in WINSTATIONSTATECLASS (section 2.2.1.9).
Return Values: The method MUST return S_OK (0x00000000) on success; otherwise, it MUST return an implementation-specific negative value.
Return value/code Description
0x00000000 Successful completion. S_OK
1150.1.1.1.1 RpcIsSessionDesktopLocked (Opnum 8) The RpcIsSessionDesktopLocked method checks whether the specified session on the terminal server is in a locked state. This method MUST be called after RpcOpenSession. The caller MUST have WINSTATION_QUERY permission for the session. The method checks whether the caller has WINSTATION_QUERY permission (section 3.1.1) by setting it as the Access Request mask, and fails if the caller does not have the permission.
1151 HRESULT RpcIsSessionDesktopLocked(
1152 [in] SESSION_HANDLE hSession
1153 ); hSession: The handle to the session returned by RpcOpenSession. This is of type SESSION_HANDLE.
Return Values: The method MUST return S_OK (0x00000000) if the session is locked; otherwise, it MUST return an implementation-specific negative value.
Return value/code Description
0x00000000 Successful completion. S_OK
1153.1.1.1.1 RpcShowMessageBox (Opnum 9) The RpcShowMessageBox method displays a message box, with specified message and title, in the target user session running on the terminal server. This method MUST be called after RpcOpenSession. The caller MUST have WINSTATION_MSG permission for the session. The method checks whether the
115 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 caller has WINSTATION_MSG permission (section 3.1.1) by setting it as the Access Request mask, and fails if the caller does not have the permission.
1154 HRESULT RpcShowMessageBox(
1155 [in] SESSION_HANDLE hSession,
1156 [in, string] WCHAR* szTitle,
1157 [in, string] WCHAR* szMessage,
1158 [in] ULONG ulStyle,
1159 [in] ULONG ulTimeout,
1160 [out] ULONG* pulResponse,
1161 [in] BOOL bDoNotWait
1162 ); hSession: The handle to the session returned by RpcOpenSession. This is of type SESSION_HANDLE. szTitle: The title to assign to the message box. szMessage: The message to display inside the message box. ulStyle: Specifies the contents and behavior of the message box. This parameter can be a combination of flags specified for the uType parameter of the MessageBox function as defined in [MSDN- MSGBOX]. ulTimeout: The time in seconds for which to display the message box. This time-out value is managed by another system component which dismisses the message box if no user input is entered during this interval. pulResponse: Pointer to a variable that receives the user's response, which can be one of the following values. The values defined in [MSDN-MSGBOX].
Value Meaning
IDABORT The Abort button was selected. 3
IDCANCEL The Cancel button was selected. 2
IDIGNORE The Ignore button was selected. 5
IDNO The No button was selected. 7
IDOK The OK button was selected. 1
IDRETRY The Retry button was selected. 4
IDYES The Yes button was selected. 6
IDASYNC The bDoNotWait parameter was TRUE, so the function returned without waiting for a 32001 response.
116 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 Value Meaning
IDTIMEOUT The bDoNotWait parameter was FALSE and the time-out interval elapsed. 32000 bDoNotWait: Set to FALSE to wait for the message box to time-out or close, TRUE otherwise.
Return Values: The method MUST return S_OK (0x00000000) on success; otherwise, it MUST return an implementation-specific negative value.
Return value/code Description
0x00000000 Successful completion. S_OK
1162.1.1.1.1 RpcGetTimes (Opnum 10) The RpcGetTimes method gets the connected, disconnected, and logged-on time for the specified session on the terminal server. This method MUST be called after RpcOpenSession. The caller MUST have WINSTATION_QUERY permission for the session. The method checks whether the caller has WINSTATION_QUERY permission (section 3.1.1) by setting it as the Access Request mask, and fails if the caller does not have the permission.
1163 HRESULT RpcGetTimes(
1164 [in] SESSION_HANDLE hSession,
1165 [out] hyper* pConnectTime,
1166 [out] hyper* pDisconnectTime,
1167 [out] hyper* pLogonTime
1168 ); hSession: Handle to the session returned by RpcOpenSession. This is of type SESSION_HANDLE. pConnectTime: The most recent time of a connection to the session.
Time is measured as the number of 100-nanosecond intervals since January 1, 1601 (UTC). pDisconnectTime: The most recent time of a disconnection from the session.
Time is measured as the number of 100-nanosecond intervals since January 1, 1601 (UTC). pLogonTime: The most recent time of a logon to the session.
Time is measured as the number of 100-nanosecond intervals since January 1, 1601 (UTC).
Return Values: The method MUST return S_OK (0x00000000) on success; otherwise, it MUST return an implementation-specific negative value.
Return value/code Description
0x00000000 Successful completion. S_OK
117 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 1168.1.1.1.1 RpcGetSessionCounters (Opnum 11) The RpcGetSessionCounters method returns the various performance counters associated with the terminal server. No special permissions are required to call this method.
1169 HRESULT RpcGetSessionCounters(
1170 [in] handle_t hBinding,
1171 [in, out, size_is(uEntries)] TS_COUNTER pCounter,
1172 [in] ULONG uEntries
1173 ); hBinding: The RPC binding handle. For more information, see [MSDN-RPCBIND]. pCounter: An array of TS_COUNTER structures. The caller MUST set the dwCounterId field in the TS_COUNTER structures for each entry in the array to indicate the counter whose current value to retrieve. On return, the method MUST set the value for that performance counter. If the performance counter ID is not recognized or is not supported, the method will set the bResult field to 0. uEntries: The number of performance counters to query. Indicates the size of the array pointed to by the pCounter parameter.
Return Values: The method MUST return S_OK (0x00000000) on success; otherwise, it MUST return an implementation-specific negative value.
Return value/code Description
0x00000000 Successful completion. S_OK
1173.1.1.1.1 RpcGetSessionInformation (Opnum 12) The RpcGetSessionInformation method retrieves information about a specified session running on a terminal server. The caller MUST have WINSTATION_QUERY permission for the session. The method checks whether the caller has WINSTATION_QUERY permission (section 3.1.1) by setting it as the Access Request mask, and fails if the caller does not have the permission.
1174 HRESULT RpcGetSessionInformation(
1175 [in] handle_t hBinding,
1176 [in] LONG SessionId,
1177 [ref, out] PLSMSESSIONINFORMATION pSessionInfo
1178 ); hBinding: The RPC binding handle. For more information, see [MSDN-RPCBIND].
SessionId: The identifier of the session whose information is to be retrieved. pSessionInfo: A PLSMSESSIONINFORMATION element containing information about the session.
118 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 Return Values: The method MUST return S_OK (0x00000000) on success; otherwise, it MUST return an implementation-specific negative value.
Return value/code Description
0x00000000 Successful completion. S_OK
1178.1.1.1.1 RpcGetLoggedOnCount (Opnum 15) The RpcGetLoggedOnCount method gets the number of user-connected and device-connected sessions. No special permissions are required to call this method.
1179 HRESULT RpcGetLoggedOnCount(
1180 [in] handle_t hBinding,
1181 [out] ULONG* pUserSessions,
1182 [out] ULONG* pDeviceSessions
1183 ); hBinding: The RPC binding handle. For more information, see [MSDN-RPCBIND]. pUserSessions: The number of sessions that are of SESSIONTYPE_REGULARDESKTOP, or SESSIONTYPE_ALTERNATESHELL, or SESSIONTYPE_REMOTEAPP as defined in SESSIONTYPE (section 2.2.1.18). pDeviceSessions: The number of sessions connected using media center extender device only. These sessions are of SESSIONTYPE_MEDIACENTEREXT as defined in SESSIONTYPE (section 2.2.1.18). For more information on media center, see [MSFT-WINMCE].
Return Values: The method MUST return S_OK (0x00000000) on success; otherwise, it MUST return an implementation-specific negative value.
Return value/code Description
0x00000000 Successful completion. S_OK
1183.1.1.1.1 RpcGetSessionType (Opnum 16) The RpcGetSessionType method gets the type associated with the specified session. No special permissions are required to call this method.<149>
1184 HRESULT RpcGetSessionType(
1185 [in] handle_t hBinding,
1186 [in] LONG* SessionId,
1187 [out] ULONG* pSessionType
1188 );
119 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 hBinding: The RPC binding handle. For more information, see [MSDN-RPCBIND].
SessionId: The identifier of the session whose type is being retrieved. pSessionType: The type of the session as defined in SESSIONTYPE (section 2.2.1.18).
Return Values: The method MUST return S_OK (0x00000000) on success; otherwise, it MUST return an implementation-specific negative value.
Return value/code Description
0x00000000 Successful completion. S_OK
1188.1.1.1.1 RpcGetSessionInformationEx (Opnum 17) The RpcGetSessionInformationEx method retrieves extended information about a specified session running on a terminal server.<150> The caller MUST have WINSTATION_QUERY permission for the session. The method checks whether the caller has WINSTATION_QUERY permission (section 3.1.1) by setting it as the Access Request mask, and fails if the caller does not have the permission.
1189 HRESULT RpcGetSessionInformationEx(
1190 [in] handle_t hBinding,
1191 [in] LONG SessionId,
1192 [in] DWORD Level,
1193 [ref, out] PLSMSESSIONINFORMATION_EX LSMSessionInfoExPtr
1194 ); hBinding: The RPC binding handle. For more information, see [MSDN-RPCBIND].
Level: The level of the information to be retrieved. This MUST be 1.
LSMSessionInfoExPtr: A PLSMSESSIONINFORMATION_EX element containing information about the session.
Return Values: The method MUST return S_OK (0x00000000) on success; otherwise, it MUST return an implementation-specific negative value.
Return value/code Description
0x00000000 Successful completion. S_OK
1194.1.1.1 TermSrvNotification The TermSrvNotification, or LSM Notification interface, provides methods that manage asynchronous operations. Methods that initiate asynchronous operations return a pointer to an LSM Notification (TermSrvNotification) interface, allowing the caller to optionally cancel, or wait for, the status of the asynchronous operation. The version for this interface is 1.0.
120 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 For information about endpoints, UUID values, and versions, see sections 2.1 and 1.9. Methods in RPC Opnum Order Method Description
RpcWaitForSessionState Blocks until the state of the specified session running on a terminal server changes to the desired state. Opnum: 0
RpcRegisterAsyncNotification Registers for an event or events happening on a terminal server. Opnum: 1
RpcWaitAsyncNotification Starts the wait for the specified notification to be signaled by the terminal server. Opnum: 2
RpcUnRegisterAsyncNotification Cancels the asynchronous operation of waiting for notification from the terminal server. Opnum: 3
1194.1.1.1.1 RpcWaitForSessionState (Opnum 0) The RpcWaitForSessionState method blocks until the state of the specified session running on a terminal server changes to the desired state. The caller MUST have WINSTATION_QUERY permission for the session. The method checks whether the caller has WINSTATION_QUERY permission (section 3.1.1) by setting it as the Access Request mask, and fails if the caller does not have the permission.
1195 HRESULT RpcWaitForSessionState(
1196 [in] handle_t hBinding,
1197 [in] LONG SessionId,
1198 [in] LONG State,
1199 [in] ULONG Timeout
1200 ); hBinding: The RPC binding handle. For more information, see [MSDN-RPCBIND].
SessionId: The ID of the session for which to await state change. This MUST NOT be the session ID of any of the listener sessions.
State: The desired state of the session, as specified in WINSTATIONSTATECLASS (section 2.2.1.9) with the exception of State_Idle and State_Listen, for which to wait. The call will return when the session changes to this state.
Timeout: Maximum time, in milliseconds, to wait for the call to return.
Return Values: The method MUST return S_OK (0x00000000) on success; otherwise, it MUST return an implementation-specific negative value.
Return value/code Description
0x00000000 Successful completion.
121 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 Return value/code Description
S_OK
1200.1.1.1.1 RpcRegisterAsyncNotification (Opnum 1) The RpcRegisterAsyncNotification method registers for an event or events happening on a terminal server. The caller MUST call RpcWaitAsyncNotification after calling RpcRegisterAsyncNotification to wait for the notification. No special permissions are required to call this method.
1201 HRESULT RpcRegisterAsyncNotification(
1202 [in] handle_t hBinding,
1203 [in] LONG SessionId,
1204 [in] TNotificationId Mask,
1205 [out] NOTIFY_HANDLE* phNotify
1206 ); hBinding: The RPC binding handle. For more information, see [MSDN-RPCBIND].
SessionId: The ID of the session for which to wait for notification. If the value is -1, the call will register for notification for all sessions running on the terminal server. This MUST NOT be the session ID of any of the listener sessions.
Mask: Specifies the type of notification to wait for. This is of the type TNotificationId. phNotify: Handle to the notification object. For more information, see NOTIFY_HANDLE.
Return Values: The method MUST return S_OK (0x00000000) on success; otherwise, it MUST return an implementation-specific negative value.
Return value/code Description
0x00000000 Successful completion. S_OK
1206.1.1.1.1 RpcWaitAsyncNotification (Opnum 2) The RpcWaitAsyncNotification method starts the wait for the specified terminal server notification. The notification object specified in RpcRegisterAsyncNotification is called by RPC when a notification occurs. This is asynchronous notification and RpcWaitAsyncNotification starts the wait for notification and returns. Specify the notification object using RpcRegisterAsyncNotification and then start the notification wait process using RpcWaitAsyncNotification. No special permissions are required to call this method.
1207 HRESULT RpcWaitAsyncNotification(
1208 [in] NOTIFY_HANDLE hNotify,
122 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 1209 [out, size_is(, *pEntries)] PSESSION_CHANGE* SessionChange,
1210 [out] ULONG* pEntries
1211 ); hNotify: The notification handle returned by RpcRegisterAsyncNotification.
SessionChange: An array of type SESSION_CHANGE containing information about all the sessions and the notifications received for that session. pEntries: The number of entries returned in the SessionChange array.
Return Values: The method MUST return S_OK (0x00000000) on success; otherwise, it MUST return an implementation-specific negative value.
Return value/code Description
0x00000000 Successful completion. S_OK
1211.1.1.1.1 RpcUnRegisterAsyncNotification (Opnum 3) The RpcUnRegisterAsyncNotification method cancels the asynchronous operation of waiting for notification from the terminal server. This MUST be called after RpcRegisterAsyncNotification. The call to this method MUST be serialized if there are multiple threads running otherwise the behavior of this function is unknown. No special permissions are required to call this method.
1212 HRESULT RpcUnRegisterAsyncNotification(
1213 [in, out] NOTIFY_HANDLE* phNotify
1214 ); phNotify: The notification handle returned by RpcRegisterAsyncNotification. This is of type NOTIFY_HANDLE.
Return Values: The method MUST return S_OK (0x00000000) on success; otherwise, it MUST return an implementation-specific negative value.
Return value/code Description
0x00000000 Successful completion. S_OK
1214.1.1.1 TermSrvEnumeration The TermSrvEnumeration provides methods for enumerating sessions and session information. The version for this interface is 1.0. For information about endpoints, UUID values, and versions, see sections 2.1 and 1.9. Methods in RPC Opnum Order
123 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 Method Description
RpcOpenEnum Returns a handle of type ENUM_HANDLE, which can be used to query information about the sessions currently running on a terminal server. Opnum: 0
RpcCloseEnum Closes the enumeration object returned by RpcOpenEnum. This method MUST be called after RpcOpenEnum. Opnum: 1
RpcFilterByState Based on the state of the sessions, adds a filter to the session enumeration result running on a terminal server. Opnum: 2
RpcFilterByCallersName Based on the caller name, adds a filter to the session enumeration result running on a terminal server. Opnum: 3
RpcEnumAddFilter Adds another filter to the current enumeration. Opnum: 4
RpcGetEnumResult Returns a structure of the type PSESSIONENUM containing the list of sessions currently running on the terminal server after applying the specified filter. Opnum: 5
RpcFilterBySessionType Based on the type of the session, adds a filter to the session enumeration result running on a terminal server. Opnum: 6
Opnum7NotUsedOnWire Not implemented. Opnum: 7
RpcGetSessionIds Returns a list of the IDs associated with the sessions running on a terminal server that satisfies the specified filter. Opnum: 8
RpcGetEnumResultEx Returns a structure of PSESSIONENUM_EX containing the list of sessions currently running on the terminal server after applying the specified filter. Opnum: 9
RpcGetAllSessions Returns a structure of PEXECENVDATA containing the list of sessions currently running on the terminal server and the sessions currently running on the virtual machines hosted by the server. Opnum: 10
RpcGetAllSessionsEx Returns a structure of PEXECENVDATAEX containing the list of sessions currently running on the terminal server and the sessions currently running on the virtual machines hosted by the server. Opnum: 11
1214.1.1.1.1 RpcOpenEnum (Opnum 0) The RpcOpenEnum method returns a handle of the type ENUM_HANDLE, which can be used to query information about the sessions that are currently running on a terminal server. No special permissions are required to call this method. However, only sessions to which the caller has WINSTATION_QUERY permission are enumerated.
1215 HRESULT RpcOpenEnum(
1216 [in] handle_t hBinding,
1217 [out] ENUM_HANDLE* phEnum
124 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 1218 ); hBinding: The RPC binding handle. For more information, see [MSDN-RPCBIND]. phEnum: The handle to the session enumeration object. This is of type ENUM_HANDLE.
Return Values: The method MUST return S_OK (0x00000000) on success; otherwise, it MUST return an implementation-specific negative value.
Return value/code Description
0x00000000 Successful completion. S_OK
1218.1.1.1.1 RpcCloseEnum (Opnum 1) The RpcCloseEnum method closes the enumeration object returned by RpcOpenEnum. This method MUST be called after RpcOpenEnum. No special permissions are required to call this method.
1219 HRESULT RpcCloseEnum(
1220 [in, out] ENUM_HANDLE* phEnum
1221 ); phEnum: The handle to the session enumeration object. This is of type ENUM_HANDLE.
Return Values: The method MUST return S_OK (0x00000000) on success; otherwise, it MUST return an implementation-specific negative value.
Return value/code Description
0x00000000 Successful completion. S_OK
1221.1.1.1.1 RpcFilterByState (Opnum 2) The RpcFilterByState method adds a filter to the session enumeration result, running on a terminal server, based on the state of the sessions. This method MUST be called after RpcOpenEnum and before RpcGetEnumResult or RpcGetEnumResultEx. No special permissions are required to call this method.
1222 HRESULT RpcFilterByState(
1223 [in] ENUM_HANDLE hEnum,
1224 [in] LONG State,
1225 [in] BOOL bInvert
1226 ); hEnum: The handle to the session enumeration object. This is of type ENUM_HANDLE.
125 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 State: The session state, as specified in section 3.3.4.1.8, to be used to filter out the enumeration result. Only the sessions with the specified state will be returned. bInvert: Set to TRUE to imply that the result of the comparison during enumeration will be inverted, FALSE otherwise.
Return Values: The method MUST return S_OK (0x00000000) on success; otherwise, it MUST return an implementation-specific negative value.
Return value/code Description
0x00000000 Successful completion. S_OK
1226.1.1.1.1 RpcFilterByCallersName (Opnum 3) The RpcFilterByCallersName method adds a filter to the session enumeration result, running on a terminal server, based on the caller name. The enumeration will return only sessions belonging to the user making this call. This method MUST be called after RpcOpenEnum and before RpcGetEnumResult or RpcGetEnumResultEx. No special permissions are required to call this method.
1227 HRESULT RpcFilterByCallersName(
1228 [in] ENUM_HANDLE hEnum
1229 ); hEnum: The handle to the session enumeration object. This is of type ENUM_HANDLE.
Return Values: The method MUST return S_OK (0x00000000) on success; otherwise, it MUST return an implementation-specific negative value.
Return value/code Description
0x00000000 Successful completion. S_OK
1229.1.1.1.1 RpcEnumAddFilter (Opnum 4) The RpcEnumAddFilter method adds another filter to the current enumeration. This method MUST be called after RpcOpenEnum and before RpcGetEnumResult or RpcGetEnumResultEx. No special permissions are required to call this method.
1230 HRESULT RpcEnumAddFilter(
1231 [in] ENUM_HANDLE hEnum,
1232 [in] ENUM_HANDLE hSubEnum
1233 ); hEnum: The handle to the session enumeration object. This is of type ENUM_HANDLE.
126 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 hSubEnum: The handle to another enumeration whose filter will be applied to the current enumeration. The other enumeration MUST be created using RpcOpenEnum and any combination of RpcFilterByState, RpcFilterByCallersName, and RpcFilterBySessionType.
Return Values: The method MUST return S_OK (0x00000000) on success; otherwise, it MUST return an implementation-specific negative value.
Return value/code Description
0x00000000 Successful completion. S_OK
1233.1.1.1.1 RpcGetEnumResult (Opnum 5) The RpcGetEnumResult method returns a pointer of the type PSESSIONENUM which points to the list of sessions currently running on the terminal server after applying the specified filter. This method MUST be called after RpcOpenEnum. No special permissions are required to call this method. However, only sessions for which the caller has WINSTATION_QUERY permission are enumerated. The method checks whether the caller has WINSTATION_QUERY permission (section 3.1.1) by setting it as the Access Request mask, and skips the sessions for which the caller does not have the permission.
1234 HRESULT RpcGetEnumResult(
1235 [in] ENUM_HANDLE hEnum,
1236 [out, size_is(,*pEntries)] PSESSIONENUM* ppSessionEnumResult,
1237 [in] DWORD Level,
1238 [out] ULONG* pEntries
1239 ); hEnum: The handle to the session enumeration object. This is of type ENUM_HANDLE. ppSessionEnumResult: A pointer of the type PSESSIONENUM which points to the list of sessions currently running on the terminal server.
Level: The level of information requested. This field MUST be set to the supported values of 1 or 2. If the server does not support the level requested, it will set the level to the maximum supported level and return information accordingly.<151> pEntries: The number of sessions currently running on the terminal server and returned in the ppSessionEnumResult structure.
Return Values: The method MUST return S_OK (0x00000000) on success; otherwise, it MUST return an implementation-specific negative value.
Return value/code Description
0x00000000 Successful completion. S_OK
127 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 1239.1.1.1.1 RpcFilterBySessionType (Opnum 6) The RpcFilterBySessionType method adds a filter to the session enumeration result, running on a terminal server, based on the type of the session. This method MUST be called after RpcOpenEnum and before RpcGetEnumResult or RpcGetEnumResultEx. No special permissions are required to call this method.
1240 HRESULT RpcFilterBySessionType(
1241 [in] ENUM_HANDLE hEnum,
1242 [in] GUID* pSessionType
1243 ); hEnum: The handle to the session enumeration object. This is of type ENUM_HANDLE. pSessionType: The session GUID to be used to filter out the enumeration result. Only the session with the specified GUID will be returned.
Return Values: The method MUST return S_OK (0x00000000) on success; otherwise, it MUST return an implementation-specific negative value.
Return value/code Description
0x00000000 Successful completion. S_OK
1243.1.1.1.1 RpcGetSessionIds (Opnum 8) The RpcGetSessionIds method returns a list of the IDs associated with the sessions running on a terminal server that satisfy the specified filter. No special permissions are required to call this method. However, only sessions for which the caller has WINSTATION_QUERY permission are enumerated. The method checks whether the caller has WINSTATION_QUERY permission (section 3.1.1) by setting it as the Access Request mask, and skips sessions for which the caller does not have the permission.
1244 HRESULT RpcGetSessionIds(
1245 [in] handle_t hBinding,
1246 [in] SESSION_FILTER Filter,
1247 [in, range(0, 0xFFFF)] ULONG MaxEntries,
1248 [out, size_is(,*pcSessionIds)] LONG** pSessionIds,
1249 [out] ULONG* pcSessionIds
1250 ); hBinding: The RPC binding handle. For more information, see [MSDN-RPCBIND].
Filter: The filter to apply to the sessions running on the terminal server. This is of type SESSION_FILTER.
128 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 MaxEntries: The maximum number of session IDs to return. This value MUST be less than or equal to the number of entries in the pSessionIds array. pSessionIds: An array to contain the list of session IDs running on the terminal server and filtered as specified by Filter. pcSessionIds: The number of session IDs returned.
Return Values: The method MUST return S_OK (0x00000000) on success; otherwise, it MUST return an implementation-specific negative value.
Return value/code Description
0x00000000 Successful completion. S_OK
1250.1.1.1.1 RpcGetEnumResultEx (Opnum 9) The RpcGetEnumResultEx method returns a pointer of the type PSESSIONENUM_EX, which points to the list of sessions currently running on the terminal server after applying the specified filter. This method MUST be called after RpcOpenEnum. No special permissions are required to call this method. However, only sessions for which the caller has WINSTATION_QUERY permission are enumerated. The method checks whether the caller has WINSTATION_QUERY permission (section 3.1.1) by setting it as the Access Request mask, and skips the sessions for which the caller does not have the permission.
1251 HRESULT RpcGetEnumResultEx(
1252 [in] ENUM_HANDLE hEnum,
1253 [out, size_is(,*pEntries)] PSESSIONENUM_EX* ppSessionEnumResult,
1254 [in] DWORD Level,
1255 [out] ULONG* pEntries
1256 ); hEnum: The handle to the session enumeration object. This is of type ENUM_HANDLE. ppSessionEnumResult: A pointer of the type PSESSIONENUM_EX which points to the list of sessions currently running on the terminal server.
Level: The level of information requested. This field MUST be set to the supported values of 1, 2, or 3. If the server does not support the level requested, it will set the level to the maximum supported level and return information accordingly.<152>
Value Meaning
1 The union SessionInfo_Ex will have the SessionEnum_Level1 structure.
2 The union SessionInfo_Ex will have the SessionEnum_Level2 structure.
3 The union SessionInfo_Ex will have the SessionEnum_Level3 structure. pEntries: The number of sessions currently running on the terminal server and returned in the ppSessionEnumResult structure.
129 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 Return Values: The method MUST return S_OK (0x00000000) on success; otherwise, it MUST return an implementation-specific negative value.
Return value/code Description
0x00000000 Successful completion. S_OK
1256.1.1.1.1 RpcGetAllSessions (Opnum 10) The RpcGetAllSessions method returns a pointer of type PEXECENVDATA, which points to the list of sessions currently running on the terminal server and the sessions running on various virtual machines hosted by the server. No special permissions are required to call this method. However, only sessions for which the caller has WINSTATION_QUERY permission are enumerated. The method checks whether the caller has WINSTATION_QUERY permission (section 3.1.1) by setting it as the Access Request mask, and skips the sessions for which the caller does not have the permission.<153>
1257 HRESULT RpcGetAllSessions(
1258 [in] handle_t hBinding,
1259 [in, out] ULONG* pLevel,
1260 [out, size_is(,*pcEntries)] PEXECENVDATA* ppSessionData,
1261 [out] ULONG* pcEntries
1262 ); hBinding: The RPC binding handle. For more information, see [MSDN-RPCBIND]. pLevel: The level of information requested. This field MUST be set to the supported values of 1 or 2. If the server does not support the level requested, it will set the level to the maximum supported level and return an implementation-specific nonzero value.
Value Meaning
1 The union ExecEnvData will have the EXECENVDATA_LEVEL1 structure.
2 The union ExecEnvData will have the EXECENVDATA_LEVEL2 structure. ppSessionData: A pointer of type PEXECENVDATA (section 2.2.2.6), which points to the list of sessions currently running on the terminal server and the session running on virtual machines hosted by the server.<154> pcEntries: The number of sessions currently running on the terminal server and returned in the ppSessionData structure.
Return Values: The method MUST return S_OK (0x00000000) on success; otherwise, it MUST return an implementation-specific negative value.
Return value/code Description
0x00000000 Successful completion. S_OK
130 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 1262.1.1.1.1 RpcGetAllSessionsEx (Opnum 11) The RpcGetAllSessionsEx method returns a pointer of type PEXECENVDATAEX, which points to the list of sessions currently running on the terminal server and the sessions running on various virtual machines hosted by the server. No special permissions are required to call this method. However, only sessions for which the caller has WINSTATION_QUERY permission are enumerated. The method checks whether the caller has WINSTATION_QUERY permission (section 3.1.1) by setting it as the Access Request mask, and skips the sessions for which the caller does not have the permission.<155>
1263 HRESULT RpcGetAllSessionsEx(
1264 [in] handle_t hBinding,
1265 [in] ULONG Level,
1266 [out, size_is(,*pcEntries)] PEXECENVDATAEX* ppSessionData,
1267 [out] ULONG* pcEntries
1268 ); hBinding: The RPC binding handle. For more information, see [MSDN-RPCBIND].
Level: The level of information requested. This field MUST be set to 1. If the server does not support the level requested, it will set the level to the maximum supported level and return an implementation- specific nonzero value.
Value Meaning
1 The union ExecEnvDataEx has the EXECENVDATAEX_LEVEL1 structure. ppSessionData: A pointer of type PEXECENVDATAEX (section 2.2.2.7), which points to the list of sessions currently running on the terminal server and the sessions running on virtual machines hosted by the server. pcEntries: The number of sessions currently running on the terminal server and returned in the ppSessionData structure.
Return Values: The method MUST return S_OK (0x00000000) on success; otherwise, it MUST return an implementation-specific negative value.
Return value/code Description
0x00000000 Successful completion. S_OK
1268.1.1 Timer Events No protocol timer events are required on the client except the timers that are required in the underlying RPC transport.
1268.1.2 Other Local Events No local events are used on the server except the events maintained in the underlying RPC transport.
131 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 1268.2 TermSrv Client Details
1268.2.1 Abstract Data Model None.
1268.2.2 Timers No protocol timers are required except those used internally by RPC to implement resiliency to network outages, as specified in [MS-RPCE] section 3.3.3.2.1.
1268.2.3 Initialization The client MUST create an RPC connection to the terminal server using the details specified in section 2.1.
1268.2.4 Processing Events and Sequencing Rules When a method completes, the values returned by RPC MUST be returned unmodified to the upper layer.
1268.2.5 Timer Events None.
1268.2.6 Other Local Events None.
1268.3 TermSrv Server Details
1268.3.1 Abstract Data Model This section describes a conceptual model of possible data organization that an implementation maintains to participate in this protocol. The described organization is provided to facilitate the explanation of how the protocol behaves. This document does not mandate that implementations adhere to this model as long as their external behavior is consistent with that described in this document.
1268.3.1.1 Abstract Data Types
PROTOCOLSTATUS_INFO_TYPE: Specifies the protocol status information requested for a particular session running on a terminal server. It is defined in section 2.2.2.2. The following list shows how PROTOCOLSTATUS_INFO_TYPE is used with various methods. § RpcGetProtocolStatus: as the InfoType parameter. § RpcGetSessionProtocolLastInputTime: as the InfoType parameter.
QUERY_SESSION_DATA_TYPE: The type of data to retrieve about the session. It is used with RpcQuerySessionData and MUST be set to one of the values described in section 2.2.2.3.
132 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 WINSTATIONCLIENT: Structure that defines the client-requested configuration when connecting to a session. This structure is described in detail in section 2.2.2.19. It is used with the RpcGetClientData method.
PLISTENERENUM: Structure that contains information about a terminal server listener. This structure is described in detail in section 2.2.2.12. It is used with RpcGetAllListeners and returned as the ppListeners parameter.
WINSTATIONCONFIG: Structure that contains WinStation configuration data. This structure is described in detail in section 2.2.2.30.1. It is used with the RpcGetConfigData method.
PROTOCOLSTATUS: The status of the protocol used by the session. It is defined in section 2.2.2.20.1. It is used with the RpcGetProtocolStatus and RpcGetSessionProtocolLastInputTime methods.
PROTOCOLSTATUSEX: Structure defines the extended status of the protocol used by the session. This structure is described in detail in section 2.2.2.20.1.1. It is used with the RpcGetProtocolStatus and RpcGetSessionProtocolLastInputTime methods.
WDCONFIG: Structure containing the WinStation (session) driver configuration. This structure is described in detail in section 2.2.2.27. It is used with the RpcQuerySessionData method.
WINSTATIONCONFIG2: Structure that contains WinStation configuration data. This structure is described in detail in section 2.2.2.30. It is used with the RpcGetConfigData method.
CACHE_STATISTICS: Structure that represents cache statistics on the protocol. This structure is described in detail in section 2.2.2.20.1.3. It is used with the RpcGetProtocolStatus method.
PROTOCOLCOUNTERS: Structure that represents the status of the protocol used by the system. This structure is described in detail in section 2.2.2.20.1.2. It is used with the RpcGetProtocolStatus method.
WINSTATIONVALIDATIONINFORMATION: Structure that contains information that is required to identify and validate a per-device terminal server (TS) client access license (CAL) associated with the session. This structure is described in detail in section 2.2.2.51. It is used with the RpcQuerySessionData method.
RCM_REMOTEADDRESS: Structure that defines a remote address. This structure is described in detail in section 2.2.2.43. It is used with the RpcGetRemoteAddress method.
1268.3.2 Timers
MaxConnectionTime: The maximum allowed connection time setting of the session, in milliseconds. The session will disconnect/log off when the limit is reached.
MaxDisconnectionTime: The maximum allowed disconnect time of the session, in milliseconds. The session will disconnect/log off when the limit is reached.
MaxIdleTime: The maximum allowed idle time setting of the session, in milliseconds. The session will disconnect/log off when the limit is reached.
1268.3.3 Initialization The parameters necessary to initialize the RPC protocol are specified in section 2.1.
1268.3.4 Message Processing Events and Sequencing Rules This protocol asks the RPC runtime to perform a strict NDR data consistency check at target level 6.0 for all methods unless otherwise specified, as defined in [MS-RPCE] section 1.3.
133 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 When a method completes, the values returned by RPC MUST be returned unmodified to the upper layer. The methods MAY throw an exception and the Terminal Services client MUST handle these exceptions by returning the unmodified exception code to the upper layer.
1268.3.4.1 RCMPublic The RCMPublic interface methods provide data about clients and sessions, and enable shadowing sessions. The version for this interface is 1.0. For information about endpoints, UUID values, and versions, see sections 2.1 and 1.9. Methods in RPC Opnum Order Method Description
RpcGetClientData Returns information about the client that is connected to a particular session running on a terminal server. Opnum: 0
RpcGetConfigData Returns the configuration data that is associated with the user connected to a particular session running on a terminal server. Opnum: 1
RpcGetProtocolStatus Retrieves information about the status of the protocol that is used to connect to a particular session running on a terminal server. Opnum: 2
RpcGetLastInputTime Returns the time the last user input was received for the specified session running on a terminal server by the associated protocol. Opnum: 3
RpcGetRemoteAddress Retrieves the IP address of the client machine that is connected to the session on the terminal server. Opnum: 4
Opnum5NotUsedOnWire Not implemented. Opnum: 5
Opnum6NotUsedOnWire Not implemented. Opnum: 6
Opnum7NotUsedOnWire Not implemented. Opnum: 7
RpcGetAllListeners Returns a list of all Terminal Services listeners running on a terminal server. Opnum: 8
RpcGetSessionProtocolLastInputTime Returns the protocol status and time the last input was received by the protocol associated with a specific session running on a terminal server. Opnum: 9
RpcGetUserCertificates Returns the client X509 certificate used to connect to a session running on a terminal server. Opnum: 10
RpcQuerySessionData Returns information about a particular session running on a terminal server. Opnum: 11
1268.3.4.1.1 RpcGetClientData (Opnum 0)
134 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 The RpcGetClientData method returns information about the client that is connected to a particular session running on a terminal server. The caller must have WINSTATION_QUERY permission. The method checks whether the caller has WINSTATION_QUERY permission (section 3.1.1) by setting it as the Access Request mask, and fails if the caller does not have the permission.
1269 HRESULT RpcGetClientData(
1270 [in] handle_t hBinding,
1271 [in] ULONG SessionId,
1272 [out, size_is(,*pOutBuffByteLen)]
1273 unsigned char** ppBuff,
1274 [out] ULONG* pOutBuffByteLen
1275 ); hBinding: The RPC binding handle. For more information, see [MSDN-RPCBIND].
SessionId: The ID of the session from which client data is to be retrieved. ppBuff: The buffer that contains the client data. This data is of type PWINSTATIONCLIENT, specified in section 2.2.2.19. The buffer is allocated by RpcGetClientData. pOutBuffByteLen: The number of bytes of client data that is returned.
Return Values: The method MUST return S_OK (0x00000000) on success; otherwise, it MUST return an implementation-specific negative value.
Return value/code Description
0x00000000 Successful completion. S_OK
1275.1.1.1.1 RpcGetConfigData (Opnum 1) The RpcGetConfigData method returns the configuration data associated with the user connected to a particular session running on a terminal server. The caller MUST have WINSTATION_QUERY permission. The method checks whether the caller has WINSTATION_QUERY permission (section 3.1.1) by setting it as the Access Request mask, and fails if the caller does not have the permission.<156>
1276 HRESULT RpcGetConfigData(
1277 [in] handle_t hBinding,
1278 [in] ULONG SessionId,
1279 [out, size_is(,*pOutBuffByteLen )]
1280 unsigned char** ppBuff,
135 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 1281 [out] ULONG* pOutBuffByteLen
1282 ); hBinding: The RPC binding handle. For more information, see [MSDN-RPCBIND].
SessionId: The ID of the session for which the client configuration data is to be retrieved. ppBuff: The buffer that will contain the client configuration data. This will be allocated by RpcGetConfigData. This data is of type PWINSTATIONCONFIG. pOutBuffByteLen: The number of bytes of client configuration data that is returned.
Return Values: The method MUST return S_OK (0x00000000) on success; otherwise, it MUST return an implementation-specific negative value.
Return value/code Description
0x00000000 Successful completion. S_OK
1282.1.1.1.1 RpcGetProtocolStatus (Opnum 2) The RpcGetProtocolStatus method retrieves information about the status of the protocol used to connect to a particular session running on a terminal server. The caller MUST have WINSTATION_QUERY permission for the session. The method checks whether the caller has WINSTATION_QUERY permission (section 3.1.1) by setting it as the Access Request mask, and fails if the caller does not have the permission.
1283 HRESULT RpcGetProtocolStatus(
1284 [in] handle_t hBinding,
1285 [in] ULONG SessionId,
1286 [in] PROTOCOLSTATUS_INFO_TYPE InfoType,
1287 [out, size_is(,*pcbProtoStatus )]
1288 unsigned char** ppProtoStatus,
1289 [out] ULONG* pcbProtoStatus
1290 ); hBinding: The RPC binding handle. For more information, see [MSDN-RPCBIND].
SessionId: The ID of the session for which protocol status is to be retrieved.
InfoType: Specifies what type of information to gather. This is of the type PROTOCOLSTATUS_INFO_TYPE. ppProtoStatus: The buffer that will contain protocol status data. This data is of the type PROTOCOLSTATUS. pcbProtoStatus: The number of bytes of protocol data that is returned.
136 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 Return Values: The method MUST return S_OK (0x00000000) on success; otherwise, it MUST return an implementation-specific negative value.
Return value/code Description
0x00000000 Successful completion S_OK
1290.1.1.1.1 RpcGetLastInputTime (Opnum 3) The RpcGetLastInputTime method returns the time the last user input was received by the associated protocol for the specified sessions running on a terminal server. The caller MUST have WINSTATION_QUERY permission for the session. The method checks whether the caller has WINSTATION_QUERY permission (section 3.1.1) by setting it as the Access Request mask, and fails if the caller does not have the permission.
1291 HRESULT RpcGetLastInputTime(
1292 [in] handle_t hBinding,
1293 [in] ULONG SessionId,
1294 [out] hyper* pLastInputTime
1295 ); hBinding: The RPC binding handle. For more information, see [MSDN-RPCBIND].
SessionId: The ID of the session for which the last user input time is to be retrieved. pLastInputTime: The time when the last user input was received by the server. This is a 64-bit value representing the number of 100-nanosecond intervals since January 1, 1601 (UTC).
Return Values: The method MUST return S_OK (0x00000000) on success; otherwise, it MUST return an implementation-specific negative value.
Return value/code Description
0x00000000 Successful completion S_OK
1295.1.1.1.1 RpcGetRemoteAddress (Opnum 4) The RpcGetRemoteAddress method retrieves the IP address of the client computer connected to the session on the terminal server. The caller MUST have WINSTATION_QUERY permission for the session. The method checks whether the caller has WINSTATION_QUERY permission (section 3.1.1) by setting it as the Access Request mask, and fails if the caller does not have the permission.
1296 HRESULT RpcGetRemoteAddress(
1297 [in] handle_t hBinding,
137 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 1298 [in] ULONG SessionId,
1299 [out] PRCM_REMOTEADDRESS pRemoteAddress
1300 ); hBinding: The RPC binding handle. For more information, see [MSDN-RPCBIND].
SessionId: The ID of the session for which client data is to be retrieved. pRemoteAddress: The address of the client computer that is connected to the session. This is of the type PRCM_REMOTEADDRESS.
Return Values: The method MUST return S_OK (0x00000000) on success; otherwise, it MUST return an implementation-specific negative value.
Return value/code Description
0x00000000 Successful completion. S_OK
1300.1.1.1.1 RpcGetAllListeners (Opnum 8) The RpcGetAllListeners method returns a list of all Terminal Services listeners running on a terminal server. No special permissions are required to call this method. However, only listeners for which the caller has WINSTATION_QUERY permission are enumerated.
1301 HRESULT RpcGetAllListeners(
1302 [in] handle_t hBinding,
1303 [out, size_is(,*pNumListeners)]
1304 PLISTENERENUM* ppListeners,
1305 [in] DWORD Level,
1306 [out] ULONG* pNumListeners
1307 ); hBinding: The RPC binding handle. For more information, see [MSDN-RPCBIND]. ppListeners: The list of Terminal Services listeners running on the terminal server. This is an array of type PLISTENERENUM.
Level: The level of information that is requested for the listeners. The only supported value is 1. pNumListeners: The number of listeners returned.
Return Values: The method MUST return S_OK (0x00000000) on success; otherwise, it MUST return an implementation-specific negative value.
Return value/code Description
0x00000000 Successful completion.
138 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 Return value/code Description
S_OK
1307.1.1.1.1 RpcGetSessionProtocolLastInputTime (Opnum 9) The RpcGetSessionProtocolLastInputTime method returns the protocol status and the time the last input was received by the protocol associated with a specific session running on a terminal server. The caller MUST have WINSTATION_QUERY permission for the session. The method checks whether the caller has WINSTATION_QUERY permission (section 3.1.1) by setting it as the Access Request mask, and fails if the caller does not have the permission.
1308 HRESULT RpcGetSessionProtocolLastInputTime(
1309 [in] handle_t hBinding,
1310 [in] ULONG SessionId,
1311 [in] PROTOCOLSTATUS_INFO_TYPE InfoType,
1312 [out, size_is(,*pcbProtoStatus )]
1313 unsigned char** ppProtoStatus,
1314 [out] ULONG* pcbProtoStatus,
1315 [out] hyper* pLastInputTime
1316 ); hBinding: The RPC binding handle. For more information, see [MSDN-RPCBIND].
SessionId: The ID of the session from which information is to be retrieved.
InfoType: Specifies what type of information to gather. This is of type PROTOCOLSTATUS_INFO_TYPE. ppProtoStatus: The buffer that contains protocol status data. This data is of type PROTOCOLSTATUS, specified in section 2.2.2.20.1. pcbProtoStatus: The number of bytes of protocol data returned. pLastInputTime: The time the last input was received by the server.
Time is measured as the number of 100-nanosecond intervals since January 1, 1601 (UTC).
Return Values: The method MUST return S_OK (0x00000000) on success; otherwise, it MUST return an implementation-specific negative value.
Return value/code Description
0x00000000 Successful completion S_OK
1316.1.1.1.1 RpcGetUserCertificates (Opnum 10)
139 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 The RpcGetUserCertificates method returns a client X509 certificate if the client used the certificate to connect to a session running on a terminal server. For more information, see [X509]. The caller MUST have WINSTATION_QUERY permission for the session. The method checks whether the caller has WINSTATION_QUERY permission (section 3.1.1) by setting it as the Access Request mask, and fails if the caller does not have the permission.
1317 HRESULT RpcGetUserCertificates(
1318 [in] handle_t hBinding,
1319 [in] ULONG SessionId,
1320 [out] ULONG* pcCerts,
1321 [out, size_is(, *pcbCerts)] byte** ppbCerts,
1322 [out] ULONG* pcbCerts
1323 ); hBinding: The RPC binding handle. For more information, see [MSDN-RPCBIND].
SessionId: The ID of the session for which the certificate is to be retrieved. pcCerts: The number of client certificates returned. ppbCerts: Certificate data. pcbCerts: The size, in bytes, of ppbCerts.
Return Values: The method MUST return S_OK (0x00000000) on success; otherwise, it MUST return an implementation-specific negative value.
Return value/code Description
0x00000000 Successful completion. S_OK
1323.1.1.1.1 RpcQuerySessionData (Opnum 11) The RpcQuerySessionData method returns information about a particular session running on a terminal server. The caller MUST have WINSTATION_QUERY permission to the session being queried. The method checks whether the caller has WINSTATION_QUERY permission (section 3.1.1) by setting it as the Access Request mask, and fails if the caller does not have the permission.
1324 HRESULT RpcQuerySessionData(
1325 [in] handle_t hBinding,
1326 [in] ULONG SessionId,
1327 [in] QUERY_SESSION_DATA_TYPE type,
140 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 1328 [in, unique, size_is(cbInputData )]
1329 byte* pbInputData,
1330 [in, range(0, 8192)] DWORD cbInputData,
1331 [out, ref, size_is(cbSessionData), length_is(*pcbReturnLength)]
1332 byte* pbSessionData,
1333 [in, range(0, 8192)] ULONG cbSessionData,
1334 [out, ref] ULONG* pcbReturnLength,
1335 [out, ref] ULONG* pcbRequireBufferSize
1336 ); hBinding: The RPC binding handle. For more information, see [MSDN-RPCBIND].
SessionId: The ID of the session for which data is to be retrieved. type: The type of data to retrieve about the session. This is of type QUERY_SESSION_DATA_TYPE. pbInputData: Input data. This is a string specifying the name of the virtual channel and is required only when querying virtual channel information. cbInputData: The size, in bytes, of input data. pbSessionData: The output data containing the requested information. The data returned is of type WDCONFIG if the type specified is QUERY_SESSION_DATA_WDCONFIG. It is of type WINSTATIONVALIDATIONINFORMATION if the type specified is QUERY_SESSION_DATA_LICENSE_VALIDATION. For other types, it is protocol-specific. cbSessionData: The size, in bytes, of pbSessionData. pcbReturnLength: The length of the returned data, in bytes. pcbRequireBufferSize: The buffer size, in bytes, required by the returned data.
Return Values: The method MUST return S_OK (0x00000000) on success; otherwise, it MUST return an implementation-specific negative value.
Return value/code Description
0x00000000 Successful completion S_OK
1336.1.1.1 RCMListener The RCMListener interface provides methods that open, close, start, and stop a listener. The version for this interface is 1.0. For information about endpoints, UUID values, and versions, see sections 2.1 and 1.9. Methods in RPC Opnum Order
141 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 Method Description
RpcOpenListener Returns a handle to the specified Terminal Services listener running on a terminal server. Opnum: 0
RpcCloseListener Closes the handle for a Terminal Services listener running on a terminal server. Opnum: 1
RpcStopListener Stops the specified Terminal Services listener running on a terminal server. Opnum: 2
RpcStartListener Starts the specified Terminal Services listener on a terminal server. Opnum: 3
RpcIsListening Checks if the specified Terminal Services listener is running on a terminal server. Opnum: 4
1336.1.1.1.1 RpcOpenListener (Opnum 0) The RpcOpenListener method returns a handle to the specified Terminal Services listener running on a terminal server. No special permissions are required to call this method.
1337 HRESULT RpcOpenListener(
1338 [in] handle_t hBinding,
1339 [in, string] WCHAR* szListenerName,
1340 [out] HLISTENER* phListener
1341 ); hBinding: The RPC binding handle. For more information, see [MSDN-RPCBIND]. szListenerName: The name of the listener for which to retrieve a handle. phListener: Pointer to a handle to the listener. The handle is of type HLISTENER.
Return Values: The method MUST return S_OK (0x00000000) on success; otherwise, it MUST return an implementation-specific negative value.
Return value/code Description
0x00000000 Successful completion. S_OK
1341.1.1.1.1 RpcCloseListener (Opnum 1) The RpcCloseListener method closes the handle for a Terminal Services listener running on a terminal server. This MUST be called after RpcOpenListener. The call to this method MUST be serialized if there are multiple threads running otherwise the behavior of this function is unknown. No special permissions are required to call this method.
1342 HRESULT RpcCloseListener(
142 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 1343 [in, out] HLISTENER* phListener
1344 ); phListener: Pointer to a handle to the listener as returned by RpcOpenListener. The handle is of type HLISTENER. The handle is set to NULL when the call returns.
Return Values: The method MUST return S_OK (0x00000000) on success; otherwise, it MUST return an implementation-specific negative value.<157>
Return value/code Description
0x00000000 Successful completion. S_OK
1344.1.1.1.1 RpcStopListener (Opnum 2) The RpcStopListener method stops the specified Terminal Services listener running on a terminal server. This MUST be called after RpcOpenListener. The caller MUST have WINSTATION_RESET permission to the listener. The method checks whether the caller has WINSTATION_RESET permission (section 3.1.1) by setting it as the Access Request mask, and fails if the caller does not have the permission.
1345 HRESULT RpcStopListener(
1346 [in] HLISTENER hListener
1347 ); hListener: The handle to the listener. This is of type HLISTENER.
Return Values: The method MUST return S_OK (0x00000000) on success; otherwise, it MUST return an implementation-specific negative value.
Return value/code Description
0x00000000 Successful completion. S_OK
1347.1.1.1.1 RpcStartListener (Opnum 3) The RpcStartListener method starts the specified Terminal Services listener on a terminal server. This MUST be called after RpcOpenListener. The caller MUST have WINSTATION_RESET and WINSTATION_QUERY permissions to the listener. The method checks whether the caller has WINSTATION_RESET and WINSTATION_QUERY permission (section 3.1.1) by setting it as the Access Request mask, and fails if the caller does not have the permissions.
1348 HRESULT RpcStartListener(
1349 [in] HLISTENER hListener
143 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 1350 ); hListener: The handle to the listener. This is of type HLISTENER.
Return Values: The method MUST return S_OK (0x00000000) on success; otherwise, it MUST return an implementation-specific negative value.
Return value/code Description
0x00000000 Successful completion. S_OK
1350.1.1.1.1 RpcIsListening (Opnum 4) The RpcIsListening method checks whether the specified Terminal Services listener is running on a terminal server. This MUST be called after RpcOpenListener. The caller MUST have WINSTATION_QUERY permission to the listener. The method checks whether the caller has WINSTATION_QUERY permission (section 3.1.1) by setting it as the Access Request mask, and fails if the caller does not have the permission.
1351 HRESULT RpcIsListening(
1352 [in] HLISTENER hListener,
1353 [out] BOOL* pbIsListening
1354 ); hListener: The handle to the listener. This is of type HLISTENER. pbIsListening: Set to TRUE if the listener is listening for a connection, FALSE otherwise.
Return Values: The method MUST return S_OK (0x00000000) on success; otherwise, it MUST return an implementation-specific negative value.
Return value/code Description
0x00000000 Successful completion. S_OK
1354.1.1 Timer Events None.
1354.1.2 Other Local Events None.
144 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 1354.2 Legacy Client Details
1354.2.1 Abstract Data Model None.
1354.2.2 Timers No protocol timers are required beyond those used internally by RPC to implement resiliency to network outages, as specified in [MS-RPCE].
1354.2.3 Initialization The client MUST create an RPC connection to the terminal server, using the details specified in section 2.1.
1354.2.4 Message Processing Events and Sequencing Rules When a method completes, the values returned by RPC MUST be returned unmodified to the upper layer.
1354.2.5 Timer Events There are no timer events.
1354.2.6 Other Local Events None.
1354.3 Legacy Server Details
1354.3.1 Abstract Data Model This section describes a conceptual model of possible data organization that an implementation maintains to participate in this protocol. The described organization is provided to facilitate the explanation of how the protocol behaves. This document does not mandate that implementations adhere to this model as long as their external behavior is consistent with that described in this document.
1354.3.1.1 Abstract Data Types dwCounterID: Identifier of a performance counter. It is used with RpcWinStationGetTermSrvCountersValue and MUST be set to one of the values described in section 2.2.2.17.1. hServer: Handle to the server object. This is of type SERVER_HANDLE. This handle is returned by the RpcWinStationOpenServer method and is used as an input parameter with all other LegacyApi methods.
PDCONFIG2: Structure that contains the protocol driver's software configuration. This structure is described in detail in section 2.2.2.26.1. It is returned by the RpcWinStationQueryInformation method as part of transport protocol driver configuration data.
WinStationInformation: Provides the current values of various properties for a session such as state, connect time, last input time, and so on. It is used with RpcWinStationQueryInformation and is
145 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 returned as the pWinStationInformation parameter when "WinStationInformation" is passed as the WinStationInformationClass parameter.
WINSTATIONPRODID: Structure that represents a product ID for the session. This structure is described in detail in section 2.2.2.36. It is used with RpcWinStationQueryInformation and is returned as the pWinStationInformation parameter when "WinStationDigProductId" is passed as the WinStationInformationClass parameter.
WINSTATIONUSERTOKEN: Structure that defines the user token for a session. This structure is described in detail in section 2.2.2.32. It is used with RpcWinStationQueryInformation and is returned as the pWinStationInformation parameter when "WinStationUserToken" is passed as the WinStationInformationClass parameter.
POLICY_TS_MACHINE: Structure that defines the machine policy of the server. This structure is described in detail in section 2.2.2.31. It is used with the RpcWinStationGetMachinePolicy method and is returned as the pPolicy parameter.
WINSTATIONINFOCLASS: Enumeration that specifies the class of data to retrieve. It is defined in section 2.2.1.8. The following list shows how WINSTATIONINFOCLASS is used with various methods. § RpcWinStationQueryInformation: as the WinStationInformationClass parameter. § RpcWinStationSetInformation: as the WinStationInformationClass parameter.
USERCONFIG: Structure that contains user and session configuration information. This structure is described in detail in section 2.2.2.18. It is used with the RpcWinStationQueryInformation and RpcWinStationSetInformation methods.
WINSTATIONCLIENT: Structure that defines the client-requested configuration when connecting to a session. This structure is described in detail in section 2.2.2.19. It is used with the RpcWinStationQueryInformation method.
LOGONID: Structure that represents information about the session or WinStation. This structure is described in detail in section 2.2.2.13. It is used with the RpcWinStationEnumerate method and is returned as the pLogonId parameter.
TS_PROCESS_INFORMATION_NT4: Structure that represents information about a process running in a session. This structure is described in detail in section 2.2.2.14. It is used with the RpcWinStationEnumerateProcesses method and is returned inside the pProcessBuffer parameter.
TS_ALL_PROCESS_INFO: Structure that contains data about all the processes running on the system that are accessible to a user. This structure is described in detail in section 2.2.2.15. It is used with the RpcWinStationGetAllProcesses method and is returned as the ppTsAllProcessesInfo parameter.
TS_SYS_PROCESS_INFORMATION: Structure that contains information about a process running in a session. This structure is described in detail in section 2.2.2.15.1. It is used with the RpcWinStationEnumerateProcesses method and is returned inside the pProcessBuffer parameter.
TS_PROCESS_INFORMATION_NT6: Structure that represents information about a process running in a session. This structure is described in detail in section 2.2.2.16. It is used with the RpcWinStationGetAllProcesses_NT6 method and is returned inside the ppTsAllProcessesInfo parameter.
PDPARAMS: Structure containing the protocol driver parameters. This structure is described in detail in section 2.2.2.21. It is used with the RpcWinStationQueryInformation and RpcWinStationSetInformation methods.
PDPARAMSWIRE: Structure precedes a PDPARAMS structure and defines the size and offset of the PDPARAMS structures in the complete data BLOB. This structure is described in detail in section
146 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 2.2.2.46. It is used with the RpcWinStationQueryInformation and RpcWinStationSetInformation methods.
PdName: String containing the transport protocol type. This MUST be any of the following strings: "tcp", "netbios", "ipx", or "spx". It is used with the RpcWinStationGetLanAdapterName method as the pPdName parameter.
WDCONFIG: Structure containing the WinStation (session) driver configuration. This structure is described in detail in section 2.2.2.27. It is used with the RpcWinStationQueryInformation method.
CDCONFIG: Structure that represents connection driver configuration. This structure is described in detail in section 2.2.2.28. It is used with RpcWinStationQueryInformation and is returned as the pWinStationInformation parameter when "WinStationCd" is passed as the WinStationInformationClass parameter.
WINSTATIONCREATE: Structure that represents a session to which the user can connect. This structure is described in detail in section 2.2.2.29. It is used with RpcWinStationQueryInformation and is returned as the pWinStationInformation parameter when "WinStationCreateData" is passed as the WinStationInformationClass parameter.
WINSTATIONVIDEODATA: Structure that represents the resolution and color depth of a session. This structure is described in detail in section 2.2.2.33. It is used with RpcWinStationQueryInformation and is returned as the pWinStationInformation parameter when "WinStationVideoData" is passed as the WinStationInformationClass parameter.
WINSTATIONLOADINDICATORDATA: Structure that represents the data used for the load balancing of a server. This structure is described in detail in section 2.2.2.34. It is used with RpcWinStationQueryInformation and is returned as the pWinStationInformation parameter when "WinStationLoadIndicator" is passed as the WinStationInformationClass parameter.
WINSTATIONSHADOW: Structure that represents the current shadow state of a session. This structure is described in detail in section 2.2.2.35. The following list shows how WINSTATIONSHADOW is used with various methods. § RpcWinStationQueryInformation: as the pWinStationInformation parameter when "WinStationShadowInfo" is passed as the WinStationInformationClass parameter. § RpcWinStationSetInformation: as the pWinStationInformation parameter when "WinStationShadowInfo" is passed as the WinStationInformationClass parameter.
DEVICENAME: Represents the name of a device. It is described in detail in section 2.2.1.7 and is used with RpcWinStationGetLanAdapterName.
WINSTATIONNAME: Represents the name of a session. It is described in detail in section 2.2.1.5 and is used with RpcLogonIdFromWinStationName.
WINSTATIONREMOTEADDRESS: Structure that contains the client's remote address. This structure is described in detail in section 2.2.2.37. It is returned by the RpcWinStationQueryInformation method.
IdleTime: Represents the idle time for the session, in seconds. It is of type ULONG. It is used with RpcWinStationQueryInformation and is returned as the pWinStationInformation parameter when "WinStationIdleTime" is passed as the WinStationInformationClass parameter.
LastReconnectType: Represents the last reconnect type for the session. It is of type ULONG. It is used with RpcWinStationQueryInformation and is returned as the pWinStationInformation parameter when "WinStationReconnectType" is passed as the WinStationInformationClass parameter.
WinStationVirtualData: Represents client virtual data. It is of type BYTE. It is used with RpcWinStationQueryInformation and is returned as the pWinStationInformation parameter when "WinStationVirtualData" is passed as the WinStationInformationClass parameter.
147 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 WINSTATIONCLIENTDATA: Structure used to send data to the client. It is described in 2.2.2.41. It is used with RpcWinStationSetInformation and is returned as the pWinStationInformation parameter when "WinStationClientData" is passed as the WinStationInformationClass parameter.
TS_TRACE: Structure that specifies fields used for configuring tracing operations in TS binaries if they are checked. This structure is described in detail in section 2.2.2.39. It is used with the RpcWinStationSetInformation method.
WINSTACONFIGWIRE: Structure precedes a variable length user configuration data BLOB and defines the size and offset of the user configuration data. This structure is described in detail in section 2.2.2.47. It is used with the RpcWinStationQueryInformation and RpcWinStationSetInformation methods.
1354.3.2 Timers
Send Message Timeout: The time, in seconds, that the RpcWinStationSendMessage method waits for the user's response to the message box displayed by that method. For more information, see description of the Timeout parameter to the RpcWinStationSendMessage method.
1354.3.3 Initialization Parameters necessary to initialize the RPC protocol are specified in section 2.1.
1354.3.4 Message Processing Events and Sequencing Rules This protocol asks the RPC runtime to perform a strict NDR data-consistency check at target level 6.0 for all methods, unless otherwise specified, as defined in [MS-RPCE] section 1.3. When a method completes, the values returned by RPC MUST be returned unmodified to the upper layer. The methods MAY throw an exception and the Terminal Services client MUST handle these exceptions by returning the unmodified exception code to the upper layer. Legacy server methods are part of the LegacyApi interface.
1354.3.4.1 LegacyApi The LegacyApi provides legacy methods that manipulate a terminal client. The version for this interface is 1.0. For endpoints, UUID values, and versions, see sections 2.1 and 1.9. Methods in RPC Opnum Order Method Description
RpcWinStationOpenServer Returns a server handle that can be used in other WinStation API methods for querying information on the WinStation (sessions) on the server. Opnum: 0
RpcWinStationCloseServer Closes the server handle for WinStation APIs. Opnum: 1
RpcIcaServerPing Verifies that the server is alive. Opnum: 2
RpcWinStationEnumerate Retrieves a list of LOGONID structures for sessions on a terminal server. Opnum: 3
RpcWinStationRename Enables the caller to change the name of the session.
148 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 Method Description
Opnum: 4
RpcWinStationQueryInformation Retrieves various types of configuration information on a session. Opnum: 5
RpcWinStationSetInformation Sets various types of configuration information for a session. Opnum: 6
RpcWinStationSendMessage Displays a message box on a given terminal server session and, optionally, waits for a reply. Opnum: 7
RpcLogonIdFromWinStationName Given a session name, returns the session's session ID. Opnum: 8
RpcWinStationNameFromLogonId Retrieves the Windows Station (WinStation) name for a specific session. Opnum: 9
RpcWinStationConnect Connects a user's terminal server client from a given terminal server session to a different terminal server session. Opnum: 10
Opnum11NotUsedOnWire Reserved for local use. Opnum: 11
Opnum12NotUsedOnWire Reserved for local use. Opnum: 12
RpcWinStationDisconnect On the server, disconnects the terminal server client from a session. Opnum: 13
RpcWinStationReset Resets a session. Opnum: 14
RpcWinStationShutdownSystem Shuts down the system and, optionally, logs off all sessions. May also reboot the system. Opnum: 15
RpcWinStationWaitSystemEvent Waits synchronously for a system event from an RPC API request on behalf of the caller. Opnum: 16
RpcWinStationShadow Starts a shadow operation (remote control) of another terminal server session. Opnum: 17
Opnum18NotUsedOnWire Reserved for local use. Opnum: 18
Opnum19NotUsedOnWire Reserved for local use. Opnum: 19
Opnum20NotUsedOnWire Reserved for local use. Opnum: 20
Opnum21NotUsedOnWire Reserved for local use. Opnum: 21
Opnum22NotUsedOnWire Reserved for local use. Opnum: 22
Opnum23NotUsedOnWire Reserved for local use. Not implemented. Opnum: 23
149 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 Method Description
Opnum24NotUsedOnWire Reserved for local use. Opnum: 24
Opnum25NotUsedOnWire Reserved for local use. Opnum: 25
Opnum26NotUsedOnWire Reserved for local use. Opnum: 26
Opnum27NotUsedOnWire Reserved for local use. Opnum: 27
Opnum28NotUsedOnWire Reserved for local use. Opnum: 28
RpcWinStationBreakPoint Breaks into the debugger in either the session process of a specific session or in the terminal server service process. Opnum: 29
RpcWinStationReadRegistry Tells the server to reread from the registry the configuration data for all the WinStations. Opnum: 30
Opnum31NotUsedOnWire Reserved for local use. Opnum: 31
Opnum32NotUsedOnWire Reserved for local use. Opnum: 32
Opnum33NotUsedOnWire Reserved for local use. Opnum: 33
OldRpcWinStationEnumerateProcesses This function in turn calls the RpcWinStationEnumerateProcesses function. Opnum: 34
Opnum35NotUsedOnWire Reserved for local use. Opnum: 35
RpcWinStationEnumerateProcesses Returns the process information for an NT4 terminal server. Supported only for backward compatibility with that platform. Opnum: 36
RpcWinStationTerminateProcess Terminates the specified process. Opnum: 37
Opnum38NotUsedOnWire Reserved for local use. Opnum: 38
Opnum39NotUsedOnWire Reserved for local use. Opnum: 39
Opnum40NotUsedOnWire Not implemented. Opnum: 40
Opnum41NotUsedOnWire Not implemented. Opnum: 41
Opnum42NotUsedOnWire Reserved for local use. Opnum: 42
RpcWinStationGetAllProcesses Retrieves a list of the processes on a remote server on which the caller has permission to receive information. Opnum: 43
RpcWinStationGetProcessSid Retrieves the process SID for a given process ID and process start
150 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 Method Description
time combination. Opnum: 44
RpcWinStationGetTermSrvCountersValue Retrieves the current value of requested terminal server performance counters. Opnum: 45
RpcWinStationReInitializeSecurity Reinitializes security for all non-console WinStation remote connection protocols specified in the registry. Opnum: 46
Opnum47NotUsedOnWire Reserved for local use. Opnum: 47
Opnum48NotUsedOnWire Reserved for local use. Opnum: 48
Opnum49NotUsedOnWire Reserved for local use. Opnum: 49
Opnum50NotUsedOnWire Reserved for local use. Opnum: 50
Opnum51NotUsedOnWire Reserved for local use. Opnum: 51
Opnum52NotUsedOnWire Not implemented. Opnum: 52
RpcWinStationGetLanAdapterName Returns the LAN adapter GUID as a string. Opnum: 53
Opnum54NotUsedOnWire Reserved for local use. Opnum: 54
Opnum55NotUsedOnWire Reserved for local use. Opnum: 55
Opnum56NotUsedOnWire Reserved for local use. Opnum: 56
Opnum57NotUsedOnWire Reserved for local use. Opnum: 57
RpcWinStationUpdateSettings Rereads settings for all WinStations. Opnum: 58
RpcWinStationShadowStop Stops all shadow operations on the specified session. Opnum: 59
RpcWinStationCloseServerEx Closes the server handle for WinStation APIs. Opnum: 60
RpcWinStationIsHelpAssistantSession Determines whether a session is created by a HelpAssistant account (used for Remote Assistance). Opnum: 61
RpcWinStationGetMachinePolicy Returns a copy of the terminal server machine policy to the caller. Opnum: 62
Opnum63NotUsedOnWire Reserved for local use. Opnum: 63
Opnum64NotUsedOnWire Reserved for local use. Opnum: 64
151 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 Method Description
RpcWinStationCheckLoopBack Checks if there is a loopback when a client tries to connect. Opnum: 65
RpcConnectCallback Initiates a connection back to the Remote Assistance (RA) client. Opnum: 66
Opnum67NotUsedOnWire Reserved for local use. Opnum: 67
Opnum68NotUsedOnWire Reserved for local use. Opnum: 68
Opnum69NotUsedOnWire Reserved for local use. Opnum: 69
RpcWinStationGetAllProcesses_NT6 Retrieves the processes running a remote server on which the caller has access to retrieve information. Opnum: 70
Opnum71NotUsedOnWire Reserved for local use. Opnum: 71
Opnum72NotUsedOnWire Reserved for local use. Opnum: 72
Opnum73NotUsedOnWire Reserved for local use. Opnum: 73
Opnum74NotUsedOnWire Reserved for local use. Opnum: 74
RpcWinStationOpenSessionDirectory Pings the Session Directory to see if it can accept RPC calls. Opnum: 75 In the preceding table, the phrase "Reserved for local use" means that the client MUST NOT send the opnum, and the server behavior is undefined, because it does not affect interoperability.<158>
1354.3.4.1.1 RpcWinStationOpenServer (Opnum 0) The RpcWinStationOpenServer method returns a server handle that can be used in other WinStation API methods for querying information about the WinStation (sessions) on the server. No special permissions are required to call this method.
1355 BOOLEAN RpcWinStationOpenServer(
1356 [in] handle_t hBinding,
1357 [out] DWORD* pResult,
1358 [out] SERVER_HANDLE* phServer
1359 ); hBinding: The RPC binding handle. pResult: Failure error code if the call to RpcWinStationOpenServer failed. If the call was successful, this parameter is STATUS_SUCCESS (0x00000000) (as specified in [MS-ERREF]).
152 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 Value Meaning
STATUS_SUCCESS Successful call. 0x00000000
STATUS_CANCELLED The server is shutting down. 0xC0000120
STATUS_NO_MEMORY Not enough memory to complete the operation. 0xC0000017 phServer: Handle to the server object. This is of type SERVER_HANDLE. This handle is used by other RpcWinStation methods.
Return Values: Returns TRUE if the call succeeded, or FALSE if the call failed. On failure, pResult indicates the failure status code.
Return value/code Description
0x01 Successful completion. TRUE
0x00 Method call failed. FALSE
1359.1.1.1.1 RpcWinStationCloseServer (Opnum 1) The RpcWinStationCloseServer method closes the server handle for WinStation APIs. No special permissions are required to call this method.
1360 BOOLEAN RpcWinStationCloseServer(
1361 [in] SERVER_HANDLE hServer,
1362 [out] DWORD* pResult
1363 ); hServer: Handle to the server object. This is of type SERVER_HANDLE. The hServer MUST be returned from a previous call to RpcWinStationOpenServer. pResult: If the call was successful, this parameter is STATUS_SUCCESS (0x00000000), as specified in [MS-ERREF]; otherwise, it MUST be an implementation-specific negative value.
Return Values: Returns TRUE if the call succeeded, or FALSE if the call failed. On failure, pResult indicates the failure status code.
Return value/code Description
0x01 Successful completion. TRUE
0x00 Method call failed. FALSE
1363.1.1.1.1 RpcIcaServerPing (Opnum 2) The RpcIcaServerPing method is called to verify that the server is alive. No special permissions are required to call this method.<159>
153 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 1364 BOOLEAN RpcIcaServerPing(
1365 [in] SERVER_HANDLE hServer,
1366 [out] DWORD* pResult
1367 ); hServer: Handle to the server object. This is of type SERVER_HANDLE. The hServer argument MUST be obtained from a previous call to RpcWinStationOpenServer. pResult: If the call was successful, this parameter is STATUS_SUCCESS (0x00000000), as specified in [MS-ERREF]; otherwise it MUST be an implementation-specific negative value.
Return Values: Returns TRUE if the call succeeded and the server is alive, or FALSE if the method failed. On failure, pResult indicates the failure status code.
Return value/code Description
0x01 Successful completion. TRUE
0x00 Method call failed. FALSE
1367.1.1.1.1 RpcWinStationEnumerate (Opnum 3) The RpcWinStationEnumerate method retrieves a list of LOGONID structures for sessions on a terminal server. No special permissions are required to call this method. However, only sessions to which the caller has WINSTATION_QUERY permission are enumerated. The method checks whether the caller has WINSTATION_QUERY permission (section 3.1.1) by setting it as the Access Request mask, and fails if the caller does not have the permission.
1368 BOOLEAN RpcWinStationEnumerate(
1369 [in] SERVER_HANDLE hServer,
1370 [out] DWORD* pResult,
1371 [in, out] PULONG pEntries,
1372 [in, out, unique, size_is(*pByteCount)]
1373 PCHAR pLogonId,
1374 [in, out] PULONG pByteCount,
1375 [in, out] PULONG pIndex
1376 ); hServer: Handle to the server object. This is of type SERVER_HANDLE. The hServer argument MUST be obtained from a previous call to RpcWinStationOpenServer.
154 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 pResult: If the call was successful, this parameter will be STATUS_SUCCESS (0x00000000), as specified in [MS-ERREF]; otherwise, it MUST be an implementation-specific negative value. pEntries: Pointer to the number of entries to return to the caller. On return from this method, this is the number of logon IDs actually returned in this call to RpcWinStationEnumerate. pLogonId: Buffer where the logon IDs are stored when the method returns. This will be an array of LOGONID structures. Caller MUST cast this to PCHAR before calling this method. pByteCount: Size of the buffer, in bytes, to which pLogonId points. pIndex: Last index of the logon ID lookup from this call. Should be passed to the server the next time this method is called. Initial value of this passed by the caller MUST be 0.
Return Values: Returns TRUE if the call succeeded, or FALSE if the lookup failed. On failure, pResult indicates the failure status code. If all of the logon IDs have already been retrieved from the server, TRUE will be returned, and pResult will be STATUS_NO_MORE_ENTRIES (as specified in [MS-ERREF]), indicating to the call that all logon IDs have been retrieved.
Return value/code Description
0x01 Successful completion. TRUE
0x00 Method call failed. FALSE
1376.1.1.1.1 RpcWinStationRename (Opnum 4) The RpcWinStationRename method enables the caller to change the name of the session. The caller MUST have DELETE permission, as specified in [MS- DTYP] section 2.4.3, on the session that is identified by the old name.<160>
1377 BOOLEAN RpcWinStationRename(
1378 [in] SERVER_HANDLE hServer,
1379 [out] DWORD* pResult,
1380 [in, size_is(NameOldSize)] PWCHAR pWinStationNameOld,
1381 [in, range(0, 256)] DWORD NameOldSize,
1382 [in, size_is(NameNewSize)] PWCHAR pWinStationNameNew,
1383 [in, range(0, 256)] DWORD NameNewSize
1384 ); hServer: Handle to the server object. This is of type SERVER_HANDLE. The hServer MUST be obtained from a previous call to RpcWinStationOpenServer. pResult: The failure error code if the call to RpcWinStationRename fails. If the call is successful, this parameter MUST be STATUS_SUCCESS (0x00000000), as specified in [MS-ERREF].
Value Meaning
STATUS_SUCCESS The call is successful. 0x00000000
STATUS_ACCESS_DENIED The caller does not have DELETE permission.
155 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 Value Meaning
0xC0000022
STATUS_CTX_WINSTATION_NAME_INVALID The sizes are 0, one or the other of the pointers is NULL, 0xC00A0001 or a pointer is invalid.
STATUS_CTX_WINSTATION_NOT_FOUND No session exists with the name given in 0xC00A0015 pWinStationNameOld.
STATUS_CTX_WINSTATION_NAME_COLLISION A session already exists with the name given in 0xC00A0016 pWinStationNameNew. pWinStationNameOld: The pointer to a string that is the old name of the session being renamed.
NameOldSize: The length of the string in characters pointed to by pWinStationNameOld including the terminating NULL character. pWinStationNameNew: The pointer to a string that is the new name of the session being renamed.
NameNewSize: The length of the string in characters pointed to by pWinStationNameNew including the terminating NULL character. Name MUST be shorter than or equal to WINSTATIONNAME_LENGTH.
Return Values: Returns TRUE if the call succeeded, or FALSE if the method failed. On failure, pResult indicates the failure status code.
Return value/code Description
0x01 Successful completion. TRUE
0x00 Method call failed. FALSE
1384.1.1.1.1 RpcWinStationQueryInformation (Opnum 5) The RpcWinStationQueryInformation method retrieves various types of configuration information on a session. The caller MUST have the WINSTATION_QUERY permission right as well as specific permission rights for some operations as indicated in the following sections. The method checks whether the caller has WINSTATION_QUERY permission and the specific permission required for some operations (section 3.1.1) by setting it as the Access Request mask, and fails if the caller does not have the permission.<161>
1385 BOOLEAN RpcWinStationQueryInformation(
1386 [in] SERVER_HANDLE hServer,
1387 [out] DWORD* pResult,
1388 [in] DWORD LogonId,
1389 [in] DWORD WinStationInformationClass,
1390 [in, out, unique, size_is(WinStationInformationLength)]
1391 PCHAR pWinStationInformation,
156 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 1392 [in, range(0, 0x8000)] DWORD WinStationInformationLength,
1393 [out] DWORD* pReturnLength
1394 ); hServer: Handle to the server object. This is of type SERVER_HANDLE. hServer MUST be obtained from a previous call to RpcWinStationOpenServer. pResult: Failure error code if the call to RpcWinStationQueryInformation failed. If the call was successful, this parameter MUST be STATUS_SUCCESS (0x00000000).
Value Meaning
STATUS_SUCCESS Successful completion. 0x00000000
STATUS_INVALID_INFO_CLASS The class is not recognized. 0xC0000003
STATUS_BUFFER_TOO_SMALL WinStationInformationLength is too small. 0xC0000023
STATUS_ACCESS_DENIED The caller does not have permission for the operation. 0xC0000022
LogonId: The session ID of the session for which to retrieve information.
WinStationInformationClass: The class of data to retrieve. These values come from the enum type WINSTATIONINFOCLASS.
The following classes are supported.
Value Meaning
WinStationCreateData Retrieves general information on the type of terminal server session 0 (protocol) to which the session belongs. The pWinStationInformation argument points to a WINSTATIONCREATE structure, and WinStationInformationLength MUST be sizeof(WINSTATIONCREATE).<162>
WinStationConfiguration Retrieves general configuration data on the terminal server session. 1 The pWinStationInformation argument points to a WINSTACONFIGWIRE structure followed by a USERCONFIG structure. The WinStationInformationLength MUST be sizeof(WINSTACONFIGWIRE) + sizeof(USERCONFIG). The Size field in the USERCONFIG structure inside WINSTACONFIGWIRE MUST be set to sizeof(USERCONFIG) and the Offset set to sizeof(WINSTACONFIGWIRE). The Size field in the NewFields structure inside WINSTACONFIGWIRE MUST be set to 0, and the offset MUST be set to sizeof(WINSTACONFIGWIRE) + sizeof(USERCONFIG).
WinStationPdParams Retrieves transport protocol driver parameters.<163> The structure 2 coming into the function indicates via SDClass the specific protocol driver on which to receive parameter information. The result will be returned in the union in the structure. The pWinStationInformation argument points to a PDPARAMSWIRE structure followed by a PDPARAMS structure. The WinStationInformationLength MUST be sizeof(PDPARAMSWIRE) + sizeof(PDPARAMS). The Size field in SdClassSpecific field inside PDPARAMSWIRE MUST be set to sizeof(PDPARAMS) and the offset MUST be set to sizeof(PDPARAMSWIRE).
157 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 Value Meaning
WinStationWd Retrieves WinStation protocol driver configuration data for the 3 session.<164> The pWinStationInformation argument points to a VARDATA_WIRE structure followed by a WDCONFIG structure. The WinStationInformationLength MUST be sizeof(VARDATA_WIRE) + sizeof(WDCONFIG). The Size field in the VARDATA_WIRE structure MUST be set to sizeof(WDCONFIG) and the Offset set to sizeof(VARDATA_WIRE).
WinStationPd Retrieves transport protocol driver configuration data for the 4 session.<165> The pWinStationInformation argument points to a VARDATA_WIRE, followed by a PDPARAMSWIRE structure, followed by a PDCONFIG2 structure and finally ending with a PDPARAMS structure. The WinStationInformationLength MUST be sizeof(VARDATA_WIRE) + sizeof(PDPARAMSWIRE) + size of(PDCONFIG2) + sizeof(PDPARAMS). The Size field in the VARDATA_WIRE structure MUST be set to sizeof(PDCONFIG2) and the Offset set to sizeof(VARDATA_WIRE) + sizeof(PDPARAMSWIRE). The Size field in SdClassSpecific field inside PDPARAMSWIRE MUST be set to sizeof(PDPARAMS) - sizeof(SDCLASS), and the offset MUST be set to Offset + Size of the VARDATA_WIRE structure.
WinStationPrinter Not supported. 5
WinStationClient Retrieves data on the terminal server client of the session. 6 The pWinStationInformation argument points to a VARDATA_WIRE structure followed by a WINSTATIONCLIENT structure. The WinStationInformationLength MUST be sizeof(VARDATA_WIRE) + sizeof(WINSTATIONCLIENT). The Size field in the VARDATA_WIRE structure MUST be set to sizeof(WINSTATIONCLIENT) and the Offset set to sizeof(VARDATA_WIRE).
WinStationModules Internal get function to retrieve data on protocol-specific binaries 7 loaded for the given terminal server session. The structure pointed to by pWinStationInformation and the size of the buffer is Terminal Service protocol-specific.
WinStationInformation Retrieves information on the session, including connect state, 8 session's name, connect time, disconnect time, time last input was received from the client, logon time, user's username and domain, and the current time. pWinStationInformation points to a VARDATA_WIRE structure followed by a WINSTATIONINFORMATION structure. The WinStationInformationLength MUST be sizeof(VARDATA_WIRE) + sizeof(WINSTATIONINFORMATION). The Size field in the VARDATA_WIRE structure MUST be set to sizeof(WINSTATIONINFORMATION) and the Offset set to sizeof(VARDATA_WIRE).
WinStationUserToken Retrieves the user's token in the session. Caller requires 14 WINSTATION_ALL_ACCESS permission. The pWinStationInformation argument points to a WINSTATIONUSERTOKEN structure, and WinStationInformationLength MUST be sizeof(WINSTATIONUSERTOKEN).
WinStationVideoData Retrieves resolution and color depth of the session. 16 The pWinStationInformation argument points to a WINSTATIONVIDEODATA structure, and WinStationInformationLength MUST be sizeof(WINSTATIONVIDEODATA).
WinStationCd Retrieves connection driver configuration data. 18 The pWinStationInformation points to a CDCONFIG structure, and
158 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 Value Meaning
WinStationInformationLength MUST be sizeof(CDCONFIG).
WinStationVirtualData Query client virtual data. 20 The pWinStationInformation argument MUST point to 8 bytes and WinStationInformationLength MUST be 8.
WinStationLoadBalanceSessionTarget Retrieves the target session ID for a client redirected from another 24 server in a load balancing cluster. The pWinStationInformation points to a ULONG, and WinStationInformationLength MUST be sizeof(ULONG). If there is no redirection, -1 is returned in pWinStationInformation.<166>
WinStationLoadIndicator Retrieves an indicator of the load on the server. 25 The pWinStationInformation argument points to a WINSTATIONLOADINDICATORDATA structure. WinStationInformationLength MUST be sizeof(WINSTATIONLOADINDICATORDATA).
WinStationShadowInfo Retrieves the current shadow state of a session. 26 The pWinStationInformation argument points to a WINSTATIONSHADOW structure. WinStationInformationLength MUST be sizeof(WINSTATIONSHADOW).<167>
WinStationDigProductId Retrieves the client product ID and current product ID of the 27 session. The pWinStationInformation argument points to a WINSTATIONPRODID structure. WinStationInformationLength MUST be sizeof(WINSTATIONPRODID).<168>
WinStationLockedState Retrieves the current locked state of the session, TRUE or FALSE. 28 The pWinStationInformation argument points to a BOOL variable. WinStationInformationLength MUST be sizeof(BOOL).
WinStationRemoteAddress Retrieves the remote IP address of the terminal server client in the 29 session. The pWinStationInformation argument points to a WINSTATIONREMOTEADDRESS structure. WinStationInformationLength MUST be sizeof(WINSTATIONREMOTEADDRESS).
WinStationIdleTime Retrieves the idle time for the session, in seconds. 30 The pWinStationInformation argument points to a ULONG variable. WinStationInformationLength MUST be sizeof(ULONG).<169>
WinStationLastReconnectType Retrieves the last reconnect type for the session. The value placed 31 in pWinStationInformation will come from the enum RECONNECT_TYPE. The pWinStationInformation argument points to a ULONG variable. WinStationInformationLength MUST be sizeof(ULONG).<170>
WinStationDisallowAutoReconnect Retrieves the allow (1) or disallow (0) state for auto-reconnect, 1 or 32 0. The pWinStationInformation argument points to a BOOLEAN variable. WinStationInformationLength MUST be sizeof(BOOLEAN).
WinStationReconnectedFromId In case of reconnected sessions, this will return the session ID of 37 the temporary session from which it was reconnected, or -1 if no temporary session was created. The WinStationInformationLength argument points to a ULONG variable. WinStationInformationLength MUST be sizeof(ULONG).
WinStationEffectsPolicy Return policies that differentiate among implementations. 38 The pWinStationInformation argument points to a ULONG variable.
159 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 Value Meaning
WinStationInformationLength MUST be sizeof(ULONG).
WinStationType Returns the type associated with this WinStation. 39 The pWinStationInformation argument points to a ULONG variable. WinStationInformationLength MUST be sizeof(ULONG).
WinStationInformationEx Retrieves extended information on the session, including connect 40 state, flags, session's name, connect time, disconnect time, time last input was received from the client, logon time, user's username and domain, and the current time. pWinStationInformation points to a VARDATA_WIRE structure followed by a WINSTATIONINFORMATIONEX structure. The WinStationInformationLength MUST be sizeof(VARDATA_WIRE) + sizeof(WINSTATIONINFORMATIONEX). The Size field in the VARDATA_WIRE structure MUST be set to sizeof(WINSTATIONINFORMATIONEX) and the Offset set to sizeof(VARDATA_WIRE). pWinStationInformation: Pointer to buffer allocated by the caller in which to retrieve the data. The data type or structure that pWinStationInformation points to is determined by the value of WinStationInformationClass. See previous sections for what pWinStationInformation SHOULD point to for each class.
WinStationInformationLength: Size of the data pointed to by pWinStationInformation, in bytes. pReturnLength: Pointer to a variable to receive the size, in bytes, of the data retrieved. If WinStationInformationLength is too small, pReturnLength indicates the correct number of bytes for the caller to allocate.
Return Values: Returns TRUE if the call succeeded, or FALSE if the method failed. On failure, pResult indicates the failure status code.
Return value/code Description
0x01 Successful completion. TRUE
0x00 Method call failed. FALSE
1394.1.1.1.1 RpcWinStationSetInformation (Opnum 6) The RpcWinStationSetInformation method sets various types of configuration information for a session. The caller MUST have the WINSTATION_SET permission. Some operations MUST have more specific permissions as indicated in more detail in the sections that follow. The method checks whether the caller has WINSTATION_SET permission and the specific permission for the configuration information (section 3.1.1) by setting it as the Access Request mask, and fails if the caller does not have the permissions.<171>
1395 BOOLEAN RpcWinStationSetInformation(
1396 [in] SERVER_HANDLE hServer,
1397 [out] DWORD* pResult,
1398 [in] DWORD LogonId,
160 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 1399 [in] DWORD WinStationInformationClass,
1400 [in, out, unique, size_is(WinStationInformationLength)]
1401 PCHAR pWinStationInformation,
1402 [in, range(0, 0x8000)] DWORD WinStationInformationLength
1403 ); hServer: Handle to the server object. This is of type SERVER_HANDLE. hServer MUST be obtained from a previous call to RpcWinStationOpenServer. pResult: Failure error code if the call to RpcWinStationSetInformation failed. If the call was successful, this parameter MUST be STATUS_SUCCESS (0x00000000).
Value Meaning
STATUS_SUCCESS Successful completion. 0x00000000
STATUS_INVALID_INFO_CLASS The class is not recognized. 0xC0000003
STATUS_ACCESS_DENIED The caller does not have permission for the operation. 0xC0000022
LogonId: The ID of the session for which to set information.
WinStationInformationClass: The class of data to set. These values come from the enum type WINSTATIONINFOCLASS. See the following sections for the supported classes.
Value Meaning
WinStationConfiguration Merges configuration data into the terminal server session's data. 1 The pWinStationInformation argument points to a WINSTACONFIGWIRE structure followed by a USERCONFIG structure. The WinStationInformationLength MUST be sizeof(WINSTACONFIGWIRE) + sizeof(USERCONFIG). The Size field in the USERCONFIG structure inside WINSTACONFIGWIRE MUST be set to sizeof(USERCONFIG) and the Offset set to sizeof(WINSTACONFIGWIRE). The Size field in the NewFields structure inside WINSTACONFIGWIRE MUST be set to 0, and the offset MUST be set to sizeof(WINSTACONFIGWIRE) + sizeof(USERCONFIG).
WinStationPdParams Sets transport protocol driver parameters. The structure coming into 2 the function indicates via SDClass the specific protocol driver for which to set the parameter information. The pWinStationInformation argument points to a PDPARAMSWIRE structure followed by a PDPARAMS structure. The WinStationInformationLength MUST be sizeof(PDPARAMSWIRE) + sizeof(PDPARAMS). The Size field in SdClassSpecific field inside PDPARAMSWIRE MUST be set to sizeof(PDPARAMS) and the offset MUST be set to sizeof(PDPARAMSWIRE).
WinStationTrace Enables tracing on the lower-level terminal server drivers for this 9 session. This MUST be called by a process running as SYSTEM or as an administrator. The method performs access checks as defined in sections 3.1.2 and 3.1.3. The method fails if both checks fail. The pWinStationInformation argument points to a TS_TRACE structure, and WinStationInformationLength MUST be sizeof(TS_TRACE).
WinStationBeep Sends a beep to the session.
161 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 Value Meaning
10 The pWinStationInformation argument points to a BEEPINPUT structure, and WinStationInformationLength MUST be sizeof(BEEPINPUT).
WinStationEncryptionOff Turns encryption off.<172> 11
WinStationEncryptionPerm Turns encryption permanently on.<173> 12
WinStationNtSecurity Sends logon service in the session a CTRL+ALT+DEL message.<174> 13 The pWinStationInformation argument and WinStationInformationLength are not used for this class. Set them to dummy valid data, however, as there always has to be something in these parameters.
WinStationInitialProgram Not used. 17
WinStationSystemTrace Enables global tracing on the lower-level terminal server drivers for this 19 session. This MUST be called by a process running as SYSTEM or as an administrator. The method performs access checks as defined in sections 3.1.2 and 3.1.3. The method fails if both checks fail. The pWinStationInformation argument points to a TS_TRACE structure, and WinStationInformationLength MUST be sizeof(TS_TRACE).
WinStationClientData Sends data to the terminal server client. 21 WinStationInformationLength represents the complete length of all items to send and MUST be at least sizeof(VARDATA_WIRE) + sizeof(WINSTATIONCLIENTDATA ). Otherwise, STATUS_INFO_LENGTH_MISMATCH (as specified in [MS-ERREF]) is returned in pResult. If the data is larger than this but still less than what is expected, STATUS_INVALID_USER_BUFFER (as specified in [MS-ERREF]) is returned in pResult. The pWinStationInformation points to a VARDATA_WIRE structure followed by the WINSTATIONCLIENTDATA structure itself. The Size field in the VARDATA_WIRE structure MUST be set to sizeof(WINSTATIONCLIENTDATA) and the Offset set to sizeof(VARDATA_WIRE).
WinStationSecureDesktopEnter Not used. 22
WinStationSecureDesktopExit Not used. 23
WinStationShadowInfo Not used. 26
WinStationLockedState Notifies processes of the new locked state of the session. TRUE or 28 FALSE. The pWinStationInformation argument points to a BOOL variable. WinStationInformationLength MUST be sizeof (BOOL).
WinStationDisallowAutoReconnect Allows or disallows auto-reconnect behavior for this session, TRUE or 32 FALSE. This MUST be called by a process running as SYSTEM. The pWinStationInformation argument points to a BOOL variable. WinStationInformationLength MUST be sizeof (BOOL). pWinStationInformation: Pointer to buffer allocated by the caller in which the data for the operation is located. The data type or structure to which pWinStationInformation points is determined by the value of WinStationInformationClass.
WinStationInformationLength: Size of the data pointed to by pWinStationInformation, in bytes.
162 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 Return Values: Returns TRUE if the call succeeded, or FALSE if the method failed. On failure, pResult indicates the failure status code.
Return value/code Description
0x01 Successful completion. TRUE
0x00 Method call failed. FALSE
1403.1.1.1.1 RpcWinStationSendMessage (Opnum 7) The RpcWinStationSendMessage method displays a message box on a given terminal server session and, optionally, waits for a reply. The caller MUST have WINSTATION_MSG permission for this method to succeed. The method checks whether the caller has WINSTATION_MSG permission (section 3.1.1) by setting it as the Access Request mask, and fails if the caller does not have the permission.<175>
1404 BOOLEAN RpcWinStationSendMessage(
1405 [in] SERVER_HANDLE hServer,
1406 [out] DWORD* pResult,
1407 [in] DWORD LogonId,
1408 [in, size_is(TitleLength)] PWCHAR pTitle,
1409 [in, range(0, 1024 )] DWORD TitleLength,
1410 [in, size_is(MessageLength)] PWCHAR pMessage,
1411 [in, range(0, 1024 )] DWORD MessageLength,
1412 [in] DWORD Style,
1413 [in] DWORD Timeout,
1414 [out] DWORD* pResponse,
1415 [in] BOOLEAN DoNotWait
1416 ); hServer: Handle to the server object. This is of type SERVER_HANDLE. The hServer argument MUST be obtained from a previous call to RpcWinStationOpenServer. pResult: Failure error code if the call to RpcWinStationSendMessage failed. If the call was successful, this parameter MUST be STATUS_SUCCESS (0x00000000).
Value Meaning
STATUS_SUCCESS The call succeeded. 0x00000000
STATUS_ACCESS_DENIED The caller does not have WINSTATION_MSG permission.
163 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 Value Meaning
0xC0000022
LogonId: The session ID of the session on which to display the message box. pTitle: Pointer to the title for the message box to display.
TitleLength: The length, in bytes, of the title to display. pMessage: Pointer to the message to display.
MessageLength: The length, in bytes, of the message to display in the specified session.
Style: Can be any value that the standard MessageBox() method's Style parameter takes. For more information, see [MSDN-MSGBOX].
Timeout: The response time-out, in seconds. If the message box is not responded to in Timeout seconds, a response code of IDTIMEOUT MUST be returned in pResponse to indicate that the message box timed out. This time-out value is managed by another system component which dismisses the message box if no user input is entered during this interval. pResponse: The return code from the MessageBox method. This value will be a standard MessageBox return value. For more information, see [MSDN-MSGBOX].
DoNotWait: If set to TRUE, do not wait for the response to the message. On return, if no errors occur in queuing the message, the pResponse parameter will be set to IDASYNC.
If FALSE, wait for a response.
Return Values: Returns TRUE if the call succeeded, or FALSE if the method failed. On failure, pResult indicates the failure status code.
Return value/code Description
0x01 Successful completion. TRUE
0x00 Method call failed. FALSE
1416.1.1.1.1 RpcLogonIdFromWinStationName (Opnum 8) The RpcLogonIdFromWinStationName method returns a session's session ID given its session name. The caller MUST have WINSTATION_QUERY permission. The method checks whether the caller has WINSTATION_QUERY permission (section 3.1.1) by setting it as the Access Request mask, and fails if the caller does not have the permission.<176>
1417 BOOLEAN RpcLogonIdFromWinStationName(
1418 [in] SERVER_HANDLE hServer,
1419 [out] DWORD* pResult,
1420 [in, size_is(NameSize)] PWCHAR pWinStationName,
1421 [in, range(0, 256 )] DWORD NameSize,
1422 [out] DWORD* pLogonId
164 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 1423 ); hServer: The Handle to the server object. This is of type SERVER_HANDLE. hServer MUST be obtained from a previous call to RpcWinStationOpenServer. pResult: The failure error code if the call to RpcLogonIdFromWinStationName fails. If the call is successful, this parameter MUST be STATUS_SUCCESS (0x00000000).
Value Meaning
STATUS_SUCCESS The call is successful. 0x00000000
STATUS_ACCESS_DENIED The caller does not have permission for the operation. 0xC0000022 pWinStationName: The pointer to a buffer holding the session name.
NameSize: The length of the string in characters pointed to by pWinStationName including the terminating NULL character. MUST be less than or equal to WINSTATIONNAME_LENGTH. pLogonId: The matching session ID for the session specified by pWinStationName.
Return Values: Returns TRUE if the call succeeded, or FALSE if the method failed. On failure, pResult indicates the failure status code.
Return value/code Description
0x01 Successful completion. TRUE
0x00 Method call failed. FALSE
1423.1.1.1.1 RpcWinStationNameFromLogonId (Opnum 9) The RpcWinStationNameFromLogonId method retrieves the Windows Station (WinStation) name for a specific session. The caller MUST have WINSTATION_QUERY permission. The method checks whether the caller has WINSTATION_QUERY permission (section 3.1.1) by setting it as the Access Request mask, and fails if the caller does not have the permission.<177>
1424 BOOLEAN RpcWinStationNameFromLogonId(
1425 [in] SERVER_HANDLE hServer,
1426 [out] DWORD* pResult,
1427 [in] DWORD LoginId,
1428 [in, out, size_is(NameSize)] PWCHAR pWinStationName,
1429 [in, range(0, 256 )] DWORD NameSize
1430 ); hServer: Handle to the server object. This is of type SERVER_HANDLE. The hServer MUST be obtained from a previous call to RpcWinStationOpenServer.
165 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 pResult: Failure error code if the call to RpcWinStationNameFromLogonId failed. If the call was successful, this parameter MUST be STATUS_SUCCESS (0x00000000).
Value Meaning
STATUS_SUCCESS The call succeeded. 0x00000000
STATUS_INVALID_PARAMETER NameSize value is less than WINSTATIONNAME_LENGTH + 1. 0xC000000D
0x80071B6E The session does not exist or the caller does not have WINSTATION_QUERY permission.
LoginId: The ID of the session for which to retrieve the WinStation name. pWinStationName: Pointer to a buffer holding the session name. The length of the buffer MUST be equal to or greater than (WINSTATIONNAME_LENGTH + 1).
NameSize: The size, in bytes, of the buffer where the WinStation name will be stored.
Return Values: Returns TRUE if the call succeeded, or FALSE if the method failed. On failure, pResult indicates the failure status code.
Return value/code Description
0x01 Successful completion. TRUE
0x00 Method call failed. FALSE
1430.1.1.1.1 RpcWinStationConnect (Opnum 10) The RpcWinStationConnect method connects a user's terminal server client from a given terminal server session to a different terminal server session. If there is a user connected to the client session, it will be disconnected at the end of this call. If the method succeeds, the state of the session is State_Active as defined in the WINSTATIONSTATECLASS enumeration (section 2.2.1.9). The client indicated by ConnectLogonId MUST have WINSTATION_DISCONNECT permission. Similarly, TargetLogonId MUST have WINSTATION_CONNECT and WINSTATION_DISCONNECT permissions. For each of the aforementioned permissions, the method checks whether the caller has the permission (section 3.1.1) by setting the Access Request mask to the specific permission, and fails if the caller does not have the permission.<178>
1431 BOOLEAN RpcWinStationConnect(
1432 [in] SERVER_HANDLE hServer,
1433 [out] DWORD* pResult,
1434 [in] DWORD ClientLogonId,
1435 [in] DWORD ConnectLogonId,
166 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 1436 [in] DWORD TargetLogonId,
1437 [in, size_is(PasswordSize)] PWCHAR pPassword,
1438 [in, range(0, 1024)] DWORD PasswordSize,
1439 [in] BOOLEAN Wait
1440 ); hServer: Handle to the server object. This is of type SERVER_HANDLE. The hServer argument MUST be obtained from a previous call to RpcWinStationOpenServer. pResult: If the call was successful, this parameter MUST be STATUS_SUCCESS (0x00000000); otherwise, it MUST be an implementation-specific negative value.
ClientLogonId: The session ID of the caller of this method.
ConnectLogonId: The ID of the session from which the connection is being made. This MUST be the same as ClientLogonId and MUST be an existing session ID. The user MUST be logged on. To indicate the current session, this MUST be LOGONID_CURRENT.
TargetLogonId: The session ID of the session to which the connection is being made. Cannot be the same as ConnectLogonId and MUST be an existing session ID. pPassword: The password of TargetLogonId's session. The password MUST be valid. The password MAY be NULL if the same user is making the call as the user logged on to TargetLogonId's session.
PasswordSize: The length of the string pPassword in characters including the terminating NULL character.
Wait: TRUE indicates to wait for the connection to complete, FALSE otherwise.<179>
Return Values: Returns TRUE if the call succeeded, or FALSE if the method failed. On failure, pResult indicates the failure status code.
Return value/code Description
0x01 Successful completion. TRUE
0x00 Method call failed. FALSE
1440.1.1.1.1 RpcWinStationDisconnect (Opnum 13) The RpcWinStationDisconnect method disconnects, on the server, the terminal server client from a session. If the method succeeds, the state of the session is State_Disconnected as defined in the WINSTATIONSTATECLASS enumeration (section 2.2.1.9). The caller of this method MUST have WINSTATION_DISCONNECT permission on the session to disconnect. The method checks whether the caller has WINSTATION_DISCONNECT permission (section 3.1.1) by setting it as the Access Request mask, and fails if the caller does not have the permission.<180>
1441 BOOLEAN RpcWinStationDisconnect(
167 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 1442 [in] SERVER_HANDLE hServer,
1443 [out] DWORD* pResult,
1444 [in] DWORD LogonId,
1445 [in] BOOLEAN bWait
1446 ); hServer: Handle to the server object. This is of type SERVER_HANDLE. hServer MUST be obtained from a previous call to RpcWinStationOpenServer. pResult: Failure error code if the call to RpcWinStationDisconnect failed. If the call was successful, this parameter MUST be STATUS_SUCCESS (0x00000000).
Value Meaning
STATUS_SUCCESS The call succeeded. 0x00000000
STATUS_ACCESS_DENIED The caller does not have permission to disconnect the session. 0xC0000022
LogonId: The ID of the session to disconnect. Can be LOGONID_CURRENT to indicate the current session. bWait: TRUE to wait for the disconnect to complete before returning, FALSE otherwise.<181>
Return Values: Returns TRUE if the call succeeded, or FALSE if the method failed. On failure, pResult indicates the failure status code.
Return value/code Description
0x01 Successful completion. TRUE
0x00 Method call failed. FALSE
1446.1.1.1.1 RpcWinStationReset (Opnum 14) The RpcWinStationReset method resets a session. Resetting a session will lead to the user being logged off and his or her terminal server client being disconnected. The caller MUST have WINSTATION_RESET permissions. The method checks whether the caller has WINSTATION_RESET permission (section 3.1.1) by setting it as the Access Request mask, and fails if the caller does not have the permission.<182>
1447 BOOLEAN RpcWinStationReset(
1448 [in] SERVER_HANDLE hServer,
1449 [out] DWORD* pResult,
1450 [in] DWORD LogonId,
168 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 1451 [in] BOOLEAN bWait
1452 ); hServer: Handle to the server object. This is of type SERVER_HANDLE. hServer MUST be obtained from a previous call to RpcWinStationOpenServer. pResult: Failure error code if the call to RpcWinStationReset failed. If the call was successful, this parameter MUST be STATUS_SUCCESS (0x00000000).
Value Meaning
STATUS_SUCCESS The call succeeded. 0x00000000
STATUS_ACCESS_DENIED The caller does not have WINSTATION_RESET permission. 0xC0000022
LogonId: The ID of the session to reset. bWait: TRUE to wait for the disconnect to complete before returning, FALSE otherwise.
Return Values: Returns TRUE if the call succeeded, or FALSE if the method failed. On failure, pResult indicates the failure status code.
Return value/code Description
0x01 Successful completion. TRUE
0x00 Method call failed. FALSE
1452.1.1.1.1 RpcWinStationShutdownSystem (Opnum 15) The RpcWinStationShutdownSystem method shuts down the system and optionally logs off all sessions and/or reboots the system. The caller requires SeShutdownPrivilege (see [MSDN-PRVLGECNSTS]) when performing the shutdown locally and SeRemoteShutdownPrivilege (see [MSDN- PRVLGECNSTS]) when performing the shutdown remotely. The caller calls ExitWindowsEx (see [MSDN-ExitWindowsEx]) to perform the actual shutdown once all checks have been completed.
1453 BOOLEAN RpcWinStationShutdownSystem(
1454 [in] SERVER_HANDLE hServer,
1455 [out] DWORD* pResult,
1456 [in] DWORD ClientLogonId,
1457 [in] DWORD ShutdownFlags
1458 ); hServer: Handle to the server object. This is of type SERVER_HANDLE. The hServer MUST be obtained from a previous call to RpcWinStationOpenServer.
169 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 pResult: Failure error code if the call to RpcWinStationShutdownSystem failed. If the call was successful, this parameter MUST be STATUS_SUCCESS (0x00000000).
Value Meaning
STATUS_SUCCESS The call succeeded. 0x00000000
STATUS_ACCESS_DENIED The caller does not have permission to shut down the system. 0xC0000022
ClientLogonId: The session requesting to shut down the system. Ignored when the RPC call is remote.
ShutdownFlags: Shutdown flags. It MUST be any bitwise OR combination of the following flags.
Value Meaning
WSD_LOGOFF Forces sessions to logoff. 0x00000001
WSD_SHUTDOWN Shuts down the system. 0x00000002
WSD_REBOOT Reboots after shutdown. 0x00000004
WSD_POWEROFF Powers off after shutdown. 0x00000008
Return Values: Returns TRUE if the call succeeded, or FALSE if the method failed. On failure, pResult indicates the failure status code.
Return value/code Description
0x01 Successful completion. TRUE
0x00 Method call failed. FALSE
1458.1.1.1.1 RpcWinStationWaitSystemEvent (Opnum 16) The RpcWinStationWaitSystemEvent method waits synchronously for a system event from an RPC API request on behalf of the caller. There is no time-out on the wait. Only one event wait at a time may be posted per server handle. If an event wait is already outstanding and the new request is not a cancel, the new request will fail. The caller is not required to have any specific permission to call RpcWinStationWaitSystemEvent. The first time this is called, the server will create an event block for the handle specified by hServer. This event block will be cleared if RpcWinStationWaitSystemEvent is called with EventMask equal to WEVENT_NONE or if RpcWinStationCloseServer or RpcWinStationCloseServerEx are closed for the handle hServer.
1459 BOOLEAN RpcWinStationWaitSystemEvent(
1460 [in] SERVER_HANDLE hServer,
1461 [out] DWORD* pResult,
170 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 1462 [in] DWORD EventMask,
1463 [out] DWORD* pEventFlags
1464 ); hServer: Handle to the server object. This is of type SERVER_HANDLE. hServer MUST be obtained from a previous call to RpcWinStationOpenServer. pResult: If the call was successful, this parameter MUST be STATUS_SUCCESS (0x00000000); otherwise, it MUST be an implementation-specific negative value.
EventMask: The mask of events for which to wait. It MUST be any bitwise OR combination of the following except for WEVENT_NONE.
Value Meaning
WEVENT_NONE The client requests to clear its event wait block. This MUST be called when 0x00000000 completing waiting for the event. When RpcWinStationCloseServer is called for hServer, this method and mask value is called on the client's behalf.
WEVENT_CREATE Wait for a new session to be created. 0x00000001
WEVENT_DELETE Wait for an existing session to be deleted. 0x00000002
WEVENT_RENAME Wait for a session to be renamed. 0x00000004
WEVENT_CONNECT The session connected to a client. 0x00000008
WEVENT_DISCONNECT A client disconnected from the session. 0x00000010
WEVENT_LOGON A user logged on to the session. 0x00000020
WEVENT_LOGOFF A user logged off from the session. 0x00000040
WEVENT_STATECHANGE The session state changed. 0x00000080
WEVENT_LICENSE The license state changed.<183> 0x00000100
WEVENT_ALL Wait for all event types. 0x7fffffff
WEVENT_FLUSH Release all waiting clients. 0x80000000 pEventFlags: Pointer to a variable to receive a bitmask that is a subset of EventMask indicating which events actually occurred during this wait operation.
Return Values: Returns TRUE if the call succeeded, or FALSE if the method failed. On failure, pResult indicates the failure status code.
Return value/code Description
0x01 Successful completion.
171 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 Return value/code Description
TRUE
0x00 Method call failed. FALSE
1464.1.1.1.1 RpcWinStationShadow (Opnum 17) The RpcWinStationShadow method starts a shadow (remote control) operation of another terminal server session. If the method succeeds, the state of the session that started the shadow operation is State_Shadow and the state of the session being shadowed is State_Active as defined in the WINSTATIONSTATECLASS enumeration (section 2.2.1.9). The caller MUST have WINSTATION_SHADOW permission. The other session can be local or on a terminal server. The method MUST be called from inside a remote terminal server session. The session to shadow MUST be in the active state with a user logged on. The method checks whether the caller has WINSTATION_SHADOW permission (section 3.1.1) by setting it as the Access Request mask, and fails if the caller does not have the permission.<184>
1465 BOOLEAN RpcWinStationShadow(
1466 [in] SERVER_HANDLE hServer,
1467 [out] DWORD* pResult,
1468 [in] DWORD LogonId,
1469 [in, unique, size_is(NameSize)]
1470 PWCHAR pTargetServerName,
1471 [in, range(0, 1024)] DWORD NameSize,
1472 [in] DWORD TargetLogonId,
1473 [in] BYTE HotKeyVk,
1474 [in] USHORT HotkeyModifiers
1475 ); hServer: Handle to the server object. This is of type SERVER_HANDLE. The hServer argument value MUST be obtained from a previous call to RpcWinStationOpenServer. pResult: If the call was successful, this parameter MUST be STATUS_SUCCESS (0x00000000); otherwise, it MUST be an implementation-specific negative value.
LogonId: The ID of the session to shadow from. pTargetServerName: The shadow target server name. Set pTargetServerName to NULL to indicate the current server.
NameSize: The size of the string pTargetServerName, in bytes. MAY be 0 if pTargetServerName is NULL.
TargetLogonId: The shadow target session ID.
172 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 HotKeyVk: The virtual key code of the key to press to stop shadowing. This key is used in combination with the HotkeyModifiers parameter.
HotkeyModifiers: The virtual modifier that signifies the modifier key, such as shift or control, to press to stop shadowing. The modifier key is used in combination with the key signified by the HotKeyVk parameter. This parameter MAY be any combination of KBDSHIFT, KBDCTRL, and KBDALT to indicate the SHIFT key, the CTRL key, and the ALT key, respectively.
Return Values: Returns TRUE if the call succeeded, or FALSE if the method failed. On failure, pResult indicates the failure status code.
Return value/code Description
0x01 Successful completion. TRUE
0x00 Method call failed. FALSE
1475.1.1.1.1 RpcWinStationBreakPoint (Opnum 29) The RpcWinStationBreakPoint method breaks into the debugger in either the session process of a specific session or in the terminal server service process. When this method is called, the server impersonates the caller and then tries to enable SeShutdownPrivilege (see [MSDN-PRVLGECNSTS]). If the attempt to enable this privilege fails, the RpcWinStationBreakPoint call fails.<185>
1476 BOOLEAN RpcWinStationBreakPoint(
1477 [in] SERVER_HANDLE hServer,
1478 [out] DWORD* pResult,
1479 [in] DWORD LogonId,
1480 [in] BOOLEAN KernelFlag
1481 ); hServer: Handle to the server object. This is of type SERVER_HANDLE. The hServer argument MUST be obtained from a previous call to RpcWinStationOpenServer. pResult: Failure error code if the call to RpcWinStationBreakPoint failed. If the call was successful, this parameter MUST be STATUS_SUCCESS (0x00000000).
Value Meaning
STATUS_SUCCESS The call succeeded. 0x00000000
STATUS_ACCESS_DENIED The SeShutdownPrivilege (see [MSDN-PRVLGECNSTS]) privilege cannot be 0xC0000022 enabled.
LogonId: The ID of the session to break into the debugger. If this parameter is -2, the terminal server service MUST break into the debugger instead.<186>
KernelFlag: Set to TRUE to indicate that the server will break into the debugger in a particular session in kernel mode. If LogonId is -2, the server MUST break into the debugger in user mode.
173 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 Return Values: Returns TRUE if the call succeeded, or FALSE if the method failed. On failure, pResult indicates the failure status code.
Return value/code Description
0x01 Successful completion. TRUE
0x00 Method call failed. FALSE
1481.1.1.1.1 RpcWinStationReadRegistry (Opnum 30) The RpcWinStationReadRegistry method tells the terminal server to reread, from the registry, the configuration data for all the WinStations, and to update the memory locations where this data was stored with the values read from the registry.<187> The caller of this RPC method MUST be running either as SYSTEM or as an Administrator.<188>
1482 BOOLEAN RpcWinStationReadRegistry(
1483 [in] SERVER_HANDLE hServer,
1484 [out] DWORD* pResult
1485 ); hServer: Handle to the server object. This is of type SERVER_HANDLE. hServer MUST be obtained from a previous call to RpcWinStationOpenServer. pResult: If the call was successful, this parameter MUST be STATUS_SUCCESS (0x00000000), as specified in [MS-ERREF]; otherwise, it MUST be an implementation-specific negative value.
Return Values: Returns TRUE if the call succeeded, or FALSE if the method failed. On failure, pResult indicates the failure status code.
Return value/code Description
0x01 Successful completion. TRUE
0x00 Method call failed. FALSE
1485.1.1.1.1 OldRpcWinStationEnumerateProcesses (Opnum 34) The OldRpcWinStationEnumerateProcesses method calls the RpcWinStationEnumerateProcesses method and returns whatever is returned by that method. It has the same parameters as the RpcWinStationEnumerateProcesses method. No special permissions are required to call this method.<189>
1486 BOOLEAN OldRpcWinStationEnumerateProcesses(
1487 [in] SERVER_HANDLE hServer,
174 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 1488 [out] DWORD* pResult,
1489 [out, size_is(ByteCount)] PBYTE pProcessBuffer,
1490 [in, range(0, 0x8000 )] DWORD ByteCount
1491 ); hServer: Handle to the server object. This is of type SERVER_HANDLE. hServer MUST be obtained from a previous call to RpcWinStationOpenServer. pResult: Failure error code if the call to RpcWinStationEnumerateProcesses failed. If the call was successful, this parameter MUST be STATUS_SUCCESS (0x00000000), as specified in [MS-ERREF].
Value Meaning
STATUS_SUCCESS The call succeeded. 0x00000000
STATUS_INFO_LENGTH_MISMATCH ByteCount is too small to receive the data. 0xC0000004 pProcessBuffer: Pointer to a buffer receiving the list of processes.
In pProcessBuffer for each process, the server will return the following in the buffer, in this order: 1. A TS_PROCESS_INFORMATION_NT4 structure. 2. A number of SYSTEM_THREAD_INFORMATION (see [WININTERNALS] or [MSFT-WINSYSINTERNALS]) structures equal to the maximum number of threads in the process. 3. A TS_SYS_PROCESS_INFORMATION structure for the process. Only up to SIZEOF TS4_SYSTEM_THREAD_INFORMATION of the SYSTEM_THREAD_INFORMATION structure (as specified in (see [WININTERNALS] or [MSFT-WINSYSINTERNALS]) is copied into the buffer and only up to SIZEOF TS4_SYSTEM_PROCESS_INFORMATION of the TS_SYS_PROCESS_INFORMATION_NT4 structure is copied into the buffer.
ByteCount: The size, in bytes, of the pProcessBuffer parameter. If ByteCount is too small to receive the data, the method returns an error code (STATUS_INFO_LENGTH_MISMATCH, as specified in [MS- ERREF]) in the pResult parameter. Note that during failure there is no indication given to the caller specifying what the correct size should be if pProcessBuffer is too small.
Return Values: Returns TRUE if the call succeeded, or FALSE if the method failed. On failure, pResult indicates the failure status code.
Return value/code Description
0x01 Successful completion. TRUE
0x00 Method call failed. FALSE
1491.1.1.1.1 RpcWinStationEnumerateProcesses (Opnum 36)
175 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 The RpcWinStationEnumerateProcesses method retrieves the processes running on a remote server on which the caller has WINSTATION_QUERY permission to retrieve information. The method checks whether the caller has WINSTATION_QUERY permission (section 3.1.1) by setting it as the Access Request mask, and fails if the caller does not have the permission.<190>
1492 BOOLEAN RpcWinStationEnumerateProcesses(
1493 [in] SERVER_HANDLE hServer,
1494 [out] DWORD* pResult,
1495 [out, size_is(ByteCount)] PBYTE pProcessBuffer,
1496 [in, range(0, 0x8000 )] DWORD ByteCount
1497 ); hServer: Handle to the server object. This is of type SERVER_HANDLE. hServer MUST be obtained from a previous call to RpcWinStationOpenServer. pResult: Failure error code if the call to RpcWinStationEnumerateProcesses failed. If the call was successful, this parameter MUST be STATUS_SUCCESS (0x00000000), as specified in [MS-ERREF].
Value Meaning
STATUS_SUCCESS The call succeeded. 0x00000000
STATUS_INFO_LENGTH_MISMATCH ByteCount is too small to receive the data. 0xC0000004 pProcessBuffer: Pointer to a buffer receiving the list of processes.
In pProcessBuffer for each process, the server will return the following in the buffer, in this order: 1. A TS_PROCESS_INFORMATION_NT4 structure. 2. A number of SYSTEM_THREAD_INFORMATION (see [WININTERNALS] or [MSFT-WINSYSINTERNALS]) structures equal to the maximum number of threads in the process. 3. A TS_SYS_PROCESS_INFORMATION structure for the process. Only up to SIZEOF TS4_SYSTEM_THREAD_INFORMATION of the SYSTEM_THREAD_INFORMATION structure (as specified in [WININTERNALS] or [MSFT-WINSYSINTERNALS]) is copied into the buffer and only up to SIZEOF TS4_SYSTEM_PROCESS_INFORMATION of the TS_SYS_PROCESS_INFORMATION_NT4 structure is copied into the buffer.
ByteCount: The size, in bytes, of the pProcessBuffer parameter. If ByteCount is too small to receive the data, the method returns an error code (STATUS_INFO_LENGTH_MISMATCH, as specified in [MS- ERREF]) in the pResult parameter. Note that during failure there is no indication given to the caller specifying what the correct size should be if pProcessBuffer is too small.
Return Values: Returns TRUE if the call succeeded, or FALSE if the method failed. On failure, pResult indicates the failure status code.
176 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 Return value/code Description
0x01 Successful completion. TRUE
0x00 Method call failed. FALSE
1497.1.1.1.1 RpcWinStationTerminateProcess (Opnum 37) The RpcWinStationTerminateProcess method terminates the specified process. An attempt is made to enable the SE_DEBUG_PRIVILEGE privilege to kill processes not owned by the current user, including processes running in other terminal server sessions. Caller MUST have terminate permission to terminate the process.
1498 BOOLEAN RpcWinStationTerminateProcess(
1499 [in] SERVER_HANDLE hServer,
1500 [out] DWORD* pResult,
1501 [in] DWORD ProcessId,
1502 [in] DWORD ExitCode
1503 ); hServer: Handle to the server object. This is of type SERVER_HANDLE. hServer MUST be obtained from a previous call to RpcWinStationOpenServer. pResult: Failure error code if the call to RpcWinStationTerminateProcess failed. If the call was successful, this parameter MUST be STATUS_SUCCESS (0x00000000), as specified in [MS-ERREF].
Value Meaning
STATUS_SUCCESS The call succeeded. 0x00000000
STATUS_ACCESS_DENIED The caller does not have permission to terminate the process. 0xC0000022
ProcessId: The ID of the process to terminate.
ExitCode: The exit code to be used by the process and threads that are terminated as a result of this call.
Return Values: Returns TRUE if the call succeeded, and FALSE if the method failed. On failure, pResult indicates the failure status code.
Return value/code Description
0x01 Successful completion. TRUE
0x00 Method call failed. FALSE
177 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 1503.1.1.1.1 RpcWinStationGetAllProcesses (Opnum 43) The RpcWinStationGetAllProcesses method retrieves the list of processes running on the server machine. Only the processes from the sessions on which the user has WINSTATION_QUERY permission will be retrieved. The method checks whether the caller has WINSTATION_QUERY permission (section 3.1.1) by setting it as the Access Request mask, and fails if the caller does not have the permission.
1504 BOOLEAN RpcWinStationGetAllProcesses(
1505 [in] SERVER_HANDLE hServer,
1506 [out] DWORD* pResult,
1507 [in] ULONG Level,
1508 [in, out] BOUNDED_ULONG* pNumberOfProcesses,
1509 [out, size_is(,*pNumberOfProcesses)]
1510 PTS_ALL_PROCESSES_INFO* ppTsAllProcessesInfo
1511 ); hServer: Handle to the server object. This is of type SERVER_HANDLE. The hServer argument MUST be obtained from a previous call to RpcWinStationOpenServer. pResult: Failure error code if the call to RpcWinStationGetAllProcesses failed. If the call was successful, this parameter MUST be STATUS_SUCCESS (0x00000000).
Value Meaning
STATUS_SUCCESS The call was successful. 0x00000000
STATUS_ACCESS_DENIED The caller does not have permission. 0xC0000022
Level: MUST be 0. Any other value will lead to FALSE being returned by the method. pNumberOfProcesses: The number of processes requested by the caller. On return, this indicates the number of processes actually stored in the ppTsAllProcessesInfo parameter. ppTsAllProcessesInfo: Pointer to an array of processes allocated and returned by the method. *ppTsAllProcessesInfo is allocated by the method to be an array of TS_ALL_PROCESSES_INFO structures. The array returned by the method MUST be freed by the caller.
Return Values: Returns TRUE if the call succeeded, and FALSE if the lookup failed. On failure, pResult indicates the failure status code.
Return value/code Description
0x01 Successful completion. TRUE
0x00 Method call failed. FALSE
178 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 1511.1.1.1.1 RpcWinStationGetProcessSid (Opnum 44) The RpcWinStationGetProcessSid method retrieves the process security identifier (SID), as specified in [MS-DTYP] section 2.4.2, for a given process ID and process start time combination.<191>The caller MUST have the PROCESS_QUERY_INFORMATION access right to the process being queried and the TOKEN_QUERY access right to the access token associated with the process. For more information on the process access rights, see [MSDN- PROCRIGHTS]. For more information on access rights for access tokens, see [MSDN-TOKENRIGHTS].
1512 BOOLEAN RpcWinStationGetProcessSid(
1513 [in] SERVER_HANDLE hServer,
1514 [in] DWORD dwUniqueProcessId,
1515 [in] LARGE_INTEGER ProcessStartTime,
1516 [out] LONG* pResult,
1517 [in, out, unique, size_is(dwSidSize)]
1518 PBYTE pProcessUserSid,
1519 [in, range(0, 1024 )] DWORD dwSidSize,
1520 [in, out] DWORD* pdwSizeNeeded
1521 ); hServer: Handle to the server object. This is of type SERVER_HANDLE. The hServer argument MUST be obtained from a previous call to RpcWinStationOpenServer. dwUniqueProcessId: The process ID to retrieve the SID.
ProcessStartTime: The start time of the process indicated by dwUniqueProcessId. This is a 64-bit value representing the number of 100-nanosecond intervals since January 1, 1601 (UTC). ProcessStartTime combined with dwUniqueProcessId is used to identify a process. pResult: Failure error code if the call to RpcWinStationGetProcessSid failed. If the call was successful, this parameter MUST be STATUS_SUCCESS (0x00000000).
Value Meaning
STATUS_SUCCESS The call succeeded. 0x00000000
0x8007007A The size of pProcessUserSid buffer is too small.<192>
STATUS_BUFFER_TOO_SMALL The size of pProcessUserSid buffer is too small.<193> 0xC0000023
0x80070005 The caller does not have necessary permissions.<194>
STATUS_ACCESS_DENIED The caller does not have necessary permissions.<195> 0xC0000022 pProcessUserSid: The buffer into which the method MUST copy the SID of the process. MUST be NULL if dwSidSize is zero, in which case the correct size will be returned in pdwSizeNeeded.
179 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 dwSidSize: The size of the buffer, in bytes, pointed to by pProcessUserSid. If the buffer is too small, STATUS_BUFFER_TOO_SMALL<196> or 0x8007007A<197> is returned in pResult. pdwSizeNeeded: Indicates the length of the SID. If STATUS_BUFFER_TOO_SMALL<198> or 0x8007007A<199> is returned in pResult, this indicates to the caller the correct size to allocate to a buffer prior to calling the method again.
Return Values: Returns TRUE if the call succeeded, and FALSE if the method failed. On failure, pResult indicates the failure status code.
Return value/code Description
0x01 Successful completion. TRUE
0x00 Method call failed. FALSE
1521.1.1.1.1 RpcWinStationGetTermSrvCountersValue (Opnum 45) The RpcWinStationGetTermSrvCountersValue method retrieves the current value of requested terminal server performance counters. The caller is not required to have any specific permission to call this method.
1522 BOOLEAN RpcWinStationGetTermSrvCountersValue(
1523 [in] SERVER_HANDLE hServer,
1524 [out] DWORD* pResult,
1525 [in, range(0, 0x1000)] DWORD dwEntries,
1526 [in, out, size_is(dwEntries)] PTS_COUNTER pCounter
1527 ); hServer: Handle to the server object. This is of type SERVER_HANDLE. The hServer argument MUST be obtained from a previous call to RpcWinStationOpenServer. pResult: If the call was successful, this parameter MUST be STATUS_SUCCESS (0x00000000); otherwise it MUST be an implementation-specific negative value. dwEntries: The number of performance counters to query. Indicates the size of the array pointed to by pCounter. pCounter: An array of TS_COUNTER structures. The caller MUST set the dwCounterId in the TS_COUNTER structures for each entry in the array to indicate the counter whose current value to retrieve. On return, the method MUST set the value for that performance counter. If the performance counter ID is not recognized or is not supported, it will set the bResult to 0.
Return Values: Returns TRUE if the call succeeded, and FALSE if the method failed. On failure, pResult indicates the failure status code. Individual entries in the array pCounter will indicate whether or not the counter data for that counter could be retrieved.
Return value/code Description
0x01 Successful completion. TRUE
0x00 Method call failed.
180 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 Return value/code Description
FALSE
1527.1.1.1.1 RpcWinStationReInitializeSecurity (Opnum 46) The RpcWinStationReInitializeSecurity method reinitializes security for all non- console WinStations (remote connection protocols). <200> Existing sessions will not be affected, but future sessions will have the new security descriptor read from the registry applied to them. This method MUST be called by processes running as SYSTEM or as an Administrator.<201>
1528 BOOLEAN RpcWinStationReInitializeSecurity(
1529 [in] SERVER_HANDLE hServer,
1530 [out] DWORD* pResult
1531 ); hServer: Handle to the server object. This is of type SERVER_HANDLE. The hServer argument MUST be obtained from a previous call to RpcWinStationOpenServer. pResult: If the call was successful, this parameter MUST be STATUS_SUCCESS (0x00000000); otherwise, it MUST be an implementation-specific negative value.
Return Values: Returns TRUE if the call succeeded, and FALSE if the method failed. On failure, pResult indicates the failure status code.
Return value/code Description
0x01 Successful completion. TRUE
0x00 Method call failed. FALSE
1531.1.1.1.1 RpcWinStationGetLanAdapterName (Opnum 53) The RpcWinStationGetLanAdapterName method returns the name of the LAN adapter with a specific LAN adapter number (lana) and transport type, if it is configured to be used for a Terminal Services protocol connection. No special permissions are required to call this method. <202> <203>
1532 BOOLEAN RpcWinStationGetLanAdapterName(
1533 [in] SERVER_HANDLE hServer,
1534 [out] DWORD* pResult,
1535 [in, range(0, 0x1000)] DWORD PdNameSize,
1536 [in, size_is(PdNameSize)] PWCHAR pPdName,
1537 [in, range(0, 1024)] ULONG LanAdapter,
181 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 1538 [out] ULONG* pLength,
1539 [out, size_is(,*pLength)] PWCHAR* ppLanAdapter
1540 ); hServer: Handle to the server object. This is of type SERVER_HANDLE. The hServer argument MUST be obtained from a previous call to RpcWinStationOpenServer. pResult: If the call was successful, this parameter MUST be STATUS_SUCCESS (0x00000000); otherwise, it MUST be an implementation-specific negative value.
PdNameSize: The size, in bytes, of pPdName including the terminating NULL character. pPdName: The transport protocol type on which to retrieve information. This MUST be any of the following strings: tcp, netbios, ipx, spx.
LanAdapter: The number of the LAN adapter to retrieve information (also known as lana). If this is set to "0", it will always return a LAN adapter name to indicate all LAN adapters configured with the protocol, irrespective of the transport protocol type specified in pPdName. pLength: The pointer to a ULONG containing the length of the string ppLanAdapter, in characters including the terminating NULL character. If LanAdapter is 0, this value MUST be DEVICENAME_LENGTH+1. ppLanAdapter: The pointer to a string allocated by this method for retrieving the LAN adapter's name. This memory MUST be freed by the caller.
Return Values: Returns TRUE if the call is successful, and FALSE if the method fails. On failure, pResult indicates the failure status code.
Return value/code Description
0x01 Successful completion. TRUE
0x00 Method call failed. FALSE
1540.1.1.1.1 RpcWinStationUpdateSettings (Opnum 58) The RpcWinStationUpdateSettings method rereads settings for all WinStations. The caller MUST have WINSTATION_QUERY permission. The method checks whether the caller has WINSTATION_QUERY permission (section 3.1.1) by setting it as the Access Request mask, and fails if the caller does not have the permission.<204>
1541 BOOLEAN RpcWinStationUpdateSettings(
1542 [in] SERVER_HANDLE hServer,
1543 [out] DWORD* pResult,
1544 [in] DWORD SettingsClass,
1545 [in] DWORD SettingsParameters
1546 );
182 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 hServer: A handle to the server object of type SERVER_HANDLE. The hServer argument MUST be obtained from a previous call to RpcWinStationOpenServer. pResult: Failure error code if the call to RpcWinStationUpdateSettings failed. If the call was successful, this parameter MUST be STATUS_SUCCESS (0x00000000).
Value Meaning
STATUS_SUCCESS The call was successful. 0x00000000
STATUS_ACCESS_DENIED The caller does not have permission to read the settings. 0xC0000022
STATUS_INVALID_PARAMETER Unrecognized SettingsClass. 0xC000000D
SettingsClass: The class for which to update settings.
Value Meaning
WINSTACFG_SESSDIR Contacts Session Directory to reread the WinStation settings.<205> 0x00000001
WINSTACFG_LEGACY Rereads settings from the local registry for the configured winstations. This does 0x00000000 the same thing as RpcWinStationReadRegistry.
SettingsParameters: MUST be 0.
Return Values: Returns TRUE if the call succeeded, and FALSE if the method failed. On failure, pResult indicates the failure status code.
Return value/code Description
0x01 Successful completion. TRUE
0x00 Method call failed. FALSE
1546.1.1.1.1 RpcWinStationShadowStop (Opnum 59) The RpcWinStationShadowStop method stops all shadow operations on the specified session, including whether the session is acting as a shadow client (a session that is shadowing another session) or as a shadow target (a session being shadowed by another session). If the method succeeds, both the state of the session that started the shadow operation and the state of the session being shadowed are State_Active as defined in the WINSTATIONSTATECLASS enumeration (section 2.2.1.9). Caller MUST have WINSTATION_DISCONNECT and WINSTATION_RESET permissions. For each aforementioned required permission, the method checks whether the caller has the permission (section 3.1.1) by setting the Access Request mask to the specific permission, and fails if the caller does not have the permission.<206>
1547 BOOLEAN RpcWinStationShadowStop(
183 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 1548 [in] SERVER_HANDLE hServer,
1549 [out] DWORD* pResult,
1550 [in] DWORD LogonId,
1551 [in] BOOLEAN bWait
1552 ); hServer: Handle to the server object. This is of type SERVER_HANDLE. The hServer argument MUST be obtained from a previous call to RpcWinStationOpenServer. pResult: Failure error code if the call to RpcWinStationShadowStop failed. If the call was successful, this parameter MUST be STATUS_SUCCESS (0x00000000).
Value Meaning
STATUS_SUCCESS The call was successful. 0x00000000
STATUS_CTX_WINSTATION_NOT_FOUND Indicates the session does not exist. 0xC00A0015
STATUS_CTX_SHADOW_NOT_RUNNING Indicates the session is either not active or not being 0xC00A0036 shadowed.
STATUS_ACCESS_DENIED Indicates the caller does not have permission to end 0xC0000022 shadowing on the session.
LogonId: The ID of the session on which to stop shadowing operations. bWait: TRUE indicates wait for reset to complete, FALSE otherwise.
Return Values: Returns TRUE if the call succeeded, and FALSE if the method failed. On failure, pResult indicates the failure status code.
Return value/code Description
0x01 Successful completion. TRUE
0x00 Method call failed. FALSE
1552.1.1.1.1 RpcWinStationCloseServerEx (Opnum 60) The RpcWinStationCloseServerEx method closes the server handle for WinStation APIs. The call to this method MUST be serialized if there are multiple threads running; otherwise, the behavior of this function is unknown. No special permissions are required to call this method.
1553 BOOLEAN RpcWinStationCloseServerEx(
1554 [in, out] SERVER_HANDLE* phServer,
1555 [out] DWORD* pResult
1556 );
184 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 phServer: Pointer to a variable that is a handle to the server. The variable is of type SERVER_HANDLE. The handle MUST be returned from a previous call to RpcWinStationOpenServer. On return from this method, *phServer is set to NULL. pResult: If the call was successful, this parameter MUST be STATUS_SUCCESS (0x00000000); otherwise, it MUST be an implementation-specific negative value.
Return Values: Returns TRUE if the call succeeded, and FALSE if the call failed. On failure, pResult indicates the failure status code.
Return value/code Description
0x01 Successful completion. TRUE
0x00 Method call failed. FALSE
1556.1.1.1.1 RpcWinStationIsHelpAssistantSession (Opnum 61) The RpcWinStationIsHelpAssistantSession method determines if a session is created by the built-in HelpAssistant user account.<207> The caller is not required to have any specific permission to call this method.
1557 BOOLEAN RpcWinStationIsHelpAssistantSession(
1558 [in] SERVER_HANDLE hServer,
1559 [out] DWORD* pResult,
1560 [in] ULONG SessionId
1561 ); hServer: Handle to the server object. This is of type SERVER_HANDLE. The hServer argument MUST be obtained from a previous call to RpcWinStationOpenServer. pResult: Failure error code if the call to RpcWinStationIsHelpAssistantSession failed. If no error was encountered while executing the call, this parameter MUST be STATUS_SUCCESS (0x00000000).
Value Meaning
STATUS_SUCCESS The call was executed successfully. 0x00000000
STATUS_UNSUCCESSFUL Execution of the call failed. 0xC0000001
STATUS_CTX_WINSTATION_NOT_FOUND The SessionId does not exist. 0xC00A0015
STATUS_WRONG_PASSWORD This is a Help Assistant session but the help assistance ticket 0xC000006A associated with the session is no longer valid.
SessionId: The ID of the session to check.
Return Values: Returns TRUE if the session is running as HelpAssistant, and FALSE if this is not a HelpAssistant session or if an error was encountered during the test. On failure, pResult indicates the failure status code.
185 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 Return value/code Description
0x01 Successful completion. TRUE
0x00 Method call failed. FALSE
1561.1.1.1.1 RpcWinStationGetMachinePolicy (Opnum 62) The RpcWinStationGetMachinePolicy method returns a copy of the terminal server machine policy to the caller.<208> The caller is not required to have any specific permission to call this method.
1562 BOOLEAN RpcWinStationGetMachinePolicy(
1563 [in] SERVER_HANDLE hServer,
1564 [in, out, size_is(bufferSize)] PBYTE pPolicy,
1565 [in, range(0, 0x8000 )] ULONG bufferSize
1566 ); hServer: Handle to the server object. This is of type SERVER_HANDLE. The hServer argument MUST be obtained from a previous call to RpcWinStationOpenServer. pPolicy: Pointer to a buffer to receive the machine policy. This buffer MUST be of type POLICY_TS_MACHINE. bufferSize: Size of the buffer, in bytes, pointed to by pPolicy. This size MUST NOT be less than sizeof(POLICY_TS_MACHINE).
Return Values: Returns TRUE if the call succeeded, and FALSE if the method failed.
Return value/code Description
0x01 Successful completion. TRUE
0x00 Method call failed. FALSE
1566.1.1.1.1 RpcWinStationCheckLoopBack (Opnum 65) The RpcWinStationCheckLoopBack method checks if there is a loopback when a client tries to connect. Loopback refers to opening a terminal server session on the local machine.<209> The caller is not required to have any specific permission to call this method.
1567 BOOLEAN RpcWinStationCheckLoopBack(
1568 [in] SERVER_HANDLE hServer,
1569 [out] DWORD* pResult,
1570 [in] DWORD ClientLogonId,
186 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 1571 [in] DWORD TargetLogonId,
1572 [in, size_is(NameSize)] PWCHAR pTargetServerName,
1573 [in, range(0, 1024)] DWORD NameSize
1574 ); hServer: Handle to the server object. This is of type SERVER_HANDLE. The hServer argument MUST be obtained from a previous call to RpcWinStationOpenServer. pResult: Failure error code if the call to RpcWinStationCheckLoopBack failed. If the call was successful, this parameter MUST be STATUS_SUCCESS (0x00000000).
Value Meaning
STATUS_SUCCESS The call was successful. 0x00000000
STATUS_ACCESS_DENIED A loopback was detected. 0xC0000022
STATUS_CTX_WINSTATION_ACCESS_DENIED The server is in the process of shutting down and cannot 0xC00A002B complete the request.
ClientLogonId: The ID of the session from which the terminal server client was started.
TargetLogonId: The session ID to which the client is trying to connect. pTargetServerName: The name of the target server to which the client is connecting. The string MUST contain the terminating NULL character.
NameSize: The length of the pTargetServerName string in characters including the terminating NULL character.
Return Values: Returns FALSE if there is no loopback, and TRUE if a loopback was detected. This method returns TRUE also in the case when an error was encountered during the loopback test. In this case, the pResult value contains the relevant error code.
Return value/code Description
0x01 A loopback was detected or the method call failed. TRUE
0x00 A loopback was not detected. FALSE
1574.1.1.1.1 RpcConnectCallback (Opnum 66) The RpcConnectCallback method initiates a TCP connection to the specified IP address and waits for the party on the other end of the connection to start the Remote Desktop Protocol (RDP) connection sequence. More information on Remote Desktop Protocol can be found in [MS-RDPBCGR]. This method MUST be called by processes running as SYSTEM. Note that this function assumes that the address being passed in is an IPv4 address. IPv6 addresses are not supported.<210>
187 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 1575 BOOLEAN RpcConnectCallback(
1576 [in] SERVER_HANDLE hServer,
1577 [out] DWORD* pResult,
1578 [in] DWORD TimeOut,
1579 [in] ULONG AddressType,
1580 [in, size_is(AddressSize)] PBYTE pAddress,
1581 [in, range(0, 0x1000 )] ULONG AddressSize
1582 ); hServer: Handle to the server object. This is of type SERVER_HANDLE. The hServer argument MUST be obtained from a previous call to RpcWinStationOpenServer. pResult: Failure error code if the call to RpcConnectCallback failed. If the call was successful, this parameter MUST be STATUS_SUCCESS (0x00000000).
Value Meaning
STATUS_SUCCESS The call was successful. 0x00000000
STATUS_NOT_SUPPORTED AddressType is not TDI_ADDRESS_TYPE_IP. This is a standard 0xC00000BB representation of a type for an IP address. For more information, see [MSDN-TDIADDRESS].
STATUS_INVALID_PARAMETER AddressSize is not TDI_ADDRESS_LENGTH_IP. For more information, 0xC000000D see [MSDN-TDIADDRESS].
STATUS_ACCESS_DENIED The caller is not SYSTEM. 0xC0000022
TimeOut: Not used.
AddressType: MUST be TDI_ADDRESS_TYPE_IP. For more information, see [MSDN-TDIADDRESS]. pAddress: Pointer to the address itself. MUST be TDI_ADDRESS_IP. This is a standard representation for an IP address. For more information, see [MSDN-TDIADDRESS].
AddressSize: MUST be TDI_ADDRESS_LENGTH_IP. This is a standard representation for the length of an IP address. For more information, see [MSDN-TDIADDRESS].
Return Values: Returns TRUE if the call succeeded, and FALSE if the method failed. On failure, pResult indicates the failure status code.
Return value/code Description
0x01 Successful completion. TRUE
0x00 Method call failed. FALSE
1582.1.1.1.1 RpcWinStationGetAllProcesses_NT6 (Opnum 70)
188 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 The RpcWinStationGetAllProcesses_NT6 method retrieves the processes running a remote server machine. Only the processes from the sessions on which the caller has WINSTATION_QUERY permission will be retrieved. The method checks whether the caller has WINSTATION_QUERY permission (section 3.1.1) by setting it as the Access Request mask, and fails if the caller does not have the permission.
1583 BOOLEAN RpcWinStationGetAllProcesses_NT6(
1584 [in] SERVER_HANDLE hServer,
1585 [out] DWORD* pResult,
1586 [in] ULONG Level,
1587 [in, out] BOUNDED_ULONG* pNumberOfProcesses,
1588 [out, size_is(,*pNumberOfProcesses)]
1589 PTS_ALL_PROCESSES_INFO_NT6* ppTsAllProcessesInfo
1590 ); hServer: Handle to the server object. This is of type SERVER_HANDLE. The hServer argument MUST be obtained from a previous call to RpcWinStationOpenServer. pResult: Failure error code if the call to RpcWinStationGetAllProcesses_NT6 failed. If the call was successful, this parameter MUST be STATUS_SUCCESS (0x00000000).
Value Meaning
STATUS_SUCCESS The call was successful. 0x00000000
STATUS_ACCESS_DENIED The caller does not have permission for the operation. 0xC0000022
Level: MUST be GAP_LEVEL_BASIC (0). Any other value will lead to the method returning FALSE. pNumberOfProcesses: The number of processes requested by the caller. On return, this indicates the number of processes actually stored in the ppTsAllProcessesInfo parameter. ppTsAllProcessesInfo: Pointer to an array of processes allocated and returned by the method. *ppTsAllProcessesInfo is allocated by the method to be an array of TS_ALL_PROCESSES_INFO_NT6 structures. The array returned by the method MUST be freed by the caller.
Return Values: Returns TRUE if the call succeeded, and FALSE if the lookup failed. On failure, pResult indicates the failure status code.
Return value/code Description
0x01 Successful completion. TRUE
0x00 Method call failed. FALSE
1590.1.1.1.1 RpcWinStationOpenSessionDirectory (Opnum 75)
189 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 The RpcWinStationOpenSessionDirectory method pings the Session Directory to see if it can accept RPC calls. The caller MUST be either SYSTEM or an administrator. The method performs access checks as defined in sections 3.1.2 and 3.1.3. The method fails if both checks fail. For more information about the Session Directory, see [MSFT-SDLBTS].<211>
1591 BOOLEAN RpcWinStationOpenSessionDirectory(
1592 [in] SERVER_HANDLE hServer,
1593 [out] DWORD* pResult,
1594 [in, string, max_is(64)] PWCHAR pszServerName
1595 ); hServer: Handle to the server object. This is of type SERVER_HANDLE. The hServer argument MUST be obtained from a previous call to RpcWinStationOpenServer. pResult: Failure error code if the call to RpcWinStationOpenSessionDirectory failed. If the call was successful, this parameter MUST be STATUS_SUCCESS (0x00000000).
Value Meaning
STATUS_SUCCESS The call was successful. 0x00000000
STATUS_UNSUCCESSFUL The server is not in application server mode on an advanced servers Stock 0xC0000001 Keeping Unit (SKU).
STATUS_ACCESS_DENIED The caller is not SYSTEM nor an administrator. 0xC0000022 pszServerName: The name of the server hosting session directory to which to attempt connection.
Return Values: Returns TRUE if the call succeeded, and FALSE if the method failed. On failure, pResult indicates the failure status code.
Return value/code Description
0x01 Successful completion. TRUE
0x00 Method call failed. FALSE
1595.1.1 Timer Events None.
1595.1.2 Other Local Events None.
190 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 1595.2 Virtual IP Client Detail
1595.2.1 Abstract Data Model None.
1595.2.2 Timers No protocol timers are required beyond those used internally by RPC to implement resiliency to network outages, as specified in [MS-RPCE].
1595.2.3 Initialization The client MUST create an RPC connection to the terminal server by using the details specified in section 2.1.
1595.2.4 Message Processing Events and Sequencing Rules When a method completes, the values returned by the RPC MUST be returned unmodified to the upper layer.
1595.2.5 Timer Events None.
1595.2.6 Other Local Events None.
1595.3 Virtual IP Server Detail
1595.3.1 Abstract Data Model This section describes a conceptual model of possible data organization that an implementation maintains to participate in this protocol. The described organization is provided to facilitate the explanation of how the protocol behaves. This document does not mandate that implementations adhere to this model as long as their external behavior is consistent with that described in this document.
1595.3.1.1 Abstract Data Types
TSVIPSession: Structure containing the IP address assigned to the session. It is described in section 2.2.2.50 and is used with RpcGetSessionIP.
1595.3.2 Timers None.
1595.3.3 Initialization Parameters necessary to initialize the RPC protocol are specified in section 2.1.
191 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 1595.3.4 Message Processing Events and Sequencing Rules This protocol asks the RPC runtime to perform a strict Network Data Representation (NDR) data consistency check at target level 6.0 for all methods unless otherwise specified, as defined in [MS-RPCE] section 1.3. When a method completes, the values returned by RPC MUST be returned unmodified to the upper layer. The methods MAY throw an exception and the Terminal Services client MUST handle these exceptions by returning the unmodified exception code to the upper layer.
1595.3.4.1 TSVIPPublic The TSVIPPublic provides methods to retrieve IP assigned to the session. For information about endpoints, UUID values, and versions, see sections 2.1 and 1.9. Methods in RPC Opnum Order Method Description
RpcGetSessionIP Returns IP address assigned to the session. Opnum: 0
1595.3.4.1.1 RpcGetSessionIP (Opnum 0) The RpcGetSessionIP method retrieves the IP address assigned to the session. This MUST be called by an administrator or the same user who logged onto the session.<212> The method performs access checks as defined in section 3.1.3 and 3.1.4. The method fails if both checks fail.
1596 HRESULT RpcGetSessionIP(
1597 [in] handle_t hBinding,
1598 [in] unsigned short Family,
1599 [in] DWORD SessionId,
1600 [ref, out] TSVIPSession* ppVIPSession
1601 ); hBinding: The RPC binding handle. For more information, see [MSDN-RPCBIND].
Family: MUST be AF_INET.
SessionId: The identifier of the session to open. This session MUST be present on the terminal server. This MUST NOT be the session ID of any of the listener sessions. ppVIPSession: The session structure containing the IP address assigned to the session. This is of type TSVIPSession.
Return Values: The method MUST return S_OK (0x00000000) on success; otherwise, it MUST return an implementation-specific negative value.
Return value/code Description
0x00000000 Successful completion.
192 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 Return value/code Description
S_OK
1601.1.1 Timer Events None.
1601.1.2 Other Local Events None.
1601.2 SessEnv Details
1601.2.1 Abstract Data Model None.
1601.2.2 Timers None.
1601.2.3 Initialization Parameters necessary to initialize the RPC protocol are specified in section 2.1.
1601.2.4 Message Processing Events and Sequencing Rules This protocol asks the RPC runtime to perform a strict NDR data consistency check at target level 6.0 for all methods unless otherwise specified, as defined in [MS-RPCE] section 1.3. When a method completes, the values returned by RPC MUST be returned unmodified to the upper layer. The methods MAY throw an exception, and the Terminal Services client MUST handle these exceptions by returning the unmodified exception code to the upper layer.
1601.2.4.1 SessEnvPublicRpc The SessEnvPublicRpc interface provides methods to call into the SessionEnv service remotely. For information about endpoints, UUID values, and versions, see sections 2.1 and 1.9. Methods in RPC Opnum Order Method Description
RpcShadow2 Creates a Windows Desktop Sharing API invitation in the specified target session. Opnum: 0
1601.2.4.1.1 RpcShadow2 (Opnum 0)
193 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 The RpcShadow2 method will create a shadow session using the Windows Desktop Sharing API in the target session and return an invitation to that session. The caller MUST have WINSTATION_SHADOW permission. The other session can be local or on a terminal server. The session to be shadowed MUST be in the active state with a user logged on. The method checks whether the caller has WINSTATION_SHADOW permission (section 3.1.1) and fails if the caller does not have the permission.
1602 HRESULT RpcShadow2(
1603 [in] handle_t hBinding,
1604 [in] ULONG TargetSessionId,
1605 [in] SHADOW_CONTROL_REQUEST eRequestControl,
1606 [in] SHADOW_PERMISSION_REQUEST eRequestPermission,
1607 [out] SHADOW_REQUEST_RESPONSE* pePermission,
1608 [out, string, size_is(cchInvitation)]
1609 LPWSTR pszInvitation,
1610 [in, range(1,8192)] ULONG cchInvitation
1611 ); hBinding: The RPC binding handle. For more information, see [MSDN-RPCBIND].
TargetSessionId: The ID of the session to be shadowed. eRequestControl: Specifies a request for either a UI interaction or a view-only session. eRequestPermission: Specifies whether permission should be requested before the shadow session is started. The call is synchronous, so if permission is requested, the call will wait until the user responds to the request. pePermission: User response to permission request. If the response is anything other than SHADOW_REQUEST_RESPONSE_ALLOW, the shadow session has been denied. pszInvitation: The output data containing the invitation string for the shadow session. The data returned is an invitation string in an XML format that can be used with the Windows Desktop Sharing API IRDPSRAPIViewer::Connect method to connect to the session running in the target session (specified by TargetSessionId). The caller must allocate a buffer to hold this data and specify the size of the buffer in cchInvitation. cchInvitation: The size, in WCHARs (16-bit Unicode), of pszInvitation.
Return Values: The method MUST return S_OK (0x00000000) on success; otherwise, it MUST return an implementation-specific negative value.
Return value/code Description
0x00000000 Successful completion. S_OK
194 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 1611.1.1 Timer Events None.
1611.1.2 Other Local Events None.
195 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 1612 Protocol Examples
1612.1 LSM Enumeration Example The following example shows how to enumerate sessions on a terminal server. This example uses TermSrvBindSecure from section 4.3. 1. Get the LSM Binding.
1613 HANDLE GetLSMBinding(LPWSTR pszServerName)
1614 {
1615 HANDLE hLSMBinding = NULL;
1616 RPC_STATUS rpcStatus = RPC_S_OK;
1617
1618 //ASSERT( NULL != pszServerName );
1619 rpcStatus = TermSrvBindSecure(
1620 gpszPublicUuid,
1621 gpszRemoteProtocolSequence,
1622 pszServerName,
1623 TSRPC_REMOTE_ENDPOINT,
1624 gpszOptions,
1625 &hLSMBinding
1626 );
1627
1628 if( rpcStatus != RPC_S_OK || hLSMBinding == NULL)
1629 {
1630 wprintf(L"ERR: TermSrvBindSecure failed: %d\n",
1631 rpcStatus );
1632 SetLastError( rpcStatus );
1633 }
1634
1635 return hLSMBinding;
1636 }
1637
196 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 2. Enumerate the sessions.
1638 RpcTryExcept
1639 {
1640 hr = RpcOpenEnum( hLSMBind, &hEnum );
1641 if(hr == S_OK)
1642 {
1643 hr = RpcGetEnumResult( hEnum, &pAllSessions,
1644 CURRENT_ENUM_LEVEL, &Entries );
1645 if(hr == S_OK)
1646 {
1647 for(ULONG i=0;i 1648 { 1649 wprintf(L"%-10d %-20s %-40s\n", 1650 pAllSessions[i].Data.SessionEnum_Level3.SessionId, 1651 WinstationStateClassNames[pAllSessions[i].Data. 1652 SessionEnum_Level3.State], 1653 pAllSessions[i].Data.SessionEnum_Level3.Name); 1654 1655 if( NULL != pAllSessions[i].Data.SessionEnum_Level3. 1656 pProtocolData ) 1657 { 1658 MIDL_user_free( pAllSessions[i].Data. 1659 SessionEnum_Level3.pProtocolData ); 1660 } 1661 } 1662 1663 rv1 = TRUE; 1664 } 1665 else 1666 { 197 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 1667 wprintf(L"ERR: RpcGetEnumResult failed %d\n",hr ); 1668 } 1669 1670 if ( pAllSessions ) 1671 { 1672 MIDL_user_free(pAllSessions); 1673 } 1674 1675 } 1676 else 1677 { 1678 wprintf(L"ERR: RpcOpenEnum failed %d\n",hr ); 1679 } 1680 1681 } 1682 1683 RpcExcept(I_RpcExceptionFilter(RpcExceptionCode())) 1684 { 1685 wprintf(L"ERR: RPC Exception %d\n",RpcExceptionCode() ); 1686 } 1687 1688 RpcEndExcept 1689 1690 1691 3. Close the handles. 1692 if(hEnum) 1693 RpcCloseEnum(&hEnum); 1694 198 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 1695 if(hLSMBind) 1696 RpcBindingFree(&hLSMBind); 1697 The following diagram illustrates the message sequence for enumerating the sessions. Figure 1: LSM session enumeration sequence The sequence of messages for enumerating sessions on the server is as follows: 1. After an RPC binding has been established to the server, the client requests a session enumeration handle to be opened by the server by calling the RpcOpenEnum method. 2. The server in response will open a handle of the type ENUM_HANDLE and return to the client. 3. The client then calls the RpcGetEnumResult method by passing this handle along with an uninitialized buffer to get the list of sessions. 4. The server on receiving the request will allocate memory for the buffer and fill it with an array of SESSIONENUM structures containing session information, one for each session on the server. It will also return the number of sessions on the server. 5. The client on receiving the data MUST call the RpcCloseEnum method to inform the server to close the enumeration handle. 199 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 6. Server on receiving the RpcCloseEnum call will close the enumeration handle. 7. The client MUST free the array of SESSIONENUM structures it received before exiting. 1697.1 TermService Listener Example The following example retrieves the listeners that run on the terminal server. This example uses TermSrvBindSecure from section 4.3. 1. Get the RCM binding. 1698 HANDLE GetRCMBinding(LPWSTR pszServerName) 1699 { 1700 RPC_STATUS rpcStatus = RPC_S_OK; 1701 HANDLE hRCMBinding = NULL; 1702 1703 rpcStatus = TermSrvBindSecure( 1704 gpszPublicUuid, 1705 gpszRemoteProtocolSequence, 1706 pszServerName, 1707 TSRCMRPC_REMOTE_ENDPOINT, 1708 gpszOptions, 1709 &hRCMBinding 1710 ); 1711 1712 if( rpcStatus != RPC_S_OK || hRCMBinding == NULL) 1713 { 1714 wprintf(L"ERR: TermSrvBindSecure failed: %d\n", rpcStatus ); 1715 SetLastError( rpcStatus ); 1716 } 1717 1718 return hRCMBinding 1719 } 1720 1721 200 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 2. Get the list of listeners. 1722 hRCMBind = GetRCMBinding(pszServerName); 1723 if(hRCMBind) 1724 { 1725 RpcTryExcept 1726 { 1727 hr = RpcGetAllListeners( hRCMBind, &pListeners, 1728 CURRENT_LST_ENUM_LEVEL, &NumListeners ); 1729 if(hr == S_OK) 1730 { 1731 for(ULONG i=0;i 1732 { 1733 wprintf(L"%-10d %-20s %-40s\n", 1734 pListeners[i].Data.ListenerEnum_Level1.Id, WinstationStateClassNames[pListeners[i].Data.ListenerEnum_Level1.bListening ? State_Listen : State_Down], 1735 pListeners[i].Data.ListenerEnum_Level1.Name); 1736 } 1737 rv2 = TRUE; 1738 } 1739 else 1740 { 1741 wprintf(L"ERR: RpcGetAllListeners failed %d\n",hr ); 1742 } 1743 1744 if ( pListeners ) 1745 { 1746 MIDL_user_free( pListeners ); 1747 } 1748 1749 } 201 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 1750 1751 RpcExcept(I_RpcExceptionFilter(RpcExceptionCode())) 1752 { 1753 hr = HRESULT_FROM_WIN32( RpcExceptionCode() ); 1754 wprintf(L"ERR: RpcGetAllListeners threw an exception: 0x%x\n", 1755 hr ); 1756 } 1757 1758 RpcEndExcept 1759 1760 1761 RpcBindingFree(&hRCMBind); 1762 } 1763 1764 3. Close the handle. 1765 1766 if(hRCMBind) 1767 RpcBindingFree(&hRCMBind); 1768 1768.1 TermSrvBindSecure Example The following example creates an RPC binding to an endpoint that uses authentication, authorization, and security quality-of-service information. 1769 RPC_STATUS 1770 TermSrvBindSecure( 1771 LPCWSTR pszUuid, 1772 LPCWSTR pszProtocolSequence, 1773 LPCWSTR pszNetworkAddress, 1774 LPCWSTR pszEndPoint, 202 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 1775 LPCWSTR pszOptions, 1776 RPC_BINDING_HANDLE *pHandle 1777 ) 1778 { 1779 RPC_STATUS Status; 1780 RPC_SECURITY_QOS qos; 1781 LPWSTR wszServerSPN = NULL; 1782 1783 *pHandle = NULL; 1784 1785 Status = TermSrvBind( 1786 pszUuid, 1787 pszProtocolSequence, 1788 pszNetworkAddress, 1789 pszEndPoint, 1790 pszOptions, 1791 pHandle); 1792 1793 if( Status != RPC_S_OK ) 1794 { 1795 wprintf ( L"Error %d in TermSrvBind", Status ); 1796 goto TS_EXIT_POINT; 1797 } 1798 1799 qos.Capabilities = RPC_C_QOS_CAPABILITIES_MUTUAL_AUTH; 1800 qos.IdentityTracking = RPC_C_QOS_IDENTITY_DYNAMIC; 1801 qos.ImpersonationType = RPC_C_IMP_LEVEL_IMPERSONATE; 1802 qos.Version = RPC_C_SECURITY_QOS_VERSION; 1803 1804 if( PrepareServerSPN( pszNetworkAddress, &wszServerSPN )) 203 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 1805 { 1806 Status = RpcBindingSetAuthInfoEx( 1807 *pHandle, 1808 wszServerSPN, 1809 RPC_C_AUTHN_LEVEL_PKT_PRIVACY, 1810 RPC_C_AUTHN_GSS_NEGOTIATE, 1811 NULL, 1812 RPC_C_AUTHZ_NAME, 1813 &qos); 1814 1815 LocalFree(wszServerSPN); 1816 } 1817 else 1818 { 1819 Status = RpcBindingSetAuthInfoEx( 1820 *pHandle, 1821 (LPWSTR)pszNetworkAddress, 1822 RPC_C_AUTHN_LEVEL_PKT_PRIVACY, 1823 RPC_C_AUTHN_GSS_NEGOTIATE, 1824 NULL, 1825 RPC_C_AUTHZ_NAME, 1826 &qos); 1827 } 1828 1829 if ( RPC_S_OK != Status ) 1830 { 1831 wprintf ( L"Error %d in RpcBindingSetAuthInfoEx", Status ); 1832 goto TS_EXIT_POINT; 1833 } 204 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 1834 1835 TS_EXIT_POINT: 1836 1837 if ( RPC_S_OK != Status && 1838 NULL != *pHandle ) 1839 { 1840 RpcBindingFree( pHandle ); 1841 } 1842 1843 return Status; 1844 } 1845 Generate a standard RPC binding from the protocol sequence, security options, and UUID, for example. 1846 1847 1848 RPC_STATUS 1849 TermSrvBind( 1850 IN LPCWSTR pszUuid, 1851 IN LPCWSTR pszProtocolSequence, 1852 IN LPCWSTR pszNetworkAddress, 1853 IN LPCWSTR pszEndPoint, 1854 IN LPCWSTR pszOptions, 1855 OUT RPC_BINDING_HANDLE *pHandle 1856 ) 1857 { 1858 RPC_STATUS Status; 1859 LPWSTR pszString = NULL; 1860 1861 /* 205 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 1862 * Compose the binding string using the helper routine 1863 * and our protocol sequence, security options, UUID, and so on. 1864 */ 1865 Status = RpcStringBindingCompose( 1866 (LPWSTR)pszUuid, 1867 (LPWSTR)pszProtocolSequence, 1868 (LPWSTR)pszNetworkAddress, 1869 (LPWSTR)pszEndPoint, 1870 (LPWSTR)pszOptions, 1871 &pszString 1872 ); 1873 1874 if( Status != RPC_S_OK ) 1875 { 1876 wprintf ( L"Error %d in RpcStringBindingCompose", Status ); 1877 goto TS_EXIT_POINT; 1878 } 1879 1880 /* 1881 * Now generate the RPC binding from the canonical RPC 1882 * binding string. 1883 */ 1884 Status = RpcBindingFromStringBinding( 1885 pszString, 1886 pHandle 1887 ); 1888 1889 if( Status != RPC_S_OK ) 1890 { 206 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 1891 wprintf ( L"Error %d in RpcBindingFromStringBinding", Status ); 1892 goto TS_EXIT_POINT; 1893 } 1894 1895 TS_EXIT_POINT: 1896 1897 if ( NULL != pszString ) 1898 { 1899 /* 1900 * Free the memory returned from RpcStringBindingCompose() 1901 */ 1902 RpcStringFree( &pszString ); 1903 } 1904 1905 return( Status ); 1906 } 1907 Recreate a valid SPN for Windows Vista operating system from an existing SPN. 1908 1909 1910 BOOL 1911 PrepareServerSPN( 1912 IN LPCWSTR pszNetworkAddress, 1913 __deref_out_opt LPWSTR *ppwszServerSPN 1914 ) 1915 { 1916 // Windows Server 2008 RPC does not accept "net use" credential anymore. 1917 // 1918 207 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 1919 LPWSTR pszTemplate = L"host/%s"; 1920 *ppwszServerSPN = NULL; 1921 HRESULT hr = S_OK; 1922 1923 UINT stringLength = wcslen(pszTemplate)+wcslen(pszNetworkAddress)+1; 1924 1925 *ppwszServerSPN = (LPWSTR)LocalAlloc(LPTR, stringLength * sizeof(WCHAR)); 1926 if(*ppwszServerSPN) 1927 { 1928 hr = StringCchPrintf( *ppwszServerSPN, stringLength, pszTemplate, 1929 pszNetworkAddress ); 1930 ASSERT( SUCCEEDED( hr )); 1931 } 1932 1933 if( FAILED(hr) ) 1934 { 1935 if( NULL != *ppwszServerSPN ) 1936 { 1937 LocalFree( *ppwszServerSPN ); 1938 *ppwszServerSPN = NULL; 1939 } 1940 } 1941 1942 return SUCCEEDED(hr); 1943 } 1944 1944.1 Legacy Example The following example shows how to enumerate sessions that use the legacy RPC methods. 1. Get the binding. 208 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 1945 Result = TermSrvBindSecure( 1946 pszUuid, 1947 pszRemoteProtocolSequence, 1948 pServerName, 1949 pszRemoteEndPoint, 1950 pszOptions, 1951 &RpcTSHandle 1952 ); 1953 // 1954 // Get a context handle from the server so it can 1955 // manage the connections state 1956 // 1957 RpcTryExcept { 1958 rc = RpcWinStationOpenServer( RpcTSHandle, &Result, &ContextHandle ); 1959 } 1960 RpcExcept(I_RpcExceptionFilter(RpcExceptionCode())) { 1961 Result = RpcExceptionCode(); 1962 rc = FALSE; 1963 wprintf(L"ERR: RPC Exception %d\n",Result ); 1964 } 1965 RpcEndExcept 1966 1967 2. Enumerate the sessions. 1968 RpcTryExcept { 1969 1970 rc = RpcWinStationEnumerate( 1971 hServer, 1972 &Result, 209 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 1973 &LogonIdCount, 1974 (PCHAR)pLogonId, 1975 &Length, 1976 &Index 1977 ); 1978 Result = RtlNtStatusToDosError( Result ); 1979 if ( Result == ERROR_NO_MORE_ITEMS) { 1980 Result = ERROR_SUCCESS; 1981 break; 1982 } 1983 1984 if(rc == TRUE) 1985 { 1986 wprintf(L"SessionID State Name\n"); 1987 for(ULONG i=0;i 1988 { 1989 wprintf(L"%-10d %-20s %-40s\n", 1990 pLogonId[i].SessionId, 1991 WinstationStateClassNames[pLogonId[i].State], 1992 pLogonId[i].WinStationName); 1993 } 1994 } 1995 } 1996 RpcExcept(I_RpcExceptionFilter(RpcExceptionCode())) { 1997 Result = RpcExceptionCode(); 1998 wprintf(L"ERR: RPC Exception %d\n",Result ); 1999 } 2000 RpcEndExcept 2001 2002 210 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 3. Close the binding handles. 2003 RpcTryExcept { 2004 2005 bSuccess = RpcWinStationCloseServerEx( pHandle, pdwResult ); 2006 if( !bSuccess ) *pdwResult = RtlNtStatusToDosError( *pdwResult ); 2007 2008 } 2009 RpcExcept(I_RpcExceptionFilter(RpcExceptionCode())) { 2010 2011 *pdwResult = RpcExceptionCode(); 2012 bSuccess = FALSE; 2013 } 2014 RpcEndExcept 2015 The following diagram illustrates the message sequence for enumerating the sessions. Figure 2: Legacy session enumeration sequence 211 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 The sequence of messages for enumerating sessions on the server is as follows: 1. After an RPC binding has been established to the server, the client requests a handle to the server to be opened by calling the RpcWinStationOpenServer method. 2. The server in response will open up a handle and return to the client. 3. The client then calls the RpcWinStationEnumerate method by passing this handle along with an uninitialized buffer to get the list of sessions. 4. The server on receiving the request will allocate memory for the buffer and fill it with an array of LOGONID structures containing session information, one for each session on the server. It will also return the number of sessions on the server. 5. The client on receiving the data MUST call the RpcWinStationCloseServerEx method to inform the server to close the server handle. 6. The server on receiving the RpcWinStationCloseServerEx call will close the server handle. 7. The client MUST free the array of SESSIONENUM structures it received before exiting. 2015.1 Encoding/Decoding Example The following is the example of encoding and decoding the PropValue field in the TSProperty structure. 2016 #include 2017 #include 2018 #include 2019 2020 DWORD 2021 EncodePropValue 2022 ( 2023 __in BYTE* pbSource, 2024 __in DWORD dwSourceLength, 2025 __deref_out_bcount(*pdwDestLength) BYTE** ppbDest, 2026 __out DWORD* pdwDestLength 2027 ); 2028 2029 DWORD 2030 DecodePropValue 212 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 2031 ( 2032 __in BYTE* pbSource, 2033 __in DWORD dwSourceLength, 2034 __deref_out_bcount(*pdwDestLength) BYTE** ppbDest, 2035 DWORD *pdwDestLength 2036 ); 2037 2038 int _tmain() 2039 { 2040 2041 char* pPropValue = "ABCDE"; 2042 2043 char* pEncoded = NULL; 2044 DWORD cbEncoded = 0; 2045 char* pDecoded = NULL; 2046 DWORD cbDecoded = 0; 2047 2048 // 2049 // Encoding a property value to be compatible with TSProperty structure. 2050 // 2051 EncodePropValue( PBYTE(pPropValue), (strlen(pPropValue)+1), (PBYTE*)&pEncoded, &cbEncoded ); 2052 2053 // 2054 // Decoding the encoded string. 2055 // 2056 DecodePropValue( PBYTE(pEncoded), cbEncoded, (PBYTE*)&pDecoded, &cbDecoded ); 2057 printf("Decoded: %s\n", pDecoded); 2058 2059 delete[] PBYTE(pEncoded); 213 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 2060 delete[] PBYTE(pDecoded); 2061 2062 return 0; 2063 } 2064 2065 DWORD 2066 EncodePropValue 2067 ( 2068 __in BYTE* pbSource, 2069 __in DWORD dwSourceLength, 2070 __deref_out_bcount(*pdwDestLength) BYTE** ppbDest, 2071 __out DWORD* pdwDestLength 2072 ) 2073 { 2074 *ppbDest = new BYTE[(dwSourceLength*2)+1]; 2075 2076 for(DWORD i=0; i 2077 { 2078 sprintf((char*)((*ppbDest)+(i*2)), "%02x", pbSource[i]); 2079 } 2080 2081 *pdwDestLength = dwSourceLength*2; 2082 2083 return 0; 2084 } 2085 2086 #define MAPHEXTODIGIT(x) ( x >= '0' && x <= '9' ? (x-'0') : \ 2087 x >= 'A' && x <= 'F' ? (x-'A'+10) : \ 2088 x >= 'a' && x <= 'f' ? (x-'a'+10) : 0 ) 2089 214 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 2090 DWORD 2091 DecodePropValue 2092 ( 2093 __in BYTE* pbSource, 2094 __in DWORD dwSourceLength, 2095 __deref_out_bcount(*pdwDestLength) BYTE** ppbDest, 2096 DWORD *pdwDestLength 2097 ) 2098 { 2099 *pdwDestLength = dwSourceLength/2; 2100 (*ppbDest) = new BYTE[*pdwDestLength]; 2101 2102 for(DWORD i=0; i<(*pdwDestLength); i++) 2103 { 2104 (*ppbDest)[i] = MAPHEXTODIGIT( pbSource[2*i]) * 16 + 2105 MAPHEXTODIGIT( pbSource[2*i+1]); 2106 } 2107 2108 return 0; 2109 } 2110 215 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 2111 Security 2111.1 Security Considerations for Implementers The Terminal Services Terminal Server Runtime Interface Protocol allows any user to connect to the server, as specified in section 2.1. Therefore, any security bug in the server implementation could be exploitable. The server implementation should enforce security on each method. 2111.2 Index of Security Parameters The only security parameter is Authentication Protocol, section 2.1. 216 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 2112 Appendix A: Full IDL For ease of implementation, the full IDL and headers are provided in the following sections, where "ms-dtyp.idl" is the IDL as described in [MS-DTYP] Appendix A. When compiling these IDLs with the MIDL compiler, "MIDL_PASS" must be defined. This can be done by using the midl command line with the /D switch. For example, "midl /D MIDL_PASS legacy.idl". 2112.1 Appendix A.1: tspubrpc.idl For ease of implementation, the full IDL is provided, where "ms-dtyp.idl" is the IDL as described in [MS-DTYP] Appendix A and "tsdef.h" is as specified in section 6.5. 2113 import "ms-dtyp.idl"; 2114 2115 #include "ms-tsts_tsdef.h" 2116 #include "ms-tsts_allproc.h" 2117 2118 [ 2119 uuid(484809d6-4239-471b-b5bc-61df8c23ac48), 2120 version(1.0), 2121 pointer_default(unique) 2122 ] 2123 2124 // 2125 // Public rpc interface to the session object 2126 // 2127 2128 interface TermSrvSession 2129 { 2130 cpp_quote("#define WTS_SESSIONSTATE_UNKNOWN 0xFFFFFFFF") 2131 cpp_quote("#define WTS_SESSIONSTATE_LOCK 0x00000000") 2132 cpp_quote("#define WTS_SESSIONSTATE_UNLOCK 0x00000001") 2133 217 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 2134 typedef [context_handle] void *SESSION_HANDLE; 2135 2136 typedef struct _LSMSessionInformation { 2137 [string] WCHAR* pszUserName; 2138 [string] WCHAR* pszDomain; 2139 [string] WCHAR* pszTerminalName; 2140 LONG SessionState; 2141 BOOL DesktopLocked; 2142 hyper ConnectTime; 2143 hyper DisconnectTime; 2144 hyper LogonTime; 2145 } LSMSESSIONINFORMATION, 2146 *PLSMSESSIONINFORMATION; 2147 2148 typedef struct _LSM_SESSIONINFO_EX_LEVEL1 { 2149 LONG SessionState; 2150 LONG SessionFlags; 2151 WCHAR SessionName[33]; 2152 WCHAR DomainName[18]; 2153 WCHAR UserName[21]; 2154 hyper ConnectTime; 2155 hyper DisconnectTime; 2156 hyper LogonTime; 2157 hyper LastInputTime; 2158 ULONG ProtocolDataSize; 2159 [size_is(ProtocolDataSize)] PBYTE ProtocolData; 2160 } LSM_SESSIONINFO_EX_LEVEL1, 2161 *PLSM_SESSIONINFO_EX_LEVEL1; 2162 218 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 2163 typedef [switch_type (DWORD)] union _LSM_SESSIONINFO_EX { 2164 [case(1)] 2165 LSM_SESSIONINFO_EX_LEVEL1 LSM_SessionInfo_Level1; 2166 } LSM_SESSIONINFO_EX, 2167 *PLSM_SESSIONINFO_EX; 2168 2169 typedef struct _LSMSESSIONINFORMATION_EX { 2170 DWORD Level; 2171 [switch_is(Level)] LSM_SESSIONINFO_EX Data; 2172 } LSMSESSIONINFORMATION_EX, 2173 *PLSMSESSIONINFORMATION_EX; 2174 2175 // 2176 // Per Session specific call 2177 HRESULT RpcOpenSession( 2178 [in] handle_t hBinding, 2179 [in] LONG SessionId, 2180 [out] SESSION_HANDLE *phSession 2181 ); 2182 2183 HRESULT RpcCloseSession( 2184 [in,out] SESSION_HANDLE *phSession 2185 ); 2186 2187 HRESULT RpcConnect( 2188 [in] SESSION_HANDLE hSession, 2189 [in] LONG TargetSessionId, 2190 [in,string] WCHAR *szPassword 2191 ); 219 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 2192 2193 HRESULT RpcDisconnect( 2194 [in] SESSION_HANDLE hSession 2195 ); 2196 2197 HRESULT RpcLogoff( 2198 [in] SESSION_HANDLE hSession 2199 ); 2200 2201 HRESULT RpcGetUserName( 2202 [in] SESSION_HANDLE hSession, 2203 [out, string] WCHAR **pszUserName, 2204 [out, string] WCHAR **pszDomain 2205 ); 2206 2207 HRESULT RpcGetTerminalName( 2208 [in] SESSION_HANDLE hSession, 2209 [out, string] WCHAR **pszTerminalName 2210 ); 2211 2212 HRESULT RpcGetState( 2213 [in] SESSION_HANDLE hSession, 2214 [out] LONG *plState 2215 ); 2216 2217 HRESULT RpcIsSessionDesktopLocked( 2218 [in] SESSION_HANDLE hSession 2219 ); 2220 220 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 2221 HRESULT RpcShowMessageBox( 2222 [in] SESSION_HANDLE hSession, 2223 [in, string] WCHAR *szTitle, 2224 [in, string] WCHAR *szMessage, 2225 [in] ULONG ulStyle, 2226 [in] ULONG ulTimeout, 2227 [out] ULONG *pulResponse, 2228 [in] BOOL bDoNotWait 2229 ); 2230 2231 HRESULT RpcGetTimes( 2232 [in] SESSION_HANDLE hSession, 2233 [out] hyper *pConnectTime, 2234 [out] hyper *pDisconnectTime, 2235 [out] hyper *pLogonTime 2236 ); 2237 2238 HRESULT RpcGetSessionCounters( 2239 [in] handle_t hBinding, 2240 [in,out, size_is(uEntries)] PTS_COUNTER pCounter, 2241 [in] ULONG uEntries 2242 ); 2243 2244 HRESULT RpcGetSessionInformation( 2245 [in] handle_t hBinding, 2246 [in] LONG SessionId, 2247 [ref, out] PLSMSESSIONINFORMATION pSessionInfo 2248 ); 2249 221 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 2250 VOID Opnum13NotUsedOnWire(); 2251 2252 VOID Opnum14NotUsedOnWire(); 2253 2254 HRESULT RpcGetLoggedOnCount( 2255 [in] handle_t hBinding, 2256 [out] ULONG *pUserSessions, 2257 [out] ULONG *pDeviceSessions 2258 ); 2259 2260 HRESULT RpcGetSessionType ( 2261 [in] handle_t hBinding, 2262 [in] LONG *SessionId, 2263 [out] ULONG *pSessionType 2264 ); 2265 2266 HRESULT RpcGetSessionInformationEx( 2267 [in] handle_t hBinding, 2268 [in] LONG SessionId, 2269 [in] DWORD Level, 2270 [ref, out] PLSMSESSIONINFORMATION_EX LSMSessionInfoExPtr 2271 ); 2272 } 2273 2274 VOID Opnum18NotUsedOnWire(); 2275 VOID Opnum19NotUsedOnWire(); 2276 2277 // 2278 // notifications 2279 // 222 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 2280 2281 [ 2282 uuid(11899a43-2b68-4a76-92e3-a3d6ad8c26ce), 2283 version(1.0), 2284 pointer_default(unique) 2285 ] 2286 interface TermSrvNotification 2287 { 2288 HRESULT RpcWaitForSessionState( 2289 [in] handle_t hBinding, 2290 [in] LONG SessionId, 2291 [in] LONG State, 2292 [in] ULONG Timeout 2293 ); 2294 2295 typedef [context_handle] void *NOTIFY_HANDLE; 2296 2297 HRESULT RpcRegisterAsyncNotification( 2298 [in] handle_t hBinding, 2299 [in] LONG SessionId, 2300 [in] TNotificationId Mask, 2301 [out] NOTIFY_HANDLE *phNotify 2302 ); 2303 2304 HRESULT RpcWaitAsyncNotification( 2305 [in] NOTIFY_HANDLE hNotify, 2306 [out, size_is(, *pEntries)] 2307 PSESSION_CHANGE *SessionChange, 2308 [out] ULONG *pEntries 2309 ); 223 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 2310 2311 HRESULT RpcUnRegisterAsyncNotification( 2312 [in,out] NOTIFY_HANDLE *phNotify 2313 ); 2314 } 2315 2316 // 2317 // enumerations 2318 // 2319 2320 [ 2321 uuid(88143fd0-c28d-4b2b-8fef-8d882f6a9390), 2322 version(1.0), 2323 pointer_default(unique) 2324 ] 2325 interface TermSrvEnumeration 2326 { 2327 typedef [context_handle] void *ENUM_HANDLE; 2328 #define ENUM_LEVEL1 1 2329 #define ENUM_LEVEL2 2 2330 #define ENUM_LEVEL3 3 2331 #define CURRENT_ENUM_LEVEL 2 2332 2333 typedef struct _SESSIONENUM_LEVEL1 { 2334 LONG SessionId; 2335 LONG State; 2336 WCHAR Name[33]; 2337 } SESSIONENUM_LEVEL1, 2338 *PSESSIONENUM_LEVEL1; 2339 224 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 2340 typedef struct _SESSIONENUM_LEVEL2 { 2341 LONG SessionId; 2342 LONG State; 2343 WCHAR Name[33]; 2344 ULONG Source; 2345 BOOL bFullDesktop; 2346 GUID SessionType; 2347 } SESSIONENUM_LEVEL2, 2348 *PSESSIONENUM_LEVEL2; 2349 2350 typedef struct _SESSIONENUM_LEVEL3 { 2351 LONG SessionId; 2352 LONG State; 2353 WCHAR Name[33]; 2354 ULONG Source; 2355 BOOL bFullDesktop; 2356 GUID SessionType; 2357 ULONG ProtoDataSize; 2358 [size_is(ProtoDataSize)]UCHAR * pProtocolData; 2359 } SESSIONENUM_LEVEL3, 2360 *PSESSIONENUM_LEVEL3; 2361 2362 typedef [switch_type(DWORD)] union _SessionInfo { 2363 [case(1)] 2364 SESSIONENUM_LEVEL1 SessionEnum_Level1; 2365 [case(2)] 2366 SESSIONENUM_LEVEL2 SessionEnum_Level2; 2367 } SessionInfo, 2368 *PSessionInfo; 225 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 2369 2370 typedef struct _SESSIONENUM { 2371 DWORD Level; 2372 [switch_is(Level)] SessionInfo Data; 2373 } SESSIONENUM, 2374 *PSESSIONENUM; 2375 2376 typedef [switch_type(DWORD)] union _SessionInfo_Ex { 2377 [case(1)] 2378 SESSIONENUM_LEVEL1 SessionEnum_Level1; 2379 [case(2)] 2380 SESSIONENUM_LEVEL2 SessionEnum_Level2; 2381 [case(3)] 2382 SESSIONENUM_LEVEL3 SessionEnum_Level3; 2383 } SessionInfo_Ex, 2384 *PSessionInfo_Ex; 2385 2386 typedef struct _SESSIONENUM_EX { 2387 DWORD Level; 2388 [switch_is(Level)] SessionInfo_Ex Data; 2389 } SESSIONENUM_EX, 2390 *PSESSIONENUM_EX; 2391 2392 #define UNIFIED_ENUM_LEVEL1 1 2393 #define UNIFIED_ENUM_LEVEL2 2 2394 #define CURRENT_UNIFIED_ENUM_LEVEL 2 2395 2396 typedef struct _EXECENVDATA_LEVEL1 { 2397 LONG ExecEnvId; 226 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 2398 LONG State; 2399 WCHAR SessionName[33]; 2400 } EXECENVDATA_LEVEL1, 2401 *PEXECENVDATA_LEVEL1; 2402 2403 typedef struct _EXECENVDATA_LEVEL2 { 2404 LONG ExecEnvId; 2405 LONG State; 2406 WCHAR SessionName[33]; 2407 LONG AbsSessionId; 2408 WCHAR HostName[33]; 2409 WCHAR UserName[33]; 2410 WCHAR DomainName[33]; 2411 WCHAR FarmName[33]; 2412 } EXECENVDATA_LEVEL2, 2413 *PEXECENVDATA_LEVEL2; 2414 2415 typedef [switch_type(DWORD)] union _ExecEnvData { 2416 [case(1)] 2417 EXECENVDATA_LEVEL1 ExecEnvEnum_Level1; 2418 [case(2)] 2419 EXECENVDATA_LEVEL2 ExecEnvEnum_Level2; 2420 } ExecEnvData, 2421 *PExecEnvData; 2422 2423 typedef struct _EXECENVDATA { 2424 DWORD Level; 2425 [switch_is(Level)] ExecEnvData Data; 2426 } EXECENVDATA, 227 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 2427 *PEXECENVDATA; 2428 2429 typedef struct _EXECENVDATAEX_LEVEL1 { 2430 LONG ExecEnvId; 2431 LONG State; 2432 LONG AbsSessionId; 2433 [string, max_is(256)] LPWSTR pszSessionName; 2434 [string, max_is(256)] LPWSTR pszHostName; 2435 [string, max_is(256)] LPWSTR pszUserName; 2436 [string, max_is(256)] LPWSTR pszDomainName; 2437 [string, max_is(256)] LPWSTR pszFarmName; 2438 } EXECENVDATAEX_LEVEL1, 2439 *PEXECENVDATAEX_LEVEL1; 2440 2441 typedef [switch_type(DWORD)] union _ExecEnvDataEx { 2442 [case(1)] 2443 EXECENVDATAEX_LEVEL1 ExecEnvEnum_Level1; 2444 } ExecEnvDataEx, 2445 *PExecEnvDataEx; 2446 2447 typedef struct _EXECENVDATAEX { 2448 DWORD Level; 2449 [switch_is(Level)] ExecEnvDataEx Data; 2450 } EXECENVDATAEX, 2451 *PEXECENVDATAEX; 2452 2453 HRESULT RpcOpenEnum( 2454 [in] handle_t hBinding, 2455 [out] ENUM_HANDLE *phEnum 228 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 2456 ); 2457 2458 HRESULT RpcCloseEnum( 2459 [in,out] ENUM_HANDLE *phEnum 2460 ); 2461 2462 HRESULT RpcFilterByState( 2463 [in] ENUM_HANDLE hEnum, 2464 [in] LONG State, 2465 [in] BOOL bInvert 2466 ); 2467 2468 HRESULT RpcFilterByCallersName( 2469 [in] ENUM_HANDLE hEnum 2470 ); 2471 2472 HRESULT RpcEnumAddFilter( 2473 [in] ENUM_HANDLE hEnum, 2474 [in] ENUM_HANDLE hSubEnum 2475 ); 2476 2477 HRESULT RpcGetEnumResult( 2478 [in] ENUM_HANDLE hEnum, 2479 [out, size_is(,*pEntries)] 2480 PSESSIONENUM *ppSessionEnumResult, 2481 [in] DWORD Level, 2482 [out] ULONG *pEntries 2483 ); 2484 229 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 2485 HRESULT RpcFilterBySessionType( 2486 [in] ENUM_HANDLE hEnum, 2487 [in] GUID* pSessionType 2488 ); 2489 2490 VOID Opnum7NotUsedOnWire(void); 2491 2492 HRESULT RpcGetSessionIds( 2493 [in] handle_t hBinding, 2494 [in] SESSION_FILTER Filter, 2495 [in, range( 0, 0xFFFF )] 2496 ULONG MaxEntries, 2497 [out, size_is(,*pcSessionIds)] 2498 LONG** pSessionIds, 2499 [out] ULONG* pcSessionIds 2500 ); 2501 2502 HRESULT RpcGetEnumResultEx( 2503 [in] ENUM_HANDLE hEnum, 2504 [out, size_is(,*pEntries)] 2505 PSESSIONENUM_EX *ppSessionEnumResult, 2506 [in] DWORD Level, 2507 [out] ULONG *pEntries 2508 ); 2509 2510 HRESULT RpcGetAllSessions( 2511 [in] handle_t hBinding, 2512 [in, out] ULONG *pLevel, 2513 [out, size_is(,*pcEntries)] 230 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 2514 PEXECENVDATA *ppSessionData, 2515 [out] ULONG *pcEntries 2516 ); 2517 2518 HRESULT RpcGetAllSessionsEx( 2519 [in] handle_t hBinding, 2520 [in] ULONG Level, 2521 [out, size_is(,*pcEntries)] 2522 PEXECENVDATAEX *ppSessionData, 2523 [out] ULONG *pcEntries 2524 ); 2525 2526 } 2527 2527.1 Appendix A.2: rcmpublic.idl For ease of implementation, the full IDL is provided, where "ms-dtyp.idl" is the IDL as described in [MS-DTYP] Appendix A. 2528 import "ms-dtyp.idl"; 2529 2530 // 2531 // public access ( local & remote ) 2532 // 2533 2534 [ 2535 uuid(bde95fdf-eee0-45de-9e12-e5a61cd0d4fe), 2536 version(1.0), 2537 pointer_default(unique) 2538 ] 2539 interface RCMPublic 2540 { 231 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 2541 static const WCHAR TSRCMRPC_REMOTE_ENDPOINT[] = L"\\pipe\\TermSrv_API_service"; 2542 2543 typedef struct { 2544 USHORT sin_family; 2545 union switch (USHORT sin_family) { 2546 case 2: 2547 struct { 2548 USHORT sin_port; 2549 ULONG in_addr; 2550 UCHAR sin_zero[8]; 2551 } ipv4; 2552 case 23: 2553 struct { 2554 USHORT sin6_port; 2555 ULONG sin6_flowinfo; 2556 USHORT sin6_addr[8]; 2557 ULONG sin6_scope_id; 2558 } ipv6; 2559 }; 2560 } RCM_REMOTEADDRESS, *PRCM_REMOTEADDRESS; 2561 typedef WCHAR LISTENER_NAME[32]; 2562 2563 #define LST_ENUM_LEVEL1 1 2564 #define CURRENT_LST_ENUM_LEVEL 1 2565 2566 typedef struct _LISTENERENUM_LEVEL1 { 2567 LONG Id; 2568 BOOL bListening; 2569 WCHAR Name[33]; 2570 } LISTENERENUM_LEVEL1, *PLISTENERENUM_LEVEL1; 232 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 2571 2572 typedef [switch_type(DWORD)] union _ListenerInfo { 2573 [case(1)] 2574 LISTENERENUM_LEVEL1 ListenerEnum_Level1; 2575 [default] 2576 ; 2577 } ListenerInfo, *PListenerInfo; 2578 2579 typedef struct _LISTENERENUM { 2580 DWORD Level; 2581 [switch_is(Level)] ListenerInfo Data; 2582 } LISTENERENUM, *PLISTENERENUM; 2583 2584 HRESULT RpcGetClientData( 2585 [in] handle_t hBinding, 2586 [in] ULONG SessionId, 2587 [out, size_is( ,*pOutBuffByteLen )] 2588 unsigned char **ppBuff, 2589 [out] ULONG *pOutBuffByteLen 2590 ); 2591 2592 HRESULT RpcGetConfigData( 2593 [in] handle_t hBinding, 2594 [in] ULONG SessionId, 2595 [out, size_is( ,*pOutBuffByteLen )] 2596 unsigned char **ppBuff, 2597 [out] ULONG *pOutBuffByteLen 2598 ); 2599 typedef enum { 233 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 2600 PROTOCOLSTATUS_INFO_BASIC = 0, 2601 PROTOCOLSTATUS_INFO_EXTENDED = 1, 2602 } PROTOCOLSTATUS_INFO_TYPE; 2603 2604 HRESULT RpcGetProtocolStatus( 2605 [in] handle_t hBinding, 2606 [in] ULONG SessionId, 2607 [in] PROTOCOLSTATUS_INFO_TYPE InfoType, 2608 [out, size_is( ,*pcbProtoStatus )] 2609 unsigned char **ppProtoStatus, 2610 [out] ULONG *pcbProtoStatus 2611 ); 2612 2613 HRESULT RpcGetLastInputTime( 2614 [in] handle_t hBinding, 2615 [in] ULONG SessionId, 2616 [out] hyper *pLastInputTime 2617 ); 2618 2619 HRESULT RpcGetRemoteAddress( 2620 [in] handle_t hBinding, 2621 [in] ULONG SessionId, 2622 [out] PRCM_REMOTEADDRESS pRemoteAddress 2623 ); 2624 2625 VOID Opnum5NotUsedOnWire(); 2626 2627 VOID Opnum6NotUsedOnWire(); 2628 234 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 2629 VOID Opnum7NotUsedOnWire(); 2630 2631 HRESULT RpcGetAllListeners( 2632 [in] handle_t hBinding, 2633 [out, size_is(,*pNumListeners)] PLISTENERENUM *ppListeners, 2634 [in] DWORD Level, 2635 [out] ULONG *pNumListeners 2636 ); 2637 2638 HRESULT RpcGetSessionProtocolLastInputTime( 2639 [in] handle_t hBinding, 2640 [in] ULONG SessionId, 2641 [in] PROTOCOLSTATUS_INFO_TYPE InfoType, 2642 [out, size_is( ,*pcbProtoStatus )] 2643 unsigned char **ppProtoStatus, 2644 [out] ULONG *pcbProtoStatus, 2645 [out] hyper *pLastInputTime 2646 ); 2647 2648 HRESULT RpcGetUserCertificates( 2649 [in] handle_t hBinding, 2650 [in] ULONG SessionId, 2651 [out] ULONG* pcCerts, 2652 [out, size_is(, *pcbCerts)] byte** ppbCerts, 2653 [out] ULONG* pcbCerts 2654 ); 2655 2656 typedef enum { 2657 QUERY_SESSION_DATA_MODULE = 0, 235 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 2658 QUERY_SESSION_DATA_WDCONFIG, 2659 QUERY_SESSION_DATA_VIRTUALDATA, 2660 QUERY_SESSION_DATA_LICENSE, 2661 QUERY_SESSION_DATA_DEVICEID, 2662 QUERY_SESSION_DATA_LICENSE_VALIDATION 2663 } QUERY_SESSION_DATA_TYPE; 2664 2665 HRESULT RpcQuerySessionData( 2666 [in] handle_t hBinding, 2667 [in] ULONG SessionId, 2668 [in] QUERY_SESSION_DATA_TYPE type, 2669 [in, unique, size_is( cbInputData )] byte* pbInputData, 2670 [in, range(0, 8192) ] DWORD cbInputData, 2671 [out, ref, size_is(cbSessionData), length_is(*pcbReturnLength)] 2672 byte* pbSessionData, 2673 [in, range(0, 8192)] ULONG cbSessionData, 2674 [out, ref] ULONG *pcbReturnLength, 2675 [out, ref] ULONG *pcbRequireBufferSize 2676 ); 2677 }; 2678 2679 // 2680 // Describe a listener 2681 // 2682 2683 [ 2684 uuid(497d95a6-2d27-4bf5-9bbd-a6046957133c), 2685 version(1.0), 2686 pointer_default(unique) 2687 ] 236 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 2688 interface RCMListener 2689 { 2690 typedef [context_handle] void *HLISTENER; 2691 2692 HRESULT RpcOpenListener( 2693 [in] handle_t hBinding, 2694 [in,string] WCHAR *szListenerName, 2695 [out] HLISTENER *phListener 2696 ); 2697 2698 HRESULT RpcCloseListener( 2699 [in,out] HLISTENER *phListener 2700 ); 2701 2702 HRESULT RpcStopListener( 2703 [in] HLISTENER hListener 2704 ); 2705 2706 HRESULT RpcStartListener( 2707 [in] HLISTENER hListener 2708 ); 2709 2710 HRESULT RpcIsListening( 2711 [in] HLISTENER hListener, 2712 [out] BOOL *pbIsListening 2713 ); 2714 } 2715 237 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 2715.1 Appendix A.3: legacy.idl For ease of implementation, the full IDL is provided, where "ms-dtyp.idl" is the IDL as described in [MS-DTYP] Appendix A and "allproc.h" is as specified in section 6.7. 2716 import "ms-dtyp.idl"; 2717 2718 #include "ms-tsts_allproc.h" 2719 2720 typedef UINT * UINT_PTR; 2721 2722 static const WCHAR TSRPC_LEGACY_REMOTE_ENDPOINT[] = 2723 L"\\pipe\\Ctx_WinStation_API_service"; 2724 2725 typedef [context_handle] void *SERVER_HANDLE; 2726 2727 [ 2728 uuid(5ca4a760-ebb1-11cf-8611-00a0245420ed), 2729 version(1.0), 2730 pointer_default(unique) 2731 ] 2732 interface IcaApi 2733 { 2734 2735 typedef [range(0, 0x8000)] ULONG BOUNDED_ULONG; 2736 2737 BOOLEAN RpcWinStationOpenServer( 2738 [in] handle_t hBinding, 2739 [out] DWORD *pResult, 2740 [out] SERVER_HANDLE *phServer 2741 ); 2742 238 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 2743 BOOLEAN RpcWinStationCloseServer( 2744 [in] SERVER_HANDLE hServer, 2745 [out] DWORD *pResult 2746 ); 2747 2748 BOOLEAN RpcIcaServerPing( 2749 [in] SERVER_HANDLE hServer, 2750 [out] DWORD *pResult 2751 ); 2752 2753 BOOLEAN RpcWinStationEnumerate( 2754 [in] SERVER_HANDLE hServer, 2755 [out] DWORD *pResult, 2756 [in,out] PULONG pEntries, 2757 [in,out,unique,size_is(*pByteCount)] 2758 PCHAR pLogonId, 2759 [in,out] PULONG pByteCount, 2760 [in,out] PULONG pIndex 2761 ); 2762 2763 BOOLEAN RpcWinStationRename( 2764 [in] SERVER_HANDLE hServer, 2765 [out] DWORD *pResult, 2766 [in,size_is(NameOldSize)] 2767 PWCHAR pWinStationNameOld, 2768 [in,range(0, 256)] 2769 DWORD NameOldSize, 2770 [in,size_is(NameNewSize)] 2771 PWCHAR pWinStationNameNew, 239 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 2772 [in,range(0, 256)] 2773 DWORD NameNewSize 2774 ); 2775 2776 BOOLEAN RpcWinStationQueryInformation( 2777 [in] SERVER_HANDLE hServer, 2778 [out] DWORD *pResult, 2779 [in] DWORD LogonId, 2780 [in] DWORD WinStationInformationClass, 2781 [in,out,unique,size_is(WinStationInformationLength)] 2782 PCHAR pWinStationInformation, 2783 [in, range( 0, 0x8000)] 2784 DWORD WinStationInformationLength, 2785 [out] DWORD *pReturnLength 2786 ); 2787 2788 BOOLEAN RpcWinStationSetInformation( 2789 [in] SERVER_HANDLE hServer, 2790 [out] DWORD *pResult, 2791 [in] DWORD LogonId, 2792 [in] DWORD WinStationInformationClass, 2793 [in,out,unique,size_is(WinStationInformationLength)] 2794 PCHAR pWinStationInformation, 2795 [in, range( 0, 0x8000)] 2796 DWORD WinStationInformationLength 2797 ); 2798 2799 BOOLEAN RpcWinStationSendMessage( 2800 [in] SERVER_HANDLE hServer, 240 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 2801 [out] DWORD *pResult, 2802 [in] DWORD LogonId, 2803 [in,size_is(TitleLength)] PWCHAR pTitle, 2804 [in, range( 0, 1024 )] 2805 DWORD TitleLength, 2806 [in,size_is(MessageLength)] 2807 PWCHAR pMessage, 2808 [in, range( 0, 1024 )] 2809 DWORD MessageLength, 2810 [in] DWORD Style, 2811 [in] DWORD Timeout, 2812 [out] DWORD *pResponse, 2813 [in] BOOLEAN DoNotWait 2814 ); 2815 2816 BOOLEAN RpcLogonIdFromWinStationName( 2817 [in] SERVER_HANDLE hServer, 2818 [out] DWORD *pResult, 2819 [in,size_is(NameSize)] 2820 PWCHAR pWinStationName, 2821 [in, range( 0, 256 )] 2822 DWORD NameSize, 2823 [out] DWORD *pLogonId 2824 ); 2825 2826 BOOLEAN RpcWinStationNameFromLogonId( 2827 [in] SERVER_HANDLE hServer, 2828 [out] DWORD *pResult, 2829 [in] DWORD LoginId, 241 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 2830 [in,out,size_is(NameSize)] 2831 PWCHAR pWinStationName, 2832 [in, range( 0, 256 )] 2833 DWORD NameSize 2834 ); 2835 2836 BOOLEAN RpcWinStationConnect( 2837 [in] SERVER_HANDLE hServer, 2838 [out] DWORD *pResult, 2839 [in] DWORD ClientLogonId, 2840 [in] DWORD ConnectLogonId, 2841 [in] DWORD TargetLogonId, 2842 [in,size_is(PasswordSize)] PWCHAR pPassword, 2843 [in, range(0, 1024)] 2844 DWORD PasswordSize, 2845 [in] BOOLEAN Wait 2846 ); 2847 2848 void Opnum11NotUsedOnWire(void); 2849 2850 void Opnum12NotUsedOnWire(void); 2851 2852 BOOLEAN RpcWinStationDisconnect( 2853 [in] SERVER_HANDLE hServer, 2854 [out] DWORD *pResult, 2855 [in] DWORD LogonId, 2856 [in] BOOLEAN bWait 2857 ); 2858 242 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 2859 BOOLEAN RpcWinStationReset( 2860 [in] SERVER_HANDLE hServer, 2861 [out] DWORD *pResult, 2862 [in] DWORD LogonId, 2863 [in] BOOLEAN bWait 2864 ); 2865 2866 BOOLEAN RpcWinStationShutdownSystem( 2867 [in] SERVER_HANDLE hServer, 2868 [out] DWORD *pResult, 2869 [in] DWORD ClientLogonId, 2870 [in] DWORD ShutdownFlags 2871 ); 2872 2873 BOOLEAN RpcWinStationWaitSystemEvent( 2874 [in] SERVER_HANDLE hServer, 2875 [out] DWORD *pResult, 2876 [in] DWORD EventMask, 2877 [out] DWORD *pEventFlags 2878 ); 2879 2880 BOOLEAN RpcWinStationShadow( 2881 [in] SERVER_HANDLE hServer, 2882 [out] DWORD *pResult, 2883 [in] DWORD LogonId, 2884 [in,unique,size_is(NameSize)] PWCHAR pTargetServerName, 2885 [in, range( 0, 1024)] DWORD NameSize, 2886 [in] DWORD TargetLogonId, 2887 [in] BYTE HotKeyVk, 243 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 2888 [in] USHORT HotkeyModifiers 2889 ); 2890 2891 void Opnum18NotUsedOnWire(void); 2892 2893 void Opnum19NotUsedOnWire(void); 2894 2895 void Opnum20NotUsedOnWire(void); 2896 2897 void Opnum21NotUsedOnWire(void); 2898 2899 void Opnum22NotUsedOnWire(void); 2900 2901 void Opnum23NotUsedOnWire(void); 2902 2903 void Opnum24NotUsedOnWire(void); 2904 2905 void Opnum25NotUsedOnWire(void); 2906 2907 void Opnum26NotUsedOnWire(void); 2908 2909 void Opnum27NotUsedOnWire(void); 2910 2911 void Opnum28NotUsedOnWire(void); 2912 2913 BOOLEAN RpcWinStationBreakPoint( 2914 [in] SERVER_HANDLE hServer, 2915 [out] DWORD *pResult, 2916 [in] DWORD LogonId, 244 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 2917 [in] BOOLEAN KernelFlag 2918 ); 2919 2920 BOOLEAN RpcWinStationReadRegistry( 2921 [in] SERVER_HANDLE hServer, 2922 [out] DWORD *pResult 2923 ); 2924 2925 void Opnum31NotUsedOnWire(void); 2926 2927 void Opnum32NotUsedOnWire(void); 2928 2929 void Opnum33NotUsedOnWire(void); 2930 2931 BOOLEAN OldRpcWinStationEnumerateProcesses( 2932 [in] SERVER_HANDLE hServer, 2933 [out] DWORD *pResult, 2934 [out,size_is(ByteCount)] 2935 PBYTE pProcessBuffer, 2936 [in, range( 0, 0x8000 )] 2937 DWORD ByteCount 2938 ); 2939 2940 void Opnum35NotUsedOnWire(void); 2941 2942 BOOLEAN RpcWinStationEnumerateProcesses( 2943 [in] SERVER_HANDLE hServer, 2944 [out] DWORD *pResult, 2945 [out,size_is(ByteCount)] 245 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 2946 PBYTE pProcessBuffer, 2947 [in, range( 0, 0x8000 )] 2948 DWORD ByteCount 2949 ); 2950 2951 BOOLEAN RpcWinStationTerminateProcess( 2952 [in] SERVER_HANDLE hServer, 2953 [out] DWORD *pResult, 2954 [in] DWORD ProcessId, 2955 [in] DWORD ExitCode 2956 ); 2957 2958 void Opnum38NotUsedOnWire(void); 2959 2960 void Opnum39NotUsedOnWire(void); 2961 2962 void Opnum40NotUsedOnWire(void); 2963 2964 void Opnum41NotUsedOnWire(void); 2965 2966 void Opnum42NotUsedOnWire(void); 2967 2968 BOOLEAN RpcWinStationGetAllProcesses( 2969 [in] SERVER_HANDLE hServer, 2970 [out] DWORD *pResult, 2971 [in] ULONG Level, 2972 [in, out] BOUNDED_ULONG *pNumberOfProcesses, 2973 [out, size_is(,*pNumberOfProcesses)] 2974 PTS_ALL_PROCESSES_INFO *ppTsAllProcessesInfo 246 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 2975 ); 2976 2977 BOOLEAN RpcWinStationGetProcessSid( 2978 [in] SERVER_HANDLE hServer, 2979 [in] DWORD dwUniqueProcessId, 2980 [in] LARGE_INTEGER ProcessStartTime, 2981 [out] LONG *pResult, 2982 [in,out,unique,size_is(dwSidSize)] 2983 PBYTE pProcessUserSid, 2984 [in, range( 0, 1024 )] 2985 DWORD dwSidSize, 2986 [in,out] DWORD *pdwSizeNeeded 2987 ); 2988 2989 BOOLEAN RpcWinStationGetTermSrvCountersValue( 2990 [in] SERVER_HANDLE hServer, 2991 [out] DWORD *pResult, 2992 [in, range( 0, 0x1000 )] 2993 DWORD dwEntries, 2994 [in,out, size_is(dwEntries)] 2995 PTS_COUNTER pCounter 2996 ); 2997 2998 BOOLEAN RpcWinStationReInitializeSecurity( 2999 [in] SERVER_HANDLE hServer, 3000 [out] DWORD *pResult 3001 ); 3002 3003 void Opnum47NotUsedOnWire(void); 247 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 3004 3005 void Opnum48NotUsedOnWire(void); 3006 3007 void Opnum49NotUsedOnWire(void); 3008 3009 void Opnum50NotUsedOnWire(void); 3010 3011 void Opnum51NotUsedOnWire(void); 3012 3013 void Opnum52NotUsedOnWire(void); 3014 3015 BOOLEAN RpcWinStationGetLanAdapterName( 3016 [in] SERVER_HANDLE hServer, 3017 [out] DWORD *pResult, 3018 [in, range( 0, 0x1000 )] 3019 DWORD PdNameSize, 3020 [in,size_is(PdNameSize)] PWCHAR pPdName, 3021 [in, range( 0, 1024) ] 3022 ULONG LanAdapter, 3023 [out] ULONG *pLength, 3024 [out, size_is(,*pLength)] 3025 PWCHAR *ppLanAdapter 3026 ); 3027 3028 void Opnum54NotUsedOnWire(void); 3029 3030 void Opnum55NotUsedOnWire(void); 3031 3032 void Opnum56NotUsedOnWire(void); 248 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 3033 3034 void Opnum57NotUsedOnWire(void); 3035 3036 BOOLEAN RpcWinStationUpdateSettings( 3037 [in] SERVER_HANDLE hServer, 3038 [out] DWORD *pResult, 3039 [in] DWORD SettingsClass, 3040 [in] DWORD SettingsParameters 3041 ); 3042 3043 BOOLEAN RpcWinStationShadowStop( 3044 [in] SERVER_HANDLE hServer, 3045 [out] DWORD *pResult, 3046 [in] DWORD LogonId, 3047 [in] BOOLEAN bWait 3048 ); 3049 3050 BOOLEAN RpcWinStationCloseServerEx( 3051 [in, out] SERVER_HANDLE *phServer, 3052 [out] DWORD *pResult 3053 ); 3054 3055 BOOLEAN RpcWinStationIsHelpAssistantSession( 3056 [in] SERVER_HANDLE hServer, 3057 [out] DWORD* pResult, 3058 [in] ULONG SessionId 3059 ); 3060 3061 BOOLEAN RpcWinStationGetMachinePolicy( 249 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 3062 [in] SERVER_HANDLE hServer, 3063 [in,out,size_is(bufferSize)] 3064 PBYTE pPolicy, 3065 [in, range( 0, 0x8000 )] 3066 ULONG bufferSize 3067 ); 3068 3069 void Opnum63NotUsedOnWire(void); 3070 3071 void Opnum64NotUsedOnWire(void); 3072 3073 BOOLEAN RpcWinStationCheckLoopBack( 3074 [in] SERVER_HANDLE hServer, 3075 [out] DWORD *pResult, 3076 [in] DWORD ClientLogonId, 3077 [in] DWORD TargetLogonId, 3078 [in,size_is(NameSize)] 3079 PWCHAR pTargetServerName, 3080 [in, range( 0, 1024 )] 3081 DWORD NameSize 3082 ); 3083 3084 BOOLEAN RpcConnectCallback( 3085 [in] SERVER_HANDLE hServer, 3086 [out] DWORD *pResult, 3087 [in] DWORD TimeOut, 3088 [in] ULONG AddressType, 3089 [in,size_is(AddressSize)] PBYTE pAddress, 3090 [in, range( 0, 0x1000 )] 250 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 3091 ULONG AddressSize 3092 ); 3093 3094 void Opnum67NotUsedOnWire(void); 3095 3096 void Opnum68NotUsedOnWire(void); 3097 3098 void Opnum69NotUsedOnWire(void); 3099 3100 BOOLEAN RpcWinStationGetAllProcesses_NT6( 3101 [in] SERVER_HANDLE hServer, 3102 [out] DWORD *pResult, 3103 [in] ULONG Level, 3104 [in, out] BOUNDED_ULONG *pNumberOfProcesses, 3105 [out, size_is(,*pNumberOfProcesses)] 3106 PTS_ALL_PROCESSES_INFO_NT6 *ppTsAllProcessesInfo 3107 ); 3108 3109 void Opnum71NotUsedOnWire(void); 3110 3111 void Opnum72NotUsedOnWire(void); 3112 3113 void Opnum73NotUsedOnWire(void); 3114 3115 void Opnum74NotUsedOnWire(void); 3116 3117 BOOLEAN RpcWinStationOpenSessionDirectory( 3118 [in] SERVER_HANDLE hServer, 3119 [out] DWORD *pResult, 251 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 3120 [in, string, max_is(64)] 3121 PWCHAR pszServerName 3122 ); 3123 } 3124 3124.1 Appendix A.4: TSVIPRpc.idl 3125 import "ms-dtyp.idl"; 3126 3127 #include "ms-tsts_allproc.h" 3128 3129 3130 [ 3131 uuid(53b46b02-c73b-4a3e-8dee-b16b80672fc0), 3132 version(1.0), 3133 pointer_default(unique) 3134 ] 3135 3136 interface TSVIPPublic 3137 3138 { 3139 HRESULT RpcGetSessionIP( 3140 [in] handle_t hBinding, 3141 [in] USHORT Family, 3142 [in] DWORD SessionId, 3143 [ref, out] TSVIPSession *ppVIPSession 3144 ); 3145 } 3146 3147 252 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 3147.1 Appendix A.5: winsta.h For ease of implementation, the full header is provided. 3148 import "ms-dtyp.idl"; 3149 3150 // [MS-TSTS] specific defines 3151 3152 #define WDPREFIX_LENGTH 12 3153 #define STACK_ADDRESS_LENGTH 128 3154 #define MAX_BR_NAME 65 3155 #define DIRECTORY_LENGTH 256 3156 #define INITIALPROGRAM_LENGTH 256 3157 #define USERNAME_LENGTH 20 3158 #define DOMAIN_LENGTH 17 3159 #define PASSWORD_LENGTH 14 3160 #define NASISPECIFICNAME_LENGTH 14 3161 #define NASIUSERNAME_LENGTH 47 3162 #define NASIPASSWORD_LENGTH 24 3163 #define NASISESSIONNAME_LENGTH 16 3164 #define NASIFILESERVER_LENGTH 47 3165 3166 #define CLIENTDATANAME_LENGTH 7 3167 #define CLIENTNAME_LENGTH 20 3168 #define CLIENTADDRESS_LENGTH 30 3169 #define IMEFILENAME_LENGTH 32 3170 #define DIRECTORY_LENGTH 256 3171 #define CLIENTLICENSE_LENGTH 32 3172 #define CLIENTMODEM_LENGTH 40 3173 #define CLIENT_PRODUCT_ID_LENGTH 32 3174 #define MAX_COUNTER_EXTENSIONS 2 3175 #define WINSTATIONNAME_LENGTH 32 3176 253 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 3177 3178 typedef enum _SDCLASS { 3179 SdNone = 0, 3180 SdConsole, 3181 SdNetwork, 3182 SdAsync, 3183 SdOemTransport 3184 } SDCLASS; 3185 3186 typedef enum _FLOWCONTROLCLASS { 3187 FlowControl_None, 3188 FlowControl_Hardware, 3189 FlowControl_Software 3190 } FLOWCONTROLCLASS; 3191 3192 typedef enum _WINSTATIONSTATECLASS { 3193 State_Active = 0, 3194 State_Connected = 1, 3195 State_ConnectQuery = 2, 3196 State_Shadow = 3, 3197 State_Disconnected = 4, 3198 State_Idle = 5, 3199 State_Listen = 6, 3200 State_Reset = 7, 3201 State_Down = 8, 3202 State_Init = 9 3203 } WINSTATIONSTATECLASS; 3204 3205 typedef WCHAR NASISPECIFICNAME[ NASISPECIFICNAME_LENGTH + 1 ]; 3206 254 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 3207 typedef WCHAR NASIUSERNAME[ NASIUSERNAME_LENGTH + 1 ]; 3208 3209 typedef WCHAR NASIPASSWORD[ NASIPASSWORD_LENGTH + 1 ]; 3210 3211 typedef WCHAR NASISESIONNAME[ NASISESSIONNAME_LENGTH + 1 ]; 3212 3213 typedef WCHAR NASIFILESERVER[ NASIFILESERVER_LENGTH + 1 ]; 3214 3215 typedef CHAR CLIENTDATANAME[ CLIENTDATANAME_LENGTH + 1 ]; 3216 typedef CHAR * PCLIENTDATANAME; 3217 3218 typedef WCHAR WINSTATIONNAME[ WINSTATIONNAME_LENGTH + 1 ]; 3219 3220 typedef struct _TS_SYSTEMTIME { 3221 USHORT wYear; 3222 USHORT wMonth; 3223 USHORT wDayOfWeek; 3224 USHORT wDay; 3225 USHORT wHour; 3226 USHORT wMinute; 3227 USHORT wSecond; 3228 USHORT wMilliseconds; 3229 } TS_SYSTEMTIME; 3230 3231 typedef struct _TS_TIME_ZONE_INFORMATION { 3232 LONG Bias; 3233 WCHAR StandardName[32 ]; 3234 TS_SYSTEMTIME StandardDate; 3235 LONG StandardBias; 3236 WCHAR DaylightName[32 ]; 255 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 3237 TS_SYSTEMTIME DaylightDate; 3238 LONG DaylightBias; 3239 } TS_TIME_ZONE_INFORMATION; 3240 3241 3242 #ifdef _WIN64 3243 typedef unsigned __int64 ULONG_PTR; 3244 #else 3245 typedef ULONG ULONG_PTR; 3246 #endif 3247 3248 typedef ULONG PTR_SIZE_T; 3249 3250 typedef enum { 3251 SF_SERVICES_SESSION_POPUP 3252 } SESSION_FILTER; 3253 3254 #define PROTOCOL_CONSOLE 0 3255 #define PROTOCOL_ICA 1 3256 #define PROTOCOL_TSHARE 2 3257 #define PROTOCOL_RDP 2 3258 #define PDNAME_LENGTH 32 3259 #define WDNAME_LENGTH 32 3260 #define CDNAME_LENGTH 32 3261 #define DEVICENAME_LENGTH 128 3262 #define MODEMNAME_LENGTH DEVICENAME_LENGTH 3263 #define CALLBACK_LENGTH 50 3264 #define DLLNAME_LENGTH 32 3265 #define WINSTATIONCOMMENT_LENGTH 60 3266 #define MAX_LICENSE_SERVER_LENGTH 1024 256 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 3267 #define LOGONID_CURRENT ((ULONG)-1) 3268 #define MAX_PDCONFIG 10 3269 3270 #define TERMSRV_TOTAL_SESSIONS 1 3271 #define TERMSRV_DISC_SESSIONS 2 3272 #define TERMSRV_RECON_SESSIONS 3 3273 #define TERMSRV_CURRENT_ACTIVE_SESSIONS 4 3274 #define TERMSRV_CURRENT_DISC_SESSIONS 5 3275 #define TERMSRV_PENDING_SESSIONS 6 3276 #define TERMSRV_SUCC_TOTAL_LOGONS 7 3277 #define TERMSRV_SUCC_LOCAL_LOGONS 8 3278 #define TERMSRV_SUCC_REMOTE_LOGONS 9 3279 #define TERMSRV_SUCC_SESSION0_LOGONS 10 3280 #define TERMSRV_CURRENT_TERMINATING_SESSIONS 11 3281 #define TERMSRV_CURRENT_LOGGEDON_SESSIONS 12 3282 3283 #define NO_FALLBACK_DRIVERS 0x0 3284 #define FALLBACK_BESTGUESS 0x1 3285 #define FALLBACK_PCL 0x2 3286 #define FALLBACK_PS 0x3 3287 #define FALLBACK_PCLANDPS 0x4 3288 3289 /********************************* 3290 * WinStationOpen access values 3291 *********************************/ 3292 3293 #define WINSTATION_QUERY 0x00000001 /* WinStationQueryInformation() */ 3294 #define WINSTATION_SET 0x00000002 /* WinStationSetInformation() */ 3295 #define WINSTATION_RESET 0x00000004 /* WinStationReset() */ 3296 #define WINSTATION_VIRTUAL 0x00000008 /* read/write direct data */ 3297 #define WINSTATION_SHADOW 0x00000010 /* WinStationShadow() */ 257 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 3298 #define WINSTATION_LOGON 0x00000020 /* logon to WinStation */ 3299 #define WINSTATION_LOGOFF 0x00000040 /* WinStationLogoff() */ 3300 #define WINSTATION_MSG 0x00000080 /* WinStationMsg() */ 3301 #define WINSTATION_CONNECT 0x00000100 /* WinStationConnect() */ 3302 #define WINSTATION_DISCONNECT 0x00000200 /* WinStationDisconnect() */ 3303 #define WINSTATION_GUEST_ACCESS (WINSTATION_LOGON) 3304 #define WINSTATION_CURRENT_GUEST_ACCESS (WINSTATION_VIRTUAL | \ 3305 WINSTATION_LOGOFF) 3306 #define WINSTATION_USER_ACCESS (WINSTATION_GUEST_ACCESS | \ 3307 WINSTATION_QUERY | \ 3308 WINSTATION_CONNECT ) 3309 #define WINSTATION_CURRENT_USER_ACCESS (WINSTATION_SET | \ 3310 WINSTATION_RESET | \ 3311 WINSTATION_VIRTUAL | \ 3312 WINSTATION_LOGOFF | \ 3313 WINSTATION_DISCONNECT) 3314 #define WINSTATION_ALL_ACCESS ( STANDARD_RIGHTS_REQUIRED | \ 3315 WINSTATION_QUERY | \ 3316 WINSTATION_SET | \ 3317 WINSTATION_RESET | \ 3318 WINSTATION_VIRTUAL | \ 3319 WINSTATION_SHADOW | \ 3320 WINSTATION_LOGON | \ 3321 WINSTATION_MSG | \ 3322 WINSTATION_CONNECT | \ 3323 WINSTATION_DISCONNECT) 3324 3325 typedef WCHAR PDNAME[ PDNAME_LENGTH + 1 ]; 3326 typedef WCHAR * PPDNAME; 3327 258 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 3328 /*------*/ 3329 3330 typedef WCHAR WDNAME[ WDNAME_LENGTH + 1 ]; 3331 typedef WCHAR * PWDNAME; 3332 3333 /*------*/ 3334 3335 typedef WCHAR CDNAME[ CDNAME_LENGTH + 1 ]; 3336 typedef WCHAR * PCDNAME; 3337 3338 /*------*/ 3339 3340 typedef WCHAR DEVICENAME[ DEVICENAME_LENGTH + 1 ]; 3341 typedef WCHAR * PDEVICENAME; 3342 3343 /*------*/ 3344 3345 typedef WCHAR MODEMNAME[ MODEMNAME_LENGTH + 1 ]; 3346 typedef WCHAR * PMODEMNAME; 3347 3348 /*------*/ 3349 3350 typedef WCHAR DLLNAME[ DLLNAME_LENGTH + 1 ]; 3351 typedef WCHAR * PDLLNAME; 3352 typedef CHAR DLLNAMEA[ DLLNAME_LENGTH + 1 ]; 3353 3354 /*------*/ 3355 3356 typedef WCHAR WDPREFIX[ WDPREFIX_LENGTH + 1 ]; 3357 typedef WCHAR * PWDPREFIX; 259 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 3358 3359 /* 3360 * Stack address structure 3361 */ 3362 3363 typedef struct _CLIENT_STACK_ADDRESS { 3364 BYTE Address[ STACK_ADDRESS_LENGTH ]; // bytes 0,1 family, 2-n address 3365 } CLIENT_STACK_ADDRESS, *PCLIENT_STACK_ADDRESS; 3366 3367 typedef struct _TS_TRACE { 3368 WCHAR TraceFile[256]; 3369 BOOLEAN fDebugger; 3370 BOOLEAN fTimestamp; 3371 ULONG TraceClass; 3372 ULONG TraceEnable; 3373 WCHAR TraceOption[64]; 3374 } TS_TRACE, * PTS_TRACE; 3375 3376 #define EXTENDED_USERNAME_LEN 255 3377 #define EXTENDED_PASSWORD_LEN 255 3378 #define EXTENDED_DOMAIN_LEN 255 3379 3380 typedef struct _ExtendedClientCredentials { 3381 WCHAR UserName[EXTENDED_USERNAME_LEN + 1]; 3382 WCHAR Password[EXTENDED_PASSWORD_LEN + 1]; 3383 WCHAR Domain[EXTENDED_DOMAIN_LEN + 1] ; 3384 }ExtendedClientCredentials, *pExtendedClientCredentials; 3385 3386 /********************************* 3387 * User Configuration structures 260 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 3388 *********************************/ 3389 3390 typedef WCHAR APPLICATIONNAME[ MAX_BR_NAME ]; 3391 typedef WCHAR *PAPPLICATIONNAME; 3392 3393 /* 3394 * Shadow options 3395 */ 3396 3397 typedef enum _SHADOWCLASS { 3398 Shadow_Disable, 3399 Shadow_EnableInputNotify, 3400 Shadow_EnableInputNoNotify, 3401 Shadow_EnableNoInputNotify, 3402 Shadow_EnableNoInputNoNotify, 3403 } SHADOWCLASS; 3404 3405 /* 3406 * Callback options 3407 */ 3408 3409 typedef enum _CALLBACKCLASS { 3410 Callback_Disable, 3411 Callback_Roving, 3412 Callback_Fixed, 3413 } CALLBACKCLASS; 3414 3415 typedef struct _POLICY_TS_MACHINE 3416 { 3417 ULONG fPolicyDisableClip : 1 ; 261 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 3418 ULONG fPolicyDisableCam : 1 ; 3419 ULONG fPolicyDisableCcm : 1 ; 3420 ULONG fPolicyDisableLPT : 1; 3421 ULONG fPolicyDisableCpm : 1; 3422 ULONG fPolicyPromptForPassword : 1 ; 3423 ULONG fPolicyMaxInstanceCount : 1; 3424 ULONG fPolicyMinEncryptionLevel : 1 ; 3425 ULONG fPolicyFipsEnabled : 1; 3426 ULONG fPolicyDisableAutoReconnect : 1; 3427 ULONG fPolicyWFProfilePath: 1 ; 3428 ULONG fPolicyWFHomeDir: 1 ; 3429 ULONG fPolicyWFHomeDirDrive: 1 ; 3430 ULONG fPolicyDenyTSConnections : 1; 3431 ULONG fPolicyTempFoldersPerSession : 1; 3432 ULONG fPolicyDeleteTempFoldersOnExit: 1; 3433 ULONG fPolicyColorDepth : 1; 3434 ULONG fPolicySessionDirectoryActive : 1; 3435 ULONG fPolicySessionDirectoryLocation : 1; 3436 ULONG fPolicySessionDirectoryClusterName : 1; 3437 ULONG fPolicySessionDirectoryAdditionalParams : 1; 3438 ULONG fPolicySessionDirectoryExposeServerIP : 1; 3439 ULONG fPolicyPreventLicenseUpgrade : 1; 3440 ULONG fPolicySecureLicensing : 1; 3441 ULONG fPolicyWritableTSCCPermissionsTAB : 1; 3442 ULONG fPolicyDisableCdm : 1; 3443 ULONG fPolicyForceClientLptDef : 1; 3444 ULONG fPolicyShadow : 1 ; 3445 ULONG fPolicyResetBroken : 1 ; 3446 ULONG fPolicyReconnectSame : 1 ; 262 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 3447 ULONG fPolicyMaxSessionTime : 1 ; 3448 ULONG fPolicyMaxDisconnectionTime:1; 3449 ULONG fPolicyMaxIdleTime : 1 ; 3450 ULONG fPolicyInitialProgram : 1 ; 3451 ULONG fPolicySingleSessionPerUser : 1; 3452 ULONG fPolicyDisableWallpaper : 1; 3453 ULONG fPolicyKeepAlive : 1; 3454 ULONG fPolicyEnableTimeZoneRedirection : 1; 3455 ULONG fPolicyDisableForcibleLogoff : 1; 3456 ULONG fPolicyLicensingMode : 1; 3457 ULONG fPolicyExplicitLSDiscovery: 1; 3458 ULONG fPolicyDisableTerminalServerTooltip:1; 3459 ULONG fDisableClip : 1 ; 3460 ULONG fDisableCam : 1 ; 3461 ULONG fDisableCcm : 1 ; 3462 ULONG fDisableLPT : 1; 3463 ULONG fDisableCpm : 1; 3464 ULONG fPromptForPassword : 1 ; 3465 ULONG ColorDepth : 3; 3466 ULONG fDenyTSConnections : 1; 3467 ULONG fTempFoldersPerSession : 1; 3468 ULONG fDeleteTempFoldersOnExit: 1; 3469 ULONG fWritableTSCCPermissionsTAB : 1; 3470 ULONG fDisableCdm : 1; 3471 ULONG fForceClientLptDef : 1; 3472 ULONG fResetBroken : 1 ; 3473 ULONG fReconnectSame : 1 ; 3474 ULONG fSingleSessionPerUser:1; 3475 ULONG fDisableWallpaper : 1; 263 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 3476 ULONG fKeepAliveEnable : 1; 3477 ULONG fPreventLicenseUpgrade:1; 3478 ULONG fSecureLicensing:1; 3479 ULONG fEnableTimeZoneRedirection : 1; 3480 ULONG fDisableAutoReconnect : 1; 3481 ULONG fDisableForcibleLogoff : 1; 3482 ULONG fPolicyEncryptRPCTraffic : 1; 3483 ULONG fEncryptRPCTraffic : 1; 3484 ULONG fErrorInvalidProfile : 1; 3485 ULONG fPolicyFallbackPrintDriver : 1; 3486 ULONG FallbackPrintDriverType : 3; 3487 ULONG fDisableTerminalServerTooltip : 1; 3488 BYTE bSecurityLayer; 3489 ULONG fPolicySecurityLayer : 1; 3490 BYTE bUserAuthentication; 3491 ULONG fPolicyUserAuthentication : 1; 3492 ULONG fPolicyTurnOffSingleAppMode : 1; 3493 ULONG fTurnOffSingleAppMode : 1; 3494 ULONG fDisablePNPPolicyIsEnfored:1; 3495 ULONG fDisablePNPPolicyValue:1; 3496 ULONG MaxInstanceCount; 3497 ULONG LicensingMode; 3498 BYTE MinEncryptionLevel; 3499 WCHAR WFProfilePath[ DIRECTORY_LENGTH + 1 ]; 3500 WCHAR WFHomeDir[ DIRECTORY_LENGTH + 1 ]; 3501 WCHAR WFHomeDirDrive[ 4 ]; 3502 ULONG SessionDirectoryActive; 3503 WCHAR SessionDirectoryLocation[DIRECTORY_LENGTH+1]; 3504 WCHAR SessionDirectoryClusterName[DIRECTORY_LENGTH+1]; 264 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 3505 WCHAR SessionDirectoryAdditionalParams[DIRECTORY_LENGTH+1]; 3506 ULONG SessionDirectoryExposeServerIP; 3507 ULONG KeepAliveInterval; 3508 SHADOWCLASS Shadow; 3509 ULONG MaxConnectionTime; 3510 ULONG MaxDisconnectionTime; 3511 ULONG MaxIdleTime; 3512 WCHAR WorkDirectory[ DIRECTORY_LENGTH + 1 ]; 3513 WCHAR InitialProgram[ INITIALPROGRAM_LENGTH + 1 ]; 3514 WCHAR LicenseServers[MAX_LICENSE_SERVER_LENGTH + 1 ]; 3515 } POLICY_TS_MACHINE, *PPOLICY_TS_MACHINE; 3516 3517 /* 3518 * User Configuration data 3519 */ 3520 3521 typedef struct _USERCONFIG { 3522 /* if flag is set inherit parameter from user or client configuration */ 3523 ULONG fInheritAutoLogon : 1; 3524 ULONG fInheritResetBroken : 1; 3525 ULONG fInheritReconnectSame : 1; 3526 ULONG fInheritInitialProgram : 1; 3527 ULONG fInheritCallback : 1; 3528 ULONG fInheritCallbackNumber : 1; 3529 ULONG fInheritShadow : 1; 3530 ULONG fInheritMaxSessionTime : 1; 3531 ULONG fInheritMaxDisconnectionTime : 1; 3532 ULONG fInheritMaxIdleTime : 1; 3533 ULONG fInheritAutoClient : 1; 3534 ULONG fInheritSecurity : 1; 265 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 3535 ULONG fPromptForPassword : 1; 3536 ULONG fResetBroken : 1; 3537 ULONG fReconnectSame : 1; 3538 ULONG fLogonDisabled : 1; 3539 ULONG fWallPaperDisabled : 1; 3540 ULONG fAutoClientDrives : 1; 3541 ULONG fAutoClientLpts : 1; 3542 ULONG fForceClientLptDef : 1; 3543 ULONG fRequireEncryption : 1; 3544 ULONG fDisableEncryption : 1; 3545 ULONG fUnused1 : 1; 3546 ULONG fHomeDirectoryMapRoot : 1; 3547 ULONG fUseDefaultGina : 1; 3548 ULONG fCursorBlinkDisabled : 1; 3549 ULONG fPublishedApp : 1; 3550 ULONG fHideTitleBar : 1; 3551 ULONG fMaximize : 1; 3552 ULONG fDisableCpm : 1; 3553 ULONG fDisableCdm : 1; 3554 ULONG fDisableCcm : 1; 3555 ULONG fDisableLPT : 1; 3556 ULONG fDisableClip : 1; 3557 ULONG fDisableExe : 1; 3558 ULONG fDisableCam : 1; 3559 ULONG fDisableAutoReconnect : 1; 3560 ULONG ColorDepth : 3; 3561 ULONG fInheritColorDepth: 1; 3562 ULONG fErrorInvalidProfile : 1; 3563 ULONG fPasswordIsScPin: 1; 266 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 3564 ULONG fDisablePNPRedir:1; 3565 WCHAR UserName[ USERNAME_LENGTH + 1 ]; 3566 WCHAR Domain[ DOMAIN_LENGTH + 1 ]; 3567 WCHAR Password[ PASSWORD_LENGTH + 1 ]; 3568 WCHAR WorkDirectory[ DIRECTORY_LENGTH + 1 ]; 3569 WCHAR InitialProgram[ INITIALPROGRAM_LENGTH + 1 ]; 3570 WCHAR CallbackNumber[ CALLBACK_LENGTH + 1 ]; 3571 CALLBACKCLASS Callback; 3572 SHADOWCLASS Shadow; 3573 ULONG MaxConnectionTime; 3574 ULONG MaxDisconnectionTime; 3575 ULONG MaxIdleTime; 3576 ULONG KeyboardLayout; 3577 BYTE MinEncryptionLevel; 3578 WCHAR NWLogonServer[ NASIFILESERVER_LENGTH + 1 ]; 3579 APPLICATIONNAME PublishedName; 3580 WCHAR WFProfilePath[ DIRECTORY_LENGTH + 1 ]; 3581 WCHAR WFHomeDir[ DIRECTORY_LENGTH + 1 ]; 3582 WCHAR WFHomeDirDrive[ 4 ]; 3583 } USERCONFIG, * PUSERCONFIG; 3584 3585 /****************** 3586 * PD structures 3587 ******************/ 3588 3589 typedef struct _PDCONFIG2{ 3590 PDNAME PdName; 3591 SDCLASS SdClass; 3592 DLLNAME PdDLL; 3593 ULONG PdFlag; 267 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 3594 ULONG OutBufLength; 3595 ULONG OutBufCount; 3596 ULONG OutBufDelay; 3597 ULONG InteractiveDelay; 3598 ULONG PortNumber; 3599 ULONG KeepAliveTimeout; 3600 } PDCONFIG2, * PPDCONFIG2; 3601 3602 /* 3603 * PdFlag defines 3604 */ 3605 3606 #define PD_UNUSED 0x00000001 3607 #define PD_RELIABLE 0x00000002 3608 #define PD_FRAME 0x00000004 3609 #define PD_CONNECTION 0x00000008 3610 #define PD_CONSOLE 0x00000010 3611 #define PD_LANA 0x00000020 3612 #define PD_TRANSPORT 0x00000040 3613 #define PD_SINGLE_INST 0x00000080 3614 #define PD_NOLOW_WATERMARK 0x00000100 3615 3616 /*------*/ 3617 typedef enum _RECEIVEFLOWCONTROLCLASS { 3618 ReceiveFlowControl_None, 3619 ReceiveFlowControl_RTS, 3620 ReceiveFlowControl_DTR, 3621 } RECEIVEFLOWCONTROLCLASS; 3622 3623 typedef enum _TRANSMITFLOWCONTROLCLASS { 268 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 3624 TransmitFlowControl_None, 3625 TransmitFlowControl_CTS, 3626 TransmitFlowControl_DSR, 3627 } TRANSMITFLOWCONTROLCLASS; 3628 3629 typedef struct _FLOWCONTROLCONFIG { 3630 ULONG fEnableSoftwareTx: 1; 3631 ULONG fEnableSoftwareRx: 1; 3632 ULONG fEnableDTR: 1; 3633 ULONG fEnableRTS: 1; 3634 CHAR XonChar; 3635 CHAR XoffChar; 3636 FLOWCONTROLCLASS Type; 3637 RECEIVEFLOWCONTROLCLASS HardwareReceive; 3638 TRANSMITFLOWCONTROLCLASS HardwareTransmit; 3639 } FLOWCONTROLCONFIG, * PFLOWCONTROLCONFIG; 3640 3641 typedef enum _ASYNCCONNECTCLASS { 3642 Connect_CTS, 3643 Connect_DSR, 3644 Connect_RI, 3645 Connect_DCD, 3646 Connect_FirstChar, 3647 Connect_Perm, 3648 } ASYNCCONNECTCLASS; 3649 3650 typedef struct _CONNECTCONFIG { 3651 ASYNCCONNECTCLASS Type; 3652 ULONG fEnableBreakDisconnect: 1; 3653 } CONNECTCONFIG, * PCONNECTCONFIG; 269 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 3654 /*------*/ 3655 3656 typedef struct _ASYNCCONFIG { 3657 DEVICENAME DeviceName; 3658 MODEMNAME ModemName; 3659 ULONG BaudRate; 3660 ULONG Parity; 3661 ULONG StopBits; 3662 ULONG ByteSize; 3663 ULONG fEnableDsrSensitivity: 1; 3664 ULONG fConnectionDriver: 1; 3665 FLOWCONTROLCONFIG FlowControl; 3666 CONNECTCONFIG Connect; 3667 } ASYNCCONFIG, * PASYNCCONFIG; 3668 3669 /*------*/ 3670 3671 typedef struct _NETWORKCONFIG { 3672 LONG LanAdapter; 3673 DEVICENAME NetworkName; 3674 ULONG Flags; 3675 } NETWORKCONFIG, * PNETWORKCONFIG; 3676 3677 /*------*/ 3678 3679 typedef struct _NASICONFIG { 3680 NASISPECIFICNAME SpecificName; 3681 NASIUSERNAME UserName; 3682 NASIPASSWORD PassWord; 3683 NASISESIONNAME SessionName; 270 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 3684 NASIFILESERVER FileServer; 3685 BOOLEAN GlobalSession; 3686 } NASICONFIG, * PNASICONFIG; 3687 3688 /*------*/ 3689 3690 typedef struct _OEMTDCONFIG { 3691 LONG Adapter; 3692 DEVICENAME DeviceName; 3693 ULONG Flags; 3694 } OEMTDCONFIG, * POEMTDCONFIG; 3695 3696 /*------*/ 3697 3698 typedef struct _PDPARAMS { 3699 SDCLASS SdClass; 3700 union { 3701 NETWORKCONFIG Network; 3702 ASYNCCONFIG Async; 3703 NASICONFIG Nasi; 3704 OEMTDCONFIG OemTd; 3705 }; 3706 } PDPARAMS, * PPDPARAMS; 3707 3708 /*------*/ 3709 3710 typedef struct _PDCONFIG { 3711 PDCONFIG2 Create; 3712 PDPARAMS Params; 3713 } PDCONFIG, * PPDCONFIG; 271 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 3714 3715 /*********************** 3716 * Wd structures 3717 ***********************/ 3718 3719 typedef struct _WDCONFIG { 3720 WDNAME WdName; 3721 DLLNAME WdDLL; 3722 DLLNAME WsxDLL; 3723 ULONG WdFlag; 3724 ULONG WdInputBufferLength; 3725 DLLNAME CfgDLL; 3726 WDPREFIX WdPrefix; 3727 } WDCONFIG, * PWDCONFIG; 3728 3729 /* 3730 * WdFlag defines 3731 */ 3732 3733 #define WDF_UNUSED 0x00000001 3734 #define WDF_SHADOW_SOURCE 0x00000002 3735 #define WDF_SHADOW_TARGET 0x00000004 3736 #define WDF_OTHER 0x00000008 3737 #define WDF_TSHARE 0x00000010 3738 #define WDF_DYNAMIC_RECONNECT 0x00000020 3739 #define WDF_USER_VCIOCTL 0x00000040 3740 #define WDF_SUBDESKTOP 0x00008000 3741 3742 /************************************** 3743 * Connection Driver structures (CD) 272 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 3744 **************************************/ 3745 3746 /* 3747 * connection driver classes 3748 */ 3749 3750 typedef enum _CDCLASS { 3751 CdNone, 3752 CdModem, 3753 CdClass_Maximum, 3754 } CDCLASS; 3755 3756 /*------*/ 3757 3758 typedef struct _CDCONFIG { 3759 CDCLASS CdClass; 3760 CDNAME CdName; 3761 DLLNAME CdDLL; 3762 ULONG CdFlag; 3763 } CDCONFIG, * PCDCONFIG; 3764 3765 /***************************** 3766 * Window Station structures 3767 *****************************/ 3768 3769 typedef struct _WINSTATIONCREATE { 3770 ULONG fEnableWinStation : 1; 3771 ULONG MaxInstanceCount; 3772 } WINSTATIONCREATE, * PWINSTATIONCREATE; 3773 273 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 3774 /*------*/ 3775 3776 typedef struct _WINSTATIONCONFIG { 3777 WCHAR Comment[ WINSTATIONCOMMENT_LENGTH + 1 ]; 3778 USERCONFIG User; 3779 char OEMId[4]; 3780 } WINSTATIONCONFIG, * PWINSTATIONCONFIG; 3781 3782 /*------*/ 3783 3784 typedef enum _SessionType { 3785 SESSIONTYPE_UNKNOWN = 0, 3786 SESSIONTYPE_SERVICES, 3787 SESSIONTYPE_LISTENER, 3788 SESSIONTYPE_REGULARDESKTOP, 3789 SESSIONTYPE_ALTERNATESHELL, 3790 SESSIONTYPE_REMOTEAPP, 3791 SESSIONTYPE_MEDIACENTEREXT 3792 } SESSIONTYPE; 3793 3794 /*------*/ 3795 3796 #define EXECSRVPIPENAMELEN 48 3797 3798 typedef enum _WINSTATIONINFOCLASS { 3799 WinStationCreateData, 3800 WinStationConfiguration, 3801 WinStationPdParams, 3802 WinStationWd, 3803 WinStationPd, 274 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 3804 WinStationPrinter, 3805 WinStationClient, 3806 WinStationModules, 3807 WinStationInformation, 3808 WinStationTrace, 3809 WinStationBeep, 3810 WinStationEncryptionOff, 3811 WinStationEncryptionPerm, 3812 WinStationNtSecurity, 3813 WinStationUserToken, 3814 WinStationUnused1, 3815 WinStationVideoData, 3816 WinStationInitialProgram, 3817 WinStationCd, 3818 WinStationSystemTrace, 3819 WinStationVirtualData, 3820 WinStationClientData, 3821 WinStationSecureDesktopEnter, 3822 WinStationSecureDesktopExit, 3823 WinStationLoadBalanceSessionTarget, 3824 WinStationLoadIndicator, 3825 WinStationShadowInfo, 3826 WinStationDigProductId, 3827 WinStationLockedState, 3828 WinStationRemoteAddress, 3829 WinStationIdleTime, 3830 WinStationLastReconnectType, 3831 WinStationDisallowAutoReconnect, 3832 WinStationUnused2, 275 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 3833 WinStationUnused3, 3834 WinStationUnused4, 3835 WinStationUnused5, 3836 WinStationReconnectedFromId, 3837 WinStationEffectsPolicy, 3838 WinStationType, 3839 WinStationInformationEx 3840 } WINSTATIONINFOCLASS; 3841 3842 /*------*/ 3843 3844 typedef struct _WINSTATIONCLIENTDATA { 3845 CLIENTDATANAME DataName; 3846 BOOLEAN fUnicodeData; 3847 /* BYTE Data[1]; Variable length data follows */ 3848 } WINSTATIONCLIENTDATA, * PWINSTATIONCLIENTDATA; 3849 3850 /*------*/ 3851 3852 typedef struct _WINSTATIONUSERTOKEN { 3853 HANDLE ProcessId; 3854 HANDLE ThreadId; 3855 HANDLE UserToken; 3856 } WINSTATIONUSERTOKEN, * PWINSTATIONUSERTOKEN; 3857 3858 /*------*/ 3859 3860 typedef struct _WINSTATIONVIDEODATA { 3861 USHORT HResolution; 3862 USHORT VResolution; 276 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 3863 USHORT fColorDepth; 3864 } WINSTATIONVIDEODATA, *PWINSTATIONVIDEODATA; 3865 3866 /*------*/ 3867 3868 typedef struct _WINSTATIONCONFIG2 { 3869 WINSTATIONCREATE Create; 3870 PDCONFIG Pd[ MAX_PDCONFIG ]; 3871 WDCONFIG Wd; 3872 CDCONFIG Cd; 3873 WINSTATIONCONFIG Config; 3874 } WINSTATIONCONFIG2, * PWINSTATIONCONFIG2; 3875 3876 /* 3877 * WinStation client data structure 3878 */ 3879 3880 typedef struct _WINSTATIONCLIENT { 3881 ULONG fTextOnly: 1; 3882 ULONG fDisableCtrlAltDel: 1; 3883 ULONG fMouse: 1; 3884 ULONG fDoubleClickDetect: 1; 3885 ULONG fINetClient: 1; 3886 ULONG fPromptForPassword : 1; 3887 ULONG fMaximizeShell: 1; 3888 ULONG fEnableWindowsKey: 1; 3889 ULONG fRemoteConsoleAudio: 1; 3890 ULONG fPasswordIsScPin: 1; 3891 ULONG fNoAudioPlayback: 1; 3892 ULONG fUsingSavedCreds: 1; 277 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 3893 ULONG fRestrictedLogon: 1; 3894 WCHAR ClientName[ CLIENTNAME_LENGTH + 1 ]; 3895 WCHAR Domain[ DOMAIN_LENGTH + 1 ]; 3896 WCHAR UserName[ USERNAME_LENGTH + 1 ]; 3897 WCHAR Password[ PASSWORD_LENGTH + 1 ]; 3898 WCHAR WorkDirectory[ DIRECTORY_LENGTH + 1 ]; 3899 WCHAR InitialProgram[ INITIALPROGRAM_LENGTH + 1 ]; 3900 ULONG SerialNumber; 3901 BYTE EncryptionLevel; 3902 ULONG ClientAddressFamily; 3903 WCHAR ClientAddress[ CLIENTADDRESS_LENGTH + 1 ]; 3904 USHORT HRes; 3905 USHORT VRes; 3906 USHORT ColorDepth; 3907 USHORT ProtocolType; 3908 ULONG KeyboardLayout; 3909 ULONG KeyboardType; 3910 ULONG KeyboardSubType; 3911 ULONG KeyboardFunctionKey; 3912 WCHAR imeFileName[ IMEFILENAME_LENGTH + 1 ]; 3913 WCHAR ClientDirectory[ DIRECTORY_LENGTH + 1 ]; 3914 WCHAR ClientLicense[ CLIENTLICENSE_LENGTH + 1 ]; 3915 WCHAR ClientModem[ CLIENTMODEM_LENGTH + 1 ]; 3916 ULONG ClientBuildNumber; 3917 ULONG ClientHardwareId; 3918 USHORT ClientProductId; 3919 USHORT OutBufCountHost; 3920 USHORT OutBufCountClient; 3921 USHORT OutBufLength; 278 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 3922 WCHAR AudioDriverName[9]; 3923 TS_TIME_ZONE_INFORMATION ClientTimeZone; 3924 ULONG ClientSessionId; 3925 WCHAR clientDigProductId[CLIENT_PRODUCT_ID_LENGTH]; 3926 ULONG PerformanceFlags; 3927 ULONG ActiveInputLocale; 3928 } WINSTATIONCLIENT, * PWINSTATIONCLIENT; 3929 3930 /* 3931 * T.Share specific protocol performance counters 3932 */ 3933 3934 typedef struct _TSHARE_COUNTERS { 3935 ULONG Reserved; 3936 } TSHARE_COUNTERS, * PTSHARE_COUNTERS; 3937 3938 /* 3939 * WinStation protocol performance counters 3940 */ 3941 3942 typedef struct _PROTOCOLCOUNTERS { 3943 ULONG WdBytes; 3944 ULONG WdFrames; 3945 ULONG WaitForOutBuf; 3946 ULONG Frames; 3947 ULONG Bytes; 3948 ULONG CompressedBytes; 3949 ULONG CompressFlushes; 3950 ULONG Errors; 3951 ULONG Timeouts; 279 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 3952 ULONG AsyncFramingError; 3953 ULONG AsyncOverrunError; 3954 ULONG AsyncOverflowError; 3955 ULONG AsyncParityError; 3956 ULONG TdErrors; 3957 USHORT ProtocolType; 3958 USHORT Length; 3959 union { 3960 TSHARE_COUNTERS TShareCounters; 3961 ULONG Reserved[100]; 3962 } Specific; 3963 } PROTOCOLCOUNTERS, * PPROTOCOLCOUNTERS; 3964 3965 /* 3966 * ThinWire cache statistics 3967 */ 3968 3969 typedef struct _THINWIRECACHE { 3970 ULONG CacheReads; 3971 ULONG CacheHits; 3972 } THINWIRECACHE, * PTHINWIRECACHE; 3973 #define MAX_THINWIRECACHE 4 3974 3975 3976 typedef struct _RESERVED_CACHE { 3977 THINWIRECACHE ThinWireCache[ MAX_THINWIRECACHE ]; 3978 } RESERVED_CACHE, * PRESERVED_CACHE; 3979 3980 /* 3981 * T.Share specific cache statistics 280 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 3982 */ 3983 3984 typedef struct _TSHARE_CACHE { 3985 ULONG Reserved; 3986 } TSHARE_CACHE, * PTSHARE_CACHE; 3987 3988 /* 3989 * WinStation cache statistics 3990 */ 3991 3992 typedef struct CACHE_STATISTICS { 3993 USHORT ProtocolType; 3994 USHORT Length; 3995 union { 3996 RESERVED_CACHE ReservedCacheStats; 3997 TSHARE_CACHE TShareCacheStats; 3998 ULONG Reserved[20]; 3999 } Specific; 4000 } CACHE_STATISTICS, * PCACHE_STATISTICS; 4001 4002 /* 4003 * WinStation protocol status 4004 */ 4005 4006 typedef struct _PROTOCOLSTATUS { 4007 PROTOCOLCOUNTERS Output; 4008 PROTOCOLCOUNTERS Input; 4009 CACHE_STATISTICS Cache; 4010 ULONG AsyncSignal; 4011 ULONG AsyncSignalMask; 281 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 4012 } PROTOCOLSTATUS, * PPROTOCOLSTATUS; 4013 4014 #ifdef __cplusplus 4015 typedef struct _PROTOCOLSTATUSEX : PROTOCOLSTATUS { 4016 #else 4017 typedef struct _PROTOCOLSTATUSEX { 4018 PROTOCOLSTATUS ; 4019 #endif 4020 LARGE_INTEGER Counters[MAX_COUNTER_EXTENSIONS]; 4021 } PROTOCOLSTATUSEX, *PPROTOCOLSTATUSEX; 4022 4023 /* 4024 * WinStation query information 4025 */ 4026 4027 typedef struct _WINSTATIONINFORMATION { 4028 WINSTATIONSTATECLASS ConnectState; 4029 WINSTATIONNAME WinStationName; 4030 ULONG LogonId; 4031 LARGE_INTEGER ConnectTime; 4032 LARGE_INTEGER DisconnectTime; 4033 LARGE_INTEGER LastInputTime; 4034 LARGE_INTEGER LogonTime; 4035 PROTOCOLSTATUS Status; 4036 WCHAR Domain[ DOMAIN_LENGTH + 1 ]; 4037 WCHAR UserName[USERNAME_LENGTH + 1]; 4038 LARGE_INTEGER CurrentTime; 4039 } WINSTATIONINFORMATION, * PWINSTATIONINFORMATION; 4040 4041 /* 282 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 4042 * Load balancing data types 4043 */ 4044 4045 typedef enum _LOADFACTORTYPE { 4046 ErrorConstraint, 4047 PagedPoolConstraint, 4048 NonPagedPoolConstraint, 4049 AvailablePagesConstraint, 4050 SystemPtesConstraint, 4051 CPUConstraint 4052 } LOADFACTORTYPE; 4053 4054 typedef struct _WINSTATIONLOADINDICATORDATA { 4055 ULONG RemainingSessionCapacity; 4056 LOADFACTORTYPE LoadFactor; 4057 ULONG TotalSessions; 4058 ULONG DisconnectedSessions; 4059 LARGE_INTEGER IdleCPU; 4060 LARGE_INTEGER TotalCPU; 4061 ULONG RawSessionCapacity; 4062 ULONG reserved[9]; 4063 } WINSTATIONLOADINDICATORDATA, * PWINSTATIONLOADINDICATORDATA; 4064 4065 /* 4066 * WinStation shadow states 4067 */ 4068 4069 typedef enum _SHADOWSTATECLASS { 4070 State_NoShadow, 4071 State_Shadowing, 283 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 4072 State_Shadowed, 4073 } SHADOWSTATECLASS; 4074 4075 /* 4076 * Shadow query/set information 4077 */ 4078 4079 typedef struct _WINSTATIONSHADOW { 4080 SHADOWSTATECLASS ShadowState; 4081 SHADOWCLASS ShadowClass; 4082 ULONG SessionId; 4083 ULONG ProtocolType; 4084 } WINSTATIONSHADOW, * PWINSTATIONSHADOW; 4085 4086 typedef struct _WINSTATIONPRODID { 4087 WCHAR DigProductId[CLIENT_PRODUCT_ID_LENGTH]; 4088 WCHAR ClientDigProductId[CLIENT_PRODUCT_ID_LENGTH ]; 4089 WCHAR OuterMostDigProductId[CLIENT_PRODUCT_ID_LENGTH ]; 4090 ULONG curentSessionId; 4091 ULONG ClientSessionId; 4092 ULONG OuterMostSessionId; 4093 }WINSTATIONPRODID, *PWINSTATIONPRODID; 4094 4095 typedef struct { 4096 unsigned short sin_family; 4097 union { 4098 struct { 4099 USHORT sin_port; 4100 ULONG in_addr; 4101 UCHAR sin_zero[8]; 284 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 4102 } ipv4; 4103 struct { 4104 USHORT sin6_port; 4105 ULONG sin6_flowinfo; 4106 USHORT sin6_addr[8]; 4107 ULONG sin6_scope_id; 4108 } ipv6; 4109 }; 4110 } WINSTATIONREMOTEADDRESS, *PWINSTATIONREMOTEADDRESS; 4111 4112 #define DEFAULT_POLICY_ID 1 4113 #define PERSEAT_POLICY_ID 2 4114 #define INTCONN_POLICY_ID 3 4115 #define PERUSER_POLICY_ID 4 4116 #define POLICY_NOT_CONFIGURED 5 4117 #define MAXIMUM_POLICY_ID 6 4118 4119 /*------*/ 4120 4121 typedef struct _BEEPINPUT { 4122 ULONG uType; 4123 } BEEPINPUT, * PBEEPINPUT; 4124 4125 /********************** 4126 * NWLogon Structure 4127 **********************/ 4128 4129 #define IDTIMEOUT 32000 4130 #define IDASYNC 32001 4131 #define WSD_LOGOFF 0x00000001 285 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 4132 #define WSD_SHUTDOWN 0x00000002 4133 #define WSD_REBOOT 0x00000004 4134 #define WSD_POWEROFF 0x00000008 4135 #define WSD_FASTREBOOT 0x00000010 4136 4137 #define WTS_CONSOLE_CONNECT 0x1 4138 #define WTS_CONSOLE_DISCONNECT 0x2 4139 #define WTS_REMOTE_CONNECT 0x3 4140 #define WTS_REMOTE_DISCONNECT 0x4 4141 #define WTS_SESSION_LOGON 0x5 4142 #define WTS_SESSION_LOGOFF 0x6 4143 #define WTS_SESSION_LOCK 0x7 4144 #define WTS_SESSION_UNLOCK 0x8 4145 #define WTS_SESSION_REMOTE_CONTROL 0x9 4146 4147 #define CREATE_MASK(__bit) (1 << (__bit -1) ) 4148 #define WTS_CONSOLE_CONNECT_MASK CREATE_MASK( WTS_CONSOLE_CONNECT ) 4149 #define WTS_CONSOLE_DISCONNECT_MASK CREATE_MASK( WTS_CONSOLE_DISCONNECT ) 4150 #define WTS_REMOTE_CONNECT_MASK CREATE_MASK( WTS_REMOTE_CONNECT ) 4151 #define WTS_REMOTE_DISCONNECT_MASK CREATE_MASK( WTS_REMOTE_DISCONNECT ) 4152 #define WTS_SESSION_LOGON_MASK CREATE_MASK( WTS_SESSION_LOGON ) 4153 #define WTS_SESSION_LOGOFF_MASK CREATE_MASK( WTS_SESSION_LOGOFF ) 4154 #define WTS_SESSION_LOCK_MASK CREATE_MASK( WTS_SESSION_LOCK ) 4155 #define WTS_SESSION_UNLOCK_MASK CREATE_MASK( WTS_SESSION_UNLOCK ) 4156 #define WTS_SESSION_REMOTE_CONTROL_MASK CREATE_MASK( WTS_SESSION_REMOTE_CONTROL ) 4157 #define WTS_ALL_NOTIFICATION_MASK 0xFFFFFFFF 4158 4159 4160 typedef struct _SESSIONID { 4161 union { 286 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 4162 ULONG SessionId; 4163 ULONG LogonId; 4164 } _SessionId_LogonId_union; 4165 WINSTATIONNAME WinStationName; 4166 WINSTATIONSTATECLASS State; 4167 } SESSIONID, *PSESSIONID; 4168 4169 4170 #define LOGINID SESSIONID 4171 #define PLOGINID PSESSIONID 4172 4173 4174 #define TS_USER_AUTHENTICATION_NONE 0 4175 #define TS_USER_AUTHENTICATION_VIA_HYBRID 1 4176 #define TS_USER_AUTHENTICATION_VIA_SSL 2 4177 #define TS_USER_AUTHENTICATION_DEFAULT TS_USER_AUTHENTICATION_NONE 4178 4179 typedef struct _VARDATA_WIRE { 4180 USHORT Size; 4181 USHORT Offset; 4182 } VARDATA_WIRE, *PVARDATA_WIRE; 4183 4184 typedef struct _PDPARAMSWIRE { 4185 SDCLASS SdClass; 4186 VARDATA_WIRE SdClassSpecific; 4187 } PDPARAMSWIRE, *PPDPARAMSWIRE; 4188 4189 typedef struct _WINSTACONFIGWIRE { 4190 WCHAR Comment[61]; 4191 char OEMId[4]; 287 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 4192 VARDATA_WIRE UserConfig; 4193 VARDATA_WIRE NewFields; 4194 } WINSTACONFIGWIRE, *PWINSTACONFIGWIRE; 4195 4196 #define PRODUCTINFO_COMPANYNAME_LENGTH 256 4197 #define PRODUCTINFO_PRODUCTID_LENGTH 4 4198 4199 typedef struct _WINSTATIONPRODUCTINFO { 4200 WCHAR CompanyName[PRODUCTINFO_COMPANYNAME_LENGTH]; 4201 WCHAR ProductID[PRODUCTINFO_PRODUCTID_LENGTH]; 4202 } WINSTATIONPRODUCTINFO, *PWINSTATIONPRODUCTINFO; 4203 4204 #define VALIDATIONINFORMATION_LICENSE_LENGTH 16384 4205 #define VALIDATIONINFORMATION_HARDWAREID_LENGTH 20 4206 4207 typedef struct _WINSTATIONVALIDATIONINFORMATION { 4208 WINSTATIONPRODUCTINFO ProductInfo; 4209 BYTE License[VALIDATIONINFORMATION_LICENSE_LENGTH]; 4210 ULONG LicenseLength; 4211 BYTE HardwareID[VALIDATIONINFORMATION_HARDWAREID_LENGTH]; 4212 ULONG HardwareIDLength; 4213 } WINSTATIONVALIDATIONINFORMATION, *PWINSTATIONVALIDATIONINFORMATION; 4214 4215 4215.1 Appendix A.6: tsdef.h For ease of implementation, the full header file is provided. 4216 #ifdef __cplusplus 4217 extern "C" { 4218 #endif 4219 288 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 4220 typedef ULONG TNotificationId; 4221 4222 #define WTS_NOTIFY_NONE ( 0x0 ) 4223 #define WTS_NOTIFY_CREATE ( 0x1 ) 4224 #define WTS_NOTIFY_CONNECT ( 0x2 ) 4225 #define WTS_NOTIFY_DISCONNECT ( 0x4 ) 4226 #define WTS_NOTIFY_LOGON ( 0x8 ) 4227 #define WTS_NOTIFY_LOGOFF ( 0x10 ) 4228 #define WTS_NOTIFY_SHADOW_START ( 0x20 ) 4229 #define WTS_NOTIFY_SHADOW_STOP ( 0x40 ) 4230 #define WTS_NOTIFY_TERMINATE ( 0x80 ) 4231 #define WTS_NOTIFY_CONSOLE_CONNECT ( 0x100 ) 4232 #define WTS_NOTIFY_CONSOLE_DISCONNECT ( 0x200 ) 4233 #define WTS_NOTIFY_LOCK ( 0x400 ) 4234 #define WTS_NOTIFY_UNLOCK ( 0x800 ) 4235 #define WTS_NOTIFY_ALL ( 0xffffffff ) 4236 4237 typedef enum _WINSTATIONUPDATECFGCLASS { 4238 WINSTACFG_LEGACY, 4239 WINSTACFG_SESSDIR 4240 } WINSTATIONUPDATECFGCLASS; 4241 4242 typedef struct _SESSION_CHANGE 4243 { 4244 LONG SessionId; 4245 TNotificationId NotificationId; 4246 } SESSION_CHANGE; 4247 4248 typedef struct _SESSION_CHANGE *PSESSION_CHANGE; 4249 289 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 4250 #ifndef _TS_TIME_ZONE_INFORMATION_ 4251 #define _TS_TIME_ZONE_INFORMATION_ 4252 typedef struct _TS_SYSTEMTIME { 4253 USHORT wYear; 4254 USHORT wMonth; 4255 USHORT wDayOfWeek; 4256 USHORT wDay; 4257 USHORT wHour; 4258 USHORT wMinute; 4259 USHORT wSecond; 4260 USHORT wMilliseconds; 4261 } TS_SYSTEMTIME; 4262 4263 typedef struct _TS_TIME_ZONE_INFORMATION { 4264 LONG Bias; 4265 WCHAR StandardName[ 32 ]; 4266 TS_SYSTEMTIME StandardDate; 4267 LONG StandardBias; 4268 WCHAR DaylightName[ 32 ]; 4269 TS_SYSTEMTIME DaylightDate; 4270 LONG DaylightBias; 4271 } TS_TIME_ZONE_INFORMATION; 4272 4273 #endif //_TS_TIME_ZONE_INFORMATION_ 4274 4275 typedef enum _SESSION_FILTER { 4276 SF_SERVICES_SESSION_POPUP 4277 } SESSION_FILTER; 4278 4279 typedef struct _CLIENT_ID { 290 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 4280 4281 HANDLE UniqueProcess; 4282 4283 HANDLE UniqueThread; 4284 4285 } CLIENT_ID; 4286 4287 4288 typedef struct _SYSTEM_THREAD_INFORMATION { 4289 4290 LARGE_INTEGER KernelTime; 4291 4292 LARGE_INTEGER UserTime; 4293 4294 LARGE_INTEGER CreateTime; 4295 4296 ULONG WaitTime; 4297 4298 PVOID StartAddress; 4299 4300 CLIENT_ID ClientId; 4301 4302 LONG Priority; 4303 4304 LONG BasePriority; 4305 4306 ULONG ContextSwitches; 4307 4308 ULONG ThreadState; 291 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 4309 4310 ULONG WaitReason; 4311 4312 } SYSTEM_THREAD_INFORMATION, *PSYSTEM_THREAD_INFORMATION; 4313 4314 4315 4316 4317 4318 #ifdef __cplusplus 4319 } 4320 #endif 4321 4322 4322.1 Appendix A.7: allproc.h For ease of implementation, the full header file is provided. 4323 #ifndef TS_ALLPROC_ALREADY_SET 4324 #define TS_ALLPROC_ALREADY_SET 4325 4326 #ifdef __midl 4327 cpp_quote( "#define TS_PROCESS_INFO_MAGIC_NT4 0x23495452" ) 4328 #else 4329 #define TS_PROCESS_INFO_MAGIC_NT4 0x23495452 4330 #endif 4331 4332 typedef struct _TS_PROCESS_INFORMATION_NT4 { 4333 ULONG MagicNumber; 4334 ULONG LogonId; 4335 PVOID ProcessSid; 4336 ULONG Pad; 292 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 4337 } TS_PROCESS_INFORMATION_NT4, * PTS_PROCESS_INFORMATION_NT4; 4338 4339 // sizes of TS4.0 structures (size has changed in Windows 2000) 4340 #ifdef __midl 4341 cpp_quote( "#define SIZEOF_TS4_SYSTEM_THREAD_INFORMATION 64" ) 4342 cpp_quote( "#define SIZEOF_TS4_SYSTEM_PROCESS_INFORMATION 136" ) 4343 #else 4344 #define SIZEOF_TS4_SYSTEM_THREAD_INFORMATION 64 4345 #define SIZEOF_TS4_SYSTEM_PROCESS_INFORMATION 136 4346 #endif 4347 4348 4349 #ifdef __midl 4350 cpp_quote( "#define GAP_LEVEL_BASIC 0" ) 4351 #else 4352 #define GAP_LEVEL_BASIC 0 4353 #endif 4354 4355 typedef struct _TS_UNICODE_STRING { 4356 USHORT Length; 4357 USHORT MaximumLength; 4358 #ifdef __midl 4359 [size_is(MaximumLength),length_is(Length)]PWSTR Buffer; 4360 #else 4361 PWSTR Buffer; 4362 #endif 4363 } TS_UNICODE_STRING; 4364 4365 4366 typedef struct _TS_SYS_PROCESS_INFORMATION { 293 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 4367 ULONG NextEntryOffset; 4368 ULONG NumberOfThreads; 4369 LARGE_INTEGER SpareLi1; 4370 LARGE_INTEGER SpareLi2; 4371 LARGE_INTEGER SpareLi3; 4372 LARGE_INTEGER CreateTime; 4373 LARGE_INTEGER UserTime; 4374 LARGE_INTEGER KernelTime; 4375 TS_UNICODE_STRING ImageName; 4376 LONG BasePriority; // KPRIORITY in ntexapi.h 4377 DWORD UniqueProcessId; // HANDLE in ntexapi.h 4378 DWORD InheritedFromUniqueProcessId; // HANDLE in ntexapi.h 4379 ULONG HandleCount; 4380 ULONG SessionId; 4381 ULONG SpareUl3; 4382 SIZE_T PeakVirtualSize; 4383 SIZE_T VirtualSize; 4384 ULONG PageFaultCount; 4385 ULONG PeakWorkingSetSize; 4386 ULONG WorkingSetSize; 4387 SIZE_T QuotaPeakPagedPoolUsage; 4388 SIZE_T QuotaPagedPoolUsage; 4389 SIZE_T QuotaPeakNonPagedPoolUsage; 4390 SIZE_T QuotaNonPagedPoolUsage; 4391 SIZE_T PagefileUsage; 4392 SIZE_T PeakPagefileUsage; 4393 SIZE_T PrivatePageCount; 4394 } 4395 TS_SYS_PROCESS_INFORMATION, *PTS_SYS_PROCESS_INFORMATION; 4396 294 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 4397 typedef struct _TS_ALL_PROCESSES_INFO { 4398 PTS_SYS_PROCESS_INFORMATION pTsProcessInfo; 4399 DWORD SizeOfSid; 4400 #ifdef __midl 4401 [size_is(SizeOfSid)] PBYTE pSid; 4402 #else 4403 PBYTE pSid; 4404 #endif 4405 } 4406 TS_ALL_PROCESSES_INFO, *PTS_ALL_PROCESSES_INFO; 4407 4408 4409 //====== 4410 4411 // The following structures are defined for taking care of interface 4412 // change in Whistler. 4413 4414 typedef struct _NT6_TS_UNICODE_STRING { 4415 USHORT Length; 4416 USHORT MaximumLength; 4417 #ifdef __midl 4418 [size_is(MaximumLength / 2),length_is(Length / 2)]PWSTR Buffer; 4419 #else 4420 PWSTR Buffer; 4421 #endif 4422 } NT6_TS_UNICODE_STRING; 4423 4424 4425 typedef struct _TS_SYS_PROCESS_INFORMATION_NT6 { 4426 ULONG NextEntryOffset; 295 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 4427 ULONG NumberOfThreads; 4428 LARGE_INTEGER SpareLi1; 4429 LARGE_INTEGER SpareLi2; 4430 LARGE_INTEGER SpareLi3; 4431 LARGE_INTEGER CreateTime; 4432 LARGE_INTEGER UserTime; 4433 LARGE_INTEGER KernelTime; 4434 NT6_TS_UNICODE_STRING ImageName; 4435 LONG BasePriority; // KPRIORITY in ntexapi.h 4436 DWORD UniqueProcessId; // HANDLE in ntexapi.h 4437 DWORD InheritedFromUniqueProcessId; // HANDLE in ntexapi.h 4438 ULONG HandleCount; 4439 ULONG SessionId; 4440 ULONG SpareUl3; 4441 SIZE_T PeakVirtualSize; 4442 SIZE_T VirtualSize; 4443 ULONG PageFaultCount; 4444 ULONG PeakWorkingSetSize; 4445 ULONG WorkingSetSize; 4446 SIZE_T QuotaPeakPagedPoolUsage; 4447 SIZE_T QuotaPagedPoolUsage; 4448 SIZE_T QuotaPeakNonPagedPoolUsage; 4449 SIZE_T QuotaNonPagedPoolUsage; 4450 SIZE_T PagefileUsage; 4451 SIZE_T PeakPagefileUsage; 4452 SIZE_T PrivatePageCount; 4453 } 4454 TS_SYS_PROCESS_INFORMATION_NT6, *PTS_SYS_PROCESS_INFORMATION_NT6; 4455 4456 typedef struct _TS_ALL_PROCESSES_INFO_NT6 { 296 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 4457 PTS_SYS_PROCESS_INFORMATION_NT6 pTsProcessInfo; 4458 DWORD SizeOfSid; 4459 #ifdef __midl 4460 [size_is(SizeOfSid)] PBYTE pSid; 4461 #else 4462 PBYTE pSid; 4463 #endif 4464 } 4465 TS_ALL_PROCESSES_INFO_NT6, *PTS_ALL_PROCESSES_INFO_NT6; 4466 4467 //====== 4468 4469 // 4470 // TermSrv Counter Header 4471 // 4472 typedef struct _TS_COUNTER_HEADER { 4473 DWORD dwCounterID; // identifies counter 4474 boolean bResult; // result of operation performed on counter 4475 } TS_COUNTER_HEADER, *PTS_COUNTER_HEADER; 4476 4477 typedef struct _TS_COUNTER { 4478 TS_COUNTER_HEADER counterHead; 4479 DWORD dwValue; // returned value 4480 LARGE_INTEGER startTime; // start time for counter 4481 } TS_COUNTER, *PTS_COUNTER; 4482 4483 #endif // TS_ALLPROC_ALREADY_SET 4484 4485 #define TSVIP_MAX_ADAPTER_ADDRESS_LENGTH 16 4486 297 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 4487 typedef struct _TSVIP_SOCKADDR { 4488 #ifdef __midl 4489 union switch (unsigned short sin_family) u 4490 { 4491 case 2: // AF_INET 4492 struct { 4493 USHORT sin_port; 4494 ULONG in_addr; 4495 UCHAR sin_zero[8]; 4496 } ipv4; 4497 case 23: // AF_INET6 4498 struct { 4499 USHORT sin6_port; 4500 ULONG sin6_flowinfo; 4501 USHORT sin6_addr[8]; 4502 ULONG sin6_scope_id; 4503 } ipv6; 4504 }; 4505 #else 4506 USHORT sin_family; 4507 union 4508 { 4509 struct { 4510 USHORT sin_port; 4511 ULONG in_addr; 4512 UCHAR sin_zero[8]; 4513 } ipv4; 4514 struct { 4515 USHORT sin6_port; 4516 ULONG sin6_flowinfo; 298 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 4517 USHORT sin6_addr[8]; 4518 ULONG sin6_scope_id; 4519 } ipv6; 4520 } u; 4521 #endif 4522 } TSVIP_SOCKADDR, 4523 *PTSVIP_SOCKADDR; 4524 4525 typedef struct _TSVIPAddress { 4526 DWORD dwVersion; //Structure version 4527 TSVIP_SOCKADDR IPAddress; //IPv4 is in network byte order. 4528 ULONG PrefixOrSubnetMask; //IPv4 is a mask in network byte order, 4529 #ifdef __midl //IPv6 is prefix length. 4530 [range(0, TSVIP_MAX_ADAPTER_ADDRESS_LENGTH)] 4531 UINT PhysicalAddressLength; 4532 [length_is(PhysicalAddressLength)] 4533 BYTE PhysicalAddress[TSVIP_MAX_ADAPTER_ADDRESS_LENGTH]; 4534 #else 4535 UINT PhysicalAddressLength; 4536 BYTE PhysicalAddress[TSVIP_MAX_ADAPTER_ADDRESS_LENGTH]; 4537 #endif 4538 ULONG LeaseExpires; 4539 ULONG T1; 4540 ULONG T2; 4541 } TSVIPAddress, 4542 *PTSVIPAddress; 4543 4544 typedef struct _TSVIPSession { 4545 DWORD dwVersion; //Structure version 4546 DWORD SessionId; //Session ID 299 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 4547 TSVIPAddress SessionIP; //IPAddress assign to session 4548 } TSVIPSession, 4549 *PTSVIPSession; 4550 4551 //NBD end 4552 4553 4553.1 Appendix A.8: SessEnvRpc.idl 4554 // 4555 // Interface for accessing SessionEnv functionality. 4556 // Public interface 4557 // 4558 import "ms-dtyp.idl"; 4559 4560 typedef enum 4561 { 4562 SHADOW_CONTROL_REQUEST_VIEW = 0, 4563 SHADOW_CONTROL_REQUEST_TAKECONTROL, 4564 SHADOW_CONTROL_REQUEST_Count 4565 } SHADOW_CONTROL_REQUEST; 4566 4567 typedef enum 4568 { 4569 SHADOW_PERMISSION_REQUEST_SILENT = 0, 4570 SHADOW_PERMISSION_REQUEST_REQUESTPERMISSION, 4571 SHADOW_PERMISSION_REQUEST_Count 4572 } SHADOW_PERMISSION_REQUEST; 4573 4574 typedef enum 300 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 4575 { 4576 SHADOW_REQUEST_RESPONSE_ALLOW = 0, 4577 SHADOW_REQUEST_RESPONSE_DECLINE, 4578 SHADOW_REQUEST_RESPONSE_POLICY_PERMISSION_REQUIRED, 4579 SHADOW_REQUEST_RESPONSE_POLICY_DISABLED, 4580 SHADOW_REQUEST_RESPONSE_POLICY_VIEW_ONLY, 4581 SHADOW_REQUEST_RESPONSE_POLICY_VIEW_ONLY_PERMISSION_REQUIRED, 4582 SHADOW_REQUEST_RESPONSE_SESSION_ALREADY_CONTROLLED 4583 } SHADOW_REQUEST_RESPONSE; 4584 4585 [ 4586 uuid(1257B580-CE2F-4109-82D6-A9459D0BF6BC), 4587 version(1.0), 4588 pointer_default(unique) 4589 ] 4590 interface SessEnvPublicRpc 4591 { 4592 cpp_quote( "#ifndef _SESSENVPUBLICRPC_ENDPOINT_DEF" ) 4593 cpp_quote( "#define _SESSENVPUBLICRPC_ENDPOINT_DEF" ) 4594 cpp_quote( "static LPCWSTR SESSENVPUBLICRPC_ENDPOINT = L\"\\\\pipe\\\\SessEnvPublicRpc\"; ") 4595 cpp_quote( "static LPCWSTR SESSENVPUBLICRPC_PROTOCOL_SEQUENCE = L\"ncacn_np\"; ") 4596 cpp_quote( "#endif // !_SESSENVPUBLICRPC_ENDPOINT_DEF" ) 4597 4598 // Purpose: 4599 // Create shadow invitation 4600 // 4601 // Parameters: 4602 // 4603 // IN hBinding 301 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 4604 // IN TargetSessionId - session ID. 4605 // IN eRequestControl -request control or view only 4606 // IN eRequestPermission -request permission or silent 4607 // OUT pePermission -shadow request or permission request response 4608 // OUT pszInvitation -collab API invitation string 4609 // IN cchInvitation - size of pszInvitation in WCHARs 4610 // 4611 HRESULT RpcShadow2( 4612 [in] handle_t hBinding, 4613 [in] ULONG TargetSessionId, 4614 [in] SHADOW_CONTROL_REQUEST eRequestControl, 4615 [in] SHADOW_PERMISSION_REQUEST eRequestPermission, 4616 [out] SHADOW_REQUEST_RESPONSE * pePermission, 4617 [out, string, size_is(cchInvitation)] LPWSTR pszInvitation, 4618 [in,range(1, 8192)] ULONG cchInvitation 4619 ); 4620 } 302 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 4621 Appendix B: Product Behavior The information in this specification is applicable to the following Microsoft products or supplemental software. References to product versions include released service packs. § Windows NT operating system § Windows 2000 operating system § Windows XP operating system § Windows Server 2003 operating system § Windows Vista operating system § Windows Server 2008 operating system § Windows 7 operating system § Windows Server 2008 R2 operating system § Windows 8 operating system § Windows Server 2012 operating system § Windows 8.1 operating system § Windows Server 2012 R2 operating system § Windows 10 operating system § Windows Server 2016 Technical Preview operating system Exceptions, if any, are noted below. If a service pack or Quick Fix Engineering (QFE) number appears with the product version, behavior changed in that service pack or QFE. The new behavior also applies to subsequent service packs of the product unless otherwise specified. If a product edition appears with the product version, behavior is different in that product edition. Unless otherwise specified, any statement of optional behavior in this specification that is prescribed using the terms SHOULD or SHOULD NOT implies product behavior in accordance with the SHOULD or SHOULD NOT prescription. Unless otherwise specified, the term MAY implies that the product does not follow the prescription. <1> Section 1.3: Virtual machines that are running Windows NT and Windows 2000 operating systems are not supported and are not visible to VM Host Agent callers. <2> Section 1.3: LSM Session, LSM Notification, LSM Enumeration, TermService, and TermService Listener are not available in Windows NT, Windows 2000, Windows XP, and Windows Server 2003. Legacy is available in Windows (except Windows NT). VM Host Agent Session, VM Host Agent Notification, and VM Host Agent Enumeration are available in Windows Server 2008 R2 operating system. <3> Section 1.8: Windows uses only the values specified in [MS-ERREF]. <4> Section 1.9: Does not exist in Windows NT, Windows 2000, Windows XP, and Windows Server 2003. <5> Section 1.9: Supported in Windows 7, Windows 8, Windows 8.1, and Windows 10. <6> Section 1.9: Does not exist in Windows NT, Windows 2000, Windows XP, and Windows Server 2003. 303 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 <7> Section 1.9: Supported in Windows 7, Windows 8, Windows 8.1, and Windows 10. <8> Section 1.9: Does not exist in Windows NT, Windows 2000, Windows XP, and Windows Server 2003. <9> Section 1.9: Supported in Windows 7, Windows 8, Windows 8.1, and Windows 10. <10> Section 1.9: Does not exist in Windows NT, Windows 2000, Windows XP, and Windows Server 2003. <11> Section 1.9: Does not exist in Windows NT, Windows 2000, Windows XP, and Windows Server 2003. <12> Section 2.2.1.8: Not supported on Windows NT, Windows 2000, Windows XP, and Windows Server 2003. In Windows Vista, Windows Server 2008, Windows 7, Windows Server 2008 R2, Windows 8, Windows Server 2012, Windows 8.1, and Windows Server 2012 R2, WinStationConnectState is not defined; instead, the following two enum values are used: Value Description WinStationReconnectedFromId In case of reconnected sessions, this will return the session ID of the temp session from which it was reconnected, or -1 if there is no temp session. WinStationEffectsPolicy SKU-Differentiation policy for the DWM-over-Terminal Services. <13> Section 2.2.1.8: WinStationCreateData is not supported on Windows NT and Windows 2000. <14> Section 2.2.1.8: WinStationPrinter is not supported on Windows NT and Windows 2000. <15> Section 2.2.1.8: WinStationTrace is not supported on Windows NT and Windows 2000. <16> Section 2.2.1.8: WinStationBeep not supported on Windows NT and Windows 2000. <17> Section 2.2.1.8: WinStationEncryptionOff is not supported on Windows NT and Windows 2000. <18> Section 2.2.1.8: WinStationEncryptionPerm is not supported on Windows NT and Windows 2000. <19> Section 2.2.1.8: Used by Winlogon. <20> Section 2.2.1.8: WinStationNtSecurity is supported only on Windows NT, Windows 2000, Windows XP, and Windows Server 2003. <21> Section 2.2.1.8: WinStationVideoData is supported only on Windows NT, Windows 2000, Windows XP, and Windows Server 2003. <22> Section 2.2.1.8: WinStationInitialProgram is supported only on Windows NT, Windows 2000, Windows XP, and Windows Server 2003. <23> Section 2.2.1.8: WinStationCd is supported only on Windows NT, Windows 2000, Windows XP, and Windows Server 2003. <24> Section 2.2.1.8: WinStationSystemTrace is supported only on Windows NT, Windows 2000, Windows XP, and Windows Server 2003. <25> Section 2.2.1.8: WinStationClientData is supported only on Windows NT, Windows 2000, Windows XP, and Windows Server 2003. 304 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 <26> Section 2.2.1.8: WinStationSecureDesktopEnter is supported only on Windows NT, Windows 2000, Windows XP, and Windows Server 2003. <27> Section 2.2.1.8: WinStationSecureDesktopExit is supported only on Windows NT, Windows 2000, Windows XP, and Windows Server 2003. <28> Section 2.2.1.8: WinStationLoadBalanceSessionTarget is supported only on Windows NT, Windows 2000, Windows XP, and Windows Server 2003. <29> Section 2.2.1.8: WinStationShadowInfo is supported only on Windows NT, Windows 2000, Windows XP, and Windows Server 2003. <30> Section 2.2.1.8: WinStationDigProductId is supported only on Windows NT, Windows 2000, Windows XP, and Windows Server 2003. <31> Section 2.2.1.8: Used by Winlogon. <32> Section 2.2.1.8: WinStationIdleTime is supported only on Windows NT, Windows 2000, Windows XP, and Windows Server 2003. <33> Section 2.2.1.8: WinStationLastReconnectType is supported only on Windows NT, Windows 2000, Windows XP, and Windows Server 2003. <34> Section 2.2.1.8: WinStationDisallowAutoReconnect is supported only on Windows NT, Windows 2000, Windows XP, and Windows Server 2003. <35> Section 2.2.1.8: WinStationType is not supported on Windows NT, Windows 2000, Windows XP, Windows Server 2003, Windows Vista, or Windows Server 2008. For Terminal Services, the supported session types are: Value Meaning TERMINAL_TYPE_SERVICE The GUID for the server session. 88f5767d-d13f-404d-a348- 8b8e030294a9 TERMINAL_TYPE_REGULAR_DESKTOP The GUID for the regular Terminal Services session. 0f0a4bf8-8362-435d-938c- 222a518a8b78 TERMINAL_TYPE_RDP_REMOTEAP The GUID for the Terminal Services Remote Applications session. eddcc3ce-6e7e-4f4b-8439- 3d9ad4c9440f TERMINAL_TYPE_MCE The GUID for the Windows Media Center Edition session. For more 8dc86f1d-9969-4379-91c1- information, see [MSFT-WINMCE]. 06fe1dc60575 <36> Section 2.2.1.8: WinStationInformationEx is not supported on Windows NT, Windows 2000, Windows XP, Windows Server 2003, Windows Vista, or Windows Server 2008. <37> Section 2.2.1.9: State_Reset is not supported on Windows NT or Windows 2000. <38> Section 2.2.1.10: For Terminal Services, the binaries indicated are tdnetb.dll, tdspx.dll, tdftp.dll tdipx.dll. <39> Section 2.2.1.10: For Terminal Services, the binary indicated is tdasync.dll. <40> Section 2.2.1.10: Not used by Terminal Services. 305 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 <41> Section 2.2.1.18: In Windows the default or standard shell is explorer.exe. It is specified in ‘HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\Shell. <42> Section 2.2.2.3: For Windows this will be ULONG with 1 indicating Desktop Window Manager (DWM) is enabled in the Terminal Services session, disabled otherwise. For more information about DWM, see [MSDN-DWM]. <43> Section 2.2.2.3: QUERY_SESSION_DATA_LICENSE is not supported on Windows NT, Windows 2000, or Windows Server 2003. <44> Section 2.2.2.3: QUERY_SESSION_DATA_DEVICEID is not supported on Windows NT, Windows 2000, or Windows Server 2003. <45> Section 2.2.2.3: QUERY_SESSION_DATA_LICENSE_VALIDATION is not supported on Windows NT, Windows 2000, Windows XP, Windows Server 2003, Windows Vista, or Windows Server 2008. <46> Section 2.2.2.4.1.2: SessionType is not supported on Windows NT, Windows 2000, Windows XP, or Windows Server 2003. For Terminal Services, the supported session types are as follows. Value Meaning TERMINAL_TYPE_SERVICE GUID for Service session. 88f5767d-d13f-404d-a348- 8b8e030294a9 TERMINAL_TYPE_REGULAR_DESKTOP GUID for regular Terminal Services session. 0f0a4bf8-8362-435d-938c- 222a518a8b78 TERMINAL_TYPE_RDP_REMOTEAP GUID for Terminal Services Remote Applications session. eddcc3ce-6e7e-4f4b-8439- 3d9ad4c9440f TERMINAL_TYPE_MCE GUID for Windows Media Center Edition session. For more 8dc86f1d-9969-4379-91c1- information, see [MSFT-WINMCE]. 06fe1dc60575 <47> Section 2.2.2.6: PEXECENVDATA is not supported on Windows NT, Windows 2000, Windows XP, Windows Server 2003, Windows Vista, or Windows Server 2008. <48> Section 2.2.2.6.1: ExecEnvData is not supported on Windows NT, Windows 2000, Windows XP, Windows Server 2003, Windows Vista, or Windows Server 2008. <49> Section 2.2.2.6.1: ExecEnvEnum_Level1 is not supported on Windows NT, Windows 2000, Windows XP, Windows Server 2003, Windows Vista, or Windows Server 2008. <50> Section 2.2.2.6.1: ExecEnvEnum_Level2 is not supported on Windows NT, Windows 2000, Windows XP, Windows Server 2003, Windows Vista, or Windows Server 2008. <51> Section 2.2.2.6.1.1: ExecEnvId is not supported on Windows NT, Windows 2000, Windows XP, Windows Server 2003, Windows Vista, or Windows Server 2008. 306 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 <52> Section 2.2.2.6.1.2: ExecEnvId is not supported on Windows NT, Windows 2000, Windows XP, Windows Server 2003, Windows Vista, or Windows Server 2008. <53> Section 2.2.2.7: PEXECENVDATAEX is not supported on Windows NT, Windows 2000, Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows Server 2008 R2, or Windows 7. <54> Section 2.2.2.7.1: ExecEnvDataEx is not supported on Windows NT, Windows 2000, Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows Server 2008 R2, or Windows 7. <55> Section 2.2.2.7.1: ExecEnvEnum_Level1 is not supported on Windows NT, Windows 2000, Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows Server 2008 R2, or Windows 7. <56> Section 2.2.2.17.1: TERMSRV_PENDING_SESSIONS is not supported on Windows NT, Windows 2000, Windows XP, or Windows Server 2003. <57> Section 2.2.2.17.1: TERMSRV_SUCC_TOTAL_LOGONS is not supported in Windows NT, Windows 2000, or Windows XP. <58> Section 2.2.2.17.1: TERMSRV_SUCC_LOCAL_LOGONS is not supported in Windows NT, Windows 2000, or Windows XP. <59> Section 2.2.2.17.1: TERMSRV_SUCC_REMOTE_LOGONS is not supported in Windows NT, Windows 2000, or Windows XP. <60> Section 2.2.2.17.1: TERMSRV_SUCC_SESSION0_LOGONS is not supported in Windows NT, Windows 2000, or Windows XP. <61> Section 2.2.2.17.1: TERMSRV_CURRENT_TERMINATING_SESSIONS is not supported in Windows NT, Windows 2000, Windows XP, or Windows Server 2003. <62> Section 2.2.2.17.1: TERMSRV_CURRENT_LOGGEDON_SESSIONS is not supported in Windows NT, Windows 2000, Windows XP, or Windows Server 2003. <63> Section 2.2.2.18: Not used by Terminal Services. <64> Section 2.2.2.18: Not used by Terminal Services. <65> Section 2.2.2.18: fLogonDisabled is only supported on Windows NT, Windows 2000, Windows XP, and Windows Server 2003. <66> Section 2.2.2.18: fUseDefaultGina is supported only on Windows NT, Windows 2000, Windows XP, and Windows Server 2003. <67> Section 2.2.2.18: fCursorBlinkDisabled is not supported on Windows NT or Windows 2000. <68> Section 2.2.2.18: fDisableAutoReconnect is not supported on Windows NT or Windows 2000. <69> Section 2.2.2.18: ColorDepth is not supported on Windows NT and Windows 2000. The supported values 1, 2, 3, 4, and 5 are translated, respectively, as the following number of colors supported: 256 (8 bpp), 32,768 (15 bpp), 65,536 (16 bpp), 16 million (24 bpp), and 16 million with transparency (32 bpp). A ColorDepth value of 5 indicates 32-bit color; this is not supported on Windows NT, Windows 2000, Windows XP, and Windows Server 2003. 307 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 <70> Section 2.2.2.18: fInheritColorDepth is not supported on Windows NT or Windows 2000. <71> Section 2.2.2.18: fErrorInvalidProfile is not supported on Windows NT, Windows 2000, or Windows XP. <72> Section 2.2.2.18: fPasswordIsScPin is not supported on Windows NT, Windows 2000, or Windows XP. <73> Section 2.2.2.18: In Windows, the default program is explorer.exe. <74> Section 2.2.2.18: Not used by Terminal Services. <75> Section 2.2.2.18: Not used by Terminal Services. <76> Section 2.2.2.18: The NWLogonServer value is not used by Terminal Services, although it can be set and retrieved as a part of user and session configuration data. <77> Section 2.2.2.18.1: Callback is not used by Terminal Services, although callback information can be set and retrieved as a part of user and session configuration data. <78> Section 2.2.2.19: fRemoteConsoleAudio is not supported on Windows NT or Windows 2000. <79> Section 2.2.2.19: fPasswordIsScPin is not supported on Windows NT, Windows 2000, or Windows XP. <80> Section 2.2.2.19: fNoAudioPlayback is not supported on Windows NT, Windows 2000, Windows XP, or Windows Server 2003. <81> Section 2.2.2.19: fRestrictedLogon is not supported in Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7, Windows Server 2008 R2, Windows 8, or Windows Server 2012. <82> Section 2.2.2.19: In Windows, the default program is explorer.exe. <83> Section 2.2.2.19: IPv6 is not supported in Windows NT, Windows 2000, Windows XP, or Windows Server 2003. <84> Section 2.2.2.19: ColorDepth is not supported on Windows NT and Windows 2000. The supported values 1, 2, 4, 8, 16, and 32 are translated, respectively, as the following number of colors supported: 16 (4 bpp), 256 (8 bpp), 65,536 (16 bpp), 16 million (24 bpp), 32,768 (15 bpp), and 16 million with transparency (32 bpp). A ColorDepth value of 32 indicates 32-bit color; this is not supported on Windows NT, Windows 2000, Windows XP, and Windows Server 2003. <85> Section 2.2.2.19: ProtocolType is not supported on Windows NT or Windows 2000. <86> Section 2.2.2.19: Not used by Terminal Services. <87> Section 2.2.2.19: Not used by Terminal Services. <88> Section 2.2.2.19: ClientTimeZone is not supported on Windows NT or Windows 2000. <89> Section 2.2.2.19: ClientSessionId is not supported on Windows NT or Windows 2000. <90> Section 2.2.2.19: clientDigProductId is not supported on Windows NT or Windows 2000. 308 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 If the terminal server client is either RDP 5.0, 5.1, or 6.0 and is running on Windows XP or Windows Server 2003, this field contains the client machine's product ID from registry HKLM\Software\microsoft\windows\currentversion\productID. If RDP 6.0 terminal server client is running on a Windows Vista-based machine, it contains a unique instance ID of LSM process which is InstanceID in the TS registry. <91> Section 2.2.2.19: PerformanceFlags is not supported on Windows NT or Windows 2000. <92> Section 2.2.2.19: TS_PERF_ENABLE_FONT_SMOOTHING is not supported on Windows NT, Windows 2000, Windows XP, or Windows Server 2003. <93> Section 2.2.2.19: TS_PERF_ENABLE_DESKTOP_COMPOSITION is not supported on Windows NT, Windows 2000, Windows XP, or Windows Server 2003. <94> Section 2.2.2.19: ActiveInputLocale is not supported on Windows NT, Windows 2000, or Windows XP. <95> Section 2.2.2.20.1.3.1: Not used by Terminal Services. <96> Section 2.2.2.21: Not used by Terminal Services. <97> Section 2.2.2.21: Not used by Terminal Services. <98> Section 2.2.2.27: For the Microsoft RDP implementation, this driver is rdpwd.sys. <99> Section 2.2.2.27: For the Microsoft RDP implementation, this binary is rdpwsx.dll. <100> Section 2.2.2.27: WDF_DYNAMIC_RECONNECT is not supported on Windows NT or Windows 2000. <101> Section 2.2.2.27: WDF_SUBDESKTOP not supported on Windows NT or Windows 2000. <102> Section 2.2.2.27: For the Microsoft RDP implementation, this binary is rdpcfgex.dll. <103> Section 2.2.2.27: For the Microsoft RDP implementation, this string is "RDP". <104> Section 2.2.2.28: Not supported on Windows NT or Windows 2000. <105> Section 2.2.2.31: The POLICY_TS_MACHINE structure is supported only on Windows XP and Windows Server 2003. <106> Section 2.2.2.31: fPolicyFipsEnabled is supported only on Windows XP and Windows Server 2003. <107> Section 2.2.2.31: fPolicySecureLicensing is supported only on Windows XP and Windows Server 2003. <108> Section 2.2.2.31: fPolicyEnableTimeZoneRedirection is not supported on Windows NT, Windows 2000, or Windows XP. <109> Section 2.2.2.31: fPolicyDisableForcibleLogoff is not supported on Windows NT, Windows 2000, or Windows XP. <110> Section 2.2.2.31: fPolicyLicensingMode is not supported on Windows NT, Windows 2000, or Windows XP. 309 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 <111> Section 2.2.2.31: fPolicyExplicitLSDiscovery is not supported on Windows NT, Windows 2000, or Windows XP. <112> Section 2.2.2.31: fPolicyDisableTerminalServerTooltip is not supported on Windows NT, Windows 2000, or Windows XP. <113> Section 2.2.2.31: ColorDepth is not supported on Windows NT or Windows 2000. <114> Section 2.2.2.31: fSecureLicensing is not supported on Windows NT, Windows 2000, or Windows XP. <115> Section 2.2.2.31: fEnableTimeZoneRedirection is not supported on Windows NT, Windows 2000, or Windows XP. <116> Section 2.2.2.31: fDisableForcibleLogoff is supported only on Windows XP and Windows Server 2003. <117> Section 2.2.2.31: fPolicyEncryptRPCTraffic is not supported on Windows NT, Windows 2000, or Windows XP. <118> Section 2.2.2.31: fErrorInvalidProfile is not supported on Windows NT, Windows 2000, or Windows XP. <119> Section 2.2.2.31: fPolicyFallbackPrintDriver is not supported on Windows NT, Windows 2000, or Windows XP. <120> Section 2.2.2.31: FallbackPrintDriverType is not supported on Windows NT, Windows 2000, or Windows XP. <121> Section 2.2.2.31: fDisableTerminalServerTooltip is not supported on Windows NT, Windows 2000, or Windows XP. <122> Section 2.2.2.31: bSecurityLayer is not supported on Windows NT, Windows 2000, or Windows XP. <123> Section 2.2.2.31: fPolicySecurityLayer is not supported on Windows NT, Windows 2000, or Windows XP. <124> Section 2.2.2.31: fPolicyUserAuthentication is not supported on Windows NT, Windows 2000, or Windows XP. <125> Section 2.2.2.31: fPolicyTurnOffSingleAppMode is not supported on Windows NT, Windows 2000, or Windows XP. <126> Section 2.2.2.31: In Windows the default program is explorer.exe. <127> Section 2.2.2.33: The value 32 in fColorDepth indicates 32-bit color; this is not supported on Windows NT, Windows 2000, Windows XP, and Windows Server 2003. <128> Section 2.2.2.35: PROTOCOL_CONSOLE is not supported in Windows NT or Windows 2000 <129> Section 2.2.2.36: DigProductId is not supported on Windows NT or Windows 2000. On Windows XP and Windows Server 2003, this field contains the machine's product ID from the registry key HKLM\Software\microsoft\windows\currentversion\productID. <130> Section 2.2.2.36: ClientDigProductId is not supported on Windows NT or Windows 2000. If the terminal server client is RDP 5.0, 5.1, or 6.0 and is running on Windows XP or Windows Server 2003, this field contains the client machine's product ID from the registry key HKLM\Software\microsoft\windows\currentversion\productID. If an RDP 6.0 310 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 terminal server client is running on a Windows Vista-based machine, this field contains a unique instance ID of an LSM process, which is InstanceID in the TS registry. <131> Section 2.2.2.37: IPv6 format addresses are not supported in Windows NT, Windows 2000, Windows XP, or Windows Server 2003. <132> Section 2.2.2.38: Not used by Terminal Services. <133> Section 2.2.2.39: For Terminal Services, this is icaapi.dll. <134> Section 2.2.2.39: For Terminal Services, this is icaapi.dll. <135> Section 2.2.2.39: For Terminal Services, this is termdd.sys. <136> Section 2.2.2.39: For Terminal Services, this binary is rdpwd.sys. <137> Section 2.2.2.39: Not used by Terminal Services. <138> Section 2.2.2.39: For Terminal Services, this binary is rdpwd.sys. <139> Section 2.2.2.39: For Terminal Services, this binary is tdtcp.sys. <140> Section 2.2.2.39: Not used by Terminal Services. <141> Section 2.2.2.39: Not used by Terminal Services. <142> Section 2.2.2.39: Not used by Terminal Services. <143> Section 2.2.2.39: For Terminal Services, this binary is rdpcfgex.dll. <144> Section 2.2.2.39: For Terminal Services, this binary is rdpwsx.dll. <145> Section 2.2.2.39: Not used by Terminal Services. <146> Section 2.2.2.44: Not used by Terminal Services. <147> Section 2.3.1: This field is not used by Terminal Services. <148> Section 3.1.1: For Terminal Services, the SECURITY_DESCRIPTOR for the console session is taken from the registry value HKLM\CurrentControlSet\Control\Terminal Server\WinStations\ConsoleSecurity. For remote sessions, it is taken from the registry value HKLM\CurrentControlSet\Control\Terminal Server\WinStations\ListenerName\Security, where ListenerName is the name of the listener through which the session was started when the connection request was received. If HKLM\CurrentControlSet\Control\Terminal Server\WinStations\ListenerName\Security does not exist or is empty, then it is taken from the registry value HKLM\CurrentControlSet\Control\Terminal Server\WinStations\DefaultSecurity. <149> Section 3.3.4.1.15: Not supported on Windows NT, Windows 2000, Windows XP, Windows Server 2003, Windows Vista, or Windows Server 2008. <150> Section 3.3.4.1.16: Not supported on Windows NT, Windows 2000, Windows XP, Windows Server 2003, Windows Vista, or Windows Server 2008. <151> Section 3.3.4.3.6: Level is not supported on Windows NT, Windows 2000, Windows XP, or Windows Server 2003. The maximum value of Level supported is 2. <152> Section 3.3.4.3.9: Level is not supported on Windows NT, Windows 2000, Windows XP, Windows Server 2003, or Windows Vista. The maximum supported value of Level is 2. <153> Section 3.3.4.3.10: Not supported on Windows NT, Windows 2000, Windows XP, Windows Server 2003, Windows Vista, or Windows Server 2008. 311 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 <154> Section 3.3.4.3.10: Not supported on Windows NT, Windows 2000, Windows XP, Windows Server 2003, Windows Vista, or Windows Server 2008. <155> Section 3.3.4.3.11: Not supported on Windows NT, Windows 2000, Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows Server 2008 R2, or Windows 7. <156> Section 3.5.4.1.2: For information about setting permissions in Windows, see [MSDN-Win32_TSAcct]. <157> Section 3.5.4.2.2: The method returns an error code, E_NOTIMPL (80004001), which is not supported on Windows NT, Windows 2000, Windows XP, and Windows Server 2003. <158> Section 3.7.4.1: Opnums reserved for local use apply to Windows as follows. Opnum Description 11 - 12 Only used locally by Windows, never remotely. 18 - 28 Only used locally by Windows, never remotely. 30 - 33 Only used locally by Windows, never remotely. 35 Only used locally by Windows, never remotely. 38 - 39 Only used locally by Windows, never remotely. 47 - 51 Only used locally by Windows, never remotely. 54 - 57 Only used locally by Windows, never remotely. 63 - 64 Only used locally by Windows, never remotely. 67 - 69 Only used locally by Windows, never remotely. 71 - 74 Only used locally by Windows, never remotely. Opnums not implemented apply to Windows as follows. Opnum Description 29 Exception is raised with error ERROR_INVALID_FUNCTION 40 - 42 Exception is raised with error ERROR_INVALID_FUNCTION 52 Exception is raised with error RPC_S_CANNOT_SUPPORT All of these opnums return error code E_NOTIMPL (0x80004001); this is not supported on Windows NT, Windows 2000, Windows XP, and Windows Server 2003. <159> Section 3.7.4.1.3: RpcIcaServerPing is supported only on Windows NT, Windows 2000, Windows XP, and Windows Server 2003. <160> Section 3.7.4.1.5: RpcWinStationRename is supported on Windows NT, Windows 2000, Windows XP, and Windows Server 2003. For information about setting permissions on Windows, see [MSDN-Win32_TSAcct]. <161> Section 3.7.4.1.6: For information about setting permissions in Windows, see [MSDN-Win32_TSAcct]. <162> Section 3.7.4.1.6: This information class is not supported on Windows NT and Windows 2000. <163> Section 3.7.4.1.6: The driver is tdtcp.sys for Terminal Services. <164> Section 3.7.4.1.6: The driver is rdpwd.sys for Terminal Services. <165> Section 3.7.4.1.6: The driver is tdtcp.sys for Terminal Services. 312 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 <166> Section 3.7.4.1.6: This information class is not supported on Windows NT and Windows 2000. <167> Section 3.7.4.1.6: This information class is not supported on Windows NT and Windows 2000. <168> Section 3.7.4.1.6: This information class is not supported on Windows NT and Windows 2000. <169> Section 3.7.4.1.6: This information class is not supported on Windows NT or Windows 2000. <170> Section 3.7.4.1.6: This information class is supported only on Windows Server 2003. <171> Section 3.7.4.1.7: This call is supported only on Windows NT 4.0 operating system, Windows 2000, Windows XP, and Windows Server 2003. For information about setting permissions in Windows, see [MSDN- Win32_TSAcct]. <172> Section 3.7.4.1.7: Ignored by the Microsoft terminal server drivers in Windows NT 4.0, Windows 2000, Windows XP, and Windows Server 2003. <173> Section 3.7.4.1.7: Ignored by the Microsoft terminal server drivers in Windows NT 4.0, Windows 2000, Windows XP, and Windows Server 2003. <174> Section 3.7.4.1.7: Used by Winlogon. <175> Section 3.7.4.1.8: For information about setting permissions in Windows, see [MSDN-Win32_TSAcct]. <176> Section 3.7.4.1.9: For information about setting permissions in Windows, see [MSDN-Win32_TSAcct]. <177> Section 3.7.4.1.10: For information about setting permissions in Windows, see [MSDN-Win32_TSAcct]. <178> Section 3.7.4.1.11: For information about setting permissions in Windows, see [MSDN-Win32_TSAcct]. <179> Section 3.7.4.1.11: This parameter is supported only on Windows NT, Windows 2000, Windows XP, and Windows Server 2003. <180> Section 3.7.4.1.12: For information about setting permissions in Windows, see [MSDN-Win32_TSAcct]. <181> Section 3.7.4.1.12: This parameter is supported only on Windows NT, Windows 2000, Windows XP, and Windows Server 2003. <182> Section 3.7.4.1.13: In the case of resetting a listener, all sessions started by Terminal Services based on connection requests received through that listener will be disconnected; this is not supported on Windows NT, Windows 2000, Windows XP, and Windows Server 2003. For information about setting permissions in Windows, see [MSDN- Win32_TSAcct]. <183> Section 3.7.4.1.15: Not used by Terminal Services. <184> Section 3.7.4.1.16: This call is supported only on Windows NT, Windows 2000, Windows XP, and Windows Server 2003. <185> Section 3.7.4.1.17: This call is supported only on Windows NT and Windows 2000. In Windows the session manager is csrss.exe. 313 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 <186> Section 3.7.4.1.17: On Windows 2000, the method ignores any value for LogonId other than -2 and will not allow the debugger to be broken into in kernel mode or in a particular session's csrss.exe process. <187> Section 3.7.4.1.18: The registry reread is HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations for each subkey under WinStation. <188> Section 3.7.4.1.18: This method is supported only on Windows NT, Windows 2000, Windows XP, and Windows Server 2003. <189> Section 3.7.4.1.19: The OldRpcWinStationEnumerateProcesses method returns the process information for a terminal server and is supported only on Windows NT Server 4.0 operating system terminal server for backward compatibility. <190> Section 3.7.4.1.20: The RpcWinStationEnumerateProcesses method returns the process information for a terminal server and is supported only on Windows NT Server 4.0 terminal server for backwards compatibility. <191> Section 3.7.4.1.23: RpcWinStationGetProcessSid is not supported in Windows NT. <192> Section 3.7.4.1.23: This value is not returned in Windows NT, Windows 2000, Windows XP, or Windows Server 2003. <193> Section 3.7.4.1.23: This value is returned only in Windows NT, Windows 2000, Windows XP, and Windows Server 2003. <194> Section 3.7.4.1.23: This value is not returned in Windows NT, Windows 2000, Windows XP, or Windows Server 2003. <195> Section 3.7.4.1.23: This value is returned only in Windows NT, Windows 2000, Windows XP, and Windows Server 2003. <196> Section 3.7.4.1.23: This value is returned only in Windows NT, Windows 2000, Windows XP, and Windows Server 2003. <197> Section 3.7.4.1.23: This value is not returned in Windows NT, Windows 2000, Windows XP, or Windows Server 2003. <198> Section 3.7.4.1.23: This value is returned only in Windows NT, Windows 2000, Windows XP, and Windows Server 2003. <199> Section 3.7.4.1.23: This value is not returned in Windows NT, Windows 2000, Windows XP, or Windows Server 2003. <200> Section 3.7.4.1.25: Done for all WinStations specified in the registry under HKLM\System\CurrentControlSet\Terminal Server\WinStations. <201> Section 3.7.4.1.25: This call is supported on Windows 2000, Windows XP, and Windows Server 2003. <202> Section 3.7.4.1.26: The GUIDs for the network adapters implementing terminal server are found as subkeys under the registry key HKLM\System\CurrentControlSet\Control\Terminal Server\lanatable, where each key is the adapter's GUID, and the DWORD value LanaId under that key is the lana that is matched to the parameter LanAdapter. <203> Section 3.7.4.1.26: This call is supported only on Windows 2000, Windows XP, and Windows Server 2003. 314 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 <204> Section 3.7.4.1.27: RpcWinStationUpdateSettings is supported only in Windows XP and Windows Server 2003. In Windows XP, a class of WINSTACFG_SESSDIR will do nothing and always returns success. <205> Section 3.7.4.1.27: If running in Remote Desktop mode (Windows XP) or in Remote Admin mode, this does nothing. <206> Section 3.7.4.1.28: RpcWinStationShadowStop is supported only in Windows XP and Windows Server 2003. <207> Section 3.7.4.1.30: RpcWinStationIsHelpAssistantSession is supported only in Windows XP and Windows Server 2003. <208> Section 3.7.4.1.31: RpcWinStationGetMachinePolicy is supported only on Windows XP and Windows Server 2003. <209> Section 3.7.4.1.32: RpcWinStationCheckLoopBack is supported only on Windows XP and Windows Server 2003. <210> Section 3.7.4.1.33: RpcConnectCallback is supported only in Windows XP and Windows Server 2003. <211> Section 3.7.4.1.35: Supported on Windows Server 2003 only, and only on advanced servers running in application server mode. <212> Section 3.9.4.1.1: This call is not supported on Windows NT, Windows 2000, Windows XP, Windows Server 2003, Windows Vista, or Windows Server 2008. 315 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 4622 Change Tracking This section identifies changes that were made to this document since the last release. Changes are classified as New, Major, Minor, Editorial, or No change. The revision class New means that a new document is being released. The revision class Major means that the technical content in the document was significantly revised. Major changes affect protocol interoperability or implementation. Examples of major changes are: § A document revision that incorporates changes to interoperability requirements or functionality. § The removal of a document from the documentation set. The revision class Minor means that the meaning of the technical content was clarified. Minor changes do not affect protocol interoperability or implementation. Examples of minor changes are updates to clarify ambiguity at the sentence, paragraph, or table level. The revision class Editorial means that the formatting in the technical content was changed. Editorial changes apply to grammatical, formatting, and style issues. The revision class No change means that no new technical changes were introduced. Minor editorial and formatting changes may have been made, but the technical content of the document is identical to the last released version. Major and minor changes can be described further using the following change types: § New content added. § Content updated. § Content removed. § New product behavior note added. § Product behavior note updated. § Product behavior note removed. § New protocol syntax added. § Protocol syntax updated. § Protocol syntax removed. § New content added due to protocol revision. § Content updated due to protocol revision. § Content removed due to protocol revision. § New protocol syntax added due to protocol revision. § Protocol syntax updated due to protocol revision. § Protocol syntax removed due to protocol revision. § Obsolete document removed. Editorial changes are always classified with the change type Editorially updated. Some important terms used in the change type descriptions are defined as follows: § Protocol syntax refers to data elements (such as packets, structures, enumerations, and methods) as well as interfaces. 316 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 § Protocol revision refers to changes made to a protocol that affect the bits that are sent over the wire. The changes made to this document are listed in the following table. For more information, please contact [email protected]. Tracking number (if applicable) and Major change (Y or Section Change type description N) 2.2.1.17 Clarified that UINT_PTR is an unsigned Content Y UINT_PTR integer. update. Index A timer events 94 timers 94 Abstract data model message processing 130 client (section 3.2.1 94, section 3.4.1 118, section sequencing rules 130 3.6.1 130) TermSrv legacy 130 abstract data model 118 local session manager 94 initialization 118 TermSrv 118 local events 118 virtual IP 174 message processing 118 server (section 3.3.1 94, section 3.5.1 118, section sequencing rules 118 3.7.1 130) timer events 118 legacy 130 timers 118 local session manager 94 timer events (section 3.2.5 94, section 3.4.5 118, TermSrv 118 section 3.6.5 130) virtual IP 175 timers (section 3.2.2 94, section 3.4.2 118, section Access rights - caller - overview 93 3.6.2 130) Applicability 16 virtual IP appsrv\tsvip\rpc\tsviprpc.idl 206 abstract data model 174 ASYNCCONFIG structure 59 initialization 174 ASYNCCONNECTCLASS enumeration 61 local events 175 message processing 175 B sequencing rules 175 timer events 175 BEEPINPUT structure 80 timers 174 CLIENT_ID structure 43 C CLIENT_STACK_ADDRESS structure 81 Common data types 17 CONNECTCONFIG structure 61 CACHE_STATISTICS structure 57 CALLBACKCLASS enumeration 48 Caller permissions and access rights - overview 93 D Capability negotiation 16 CDCLASS enumeration 66 Data model - abstract CDCONFIG structure 66 client (section 3.2.1 94, section 3.4.1 118, section Change tracking 242 3.6.1 130) Client legacy 130 abstract data model (section 3.2.1 94, section 3.4.1 local session manager 94 118, section 3.6.1 130) TermSrv 118 initialization (section 3.2.3 94, section 3.4.3 118, virtual IP 174 section 3.6.3 130) server (section 3.3.1 94, section 3.5.1 118, section legacy 3.7.1 130) abstract data model 130 legacy 130 initialization 130 local session manager 94 local events 130 TermSrv 118 message processing 130 virtual IP 175 sequencing rules 130 Data types timer events 130 common - overview 17 timers 130 structures 27 local events (section 3.2.6 94, section 3.4.6 118, Decoding/encoding example 188 section 3.6.6 130) Determining caller permissions and access rights - local session manager overview 93 abstract data model 94 Directory service schema elements 85 initialization 94 local events 94 E message processing 94 sequencing rules 94 317 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 Elements - directory service schema 85 Initialization Encoding/decoding example 188 client (section 3.2.3 94, section 3.4.3 118, section Encoding/decoding example example 188 3.6.3 130) Events legacy 130 local local session manager 94 legacy client 130 TermSrv 118 legacy server 174 virtual IP 174 LSM client 94 server (section 3.3.3 97, section 3.5.3 120, section LSM server 118 3.7.3 133) TermSrv client 118 legacy 133 TermSrv server 130 local session manager 97 virtual IP client 175 TermSrv 120 virtual IP server 176 virtual IP 175 local - client (section 3.2.6 94, section 3.4.6 118, Introduction 10 section 3.6.6 130) local - server (section 3.3.6 118, section 3.5.6 130, L section 3.7.6 174) timer Legacy client legacy client 130 abstract data model 130 legacy server 174 initialization 130 LSM client 94 local events 130 LSM server 118 message processing 130 TermSrv client 118 sequencing rules 130 TermSrv server 129 timer events 130 virtual IP client 175 timers 130 virtual IP server 176 Legacy example 186 timer - client (section 3.2.5 94, section 3.4.5 118, Legacy example example 186 section 3.6.5 130) Legacy server timer - server (section 3.3.5 118, section 3.5.5 129, abstract data model 130 section 3.7.5 174) initialization 133 Examples local events 174 ecoding/decoding 188 message processing 133 encoding/decoding example 188 sequencing rules 133 legacy 186 timer events 174 legacy example 186 timers 133 LSM enumeration 179 LegacyApi method 133 lsm enumeration example 179 LISTENERENUM structure 36 TermService listener 181 LISTENERENUM_LEVEL1 structure 37 termservice listener example 181 LOADFACTORTYPE enumeration 74 TermSrvBindSecure 183 Local events termsrvbindsecure example 183 client (section 3.2.6 94, section 3.4.6 118, section EXECENVDATA structure 31 3.6.6 130) EXECENVDATA_LEVEL1 structure 32 legacy 130 EXECENVDATA_LEVEL2 structure 32 local session manager 94 EXECENVDATAEX structure 33 TermSrv 118 EXECENVDATAEX_LEVEL1 structure 33 virtual IP 175 ExtendedClientCredentials structure 77 server (section 3.3.6 118, section 3.5.6 130, section 3.7.6 174) F legacy 174 local session manager 118 Fields - vendor-extensible 16 TermSrv 130 FLOWCONTROLCLASS enumeration 60 virtual IP 176 FLOWCONTROLCONFIG structure 59 LSM client Full IDL 191 abstract data model 94 initialization 94 G local events 94 message processing 94 sequencing rules 94 Glossary 10 timer events 94 timers 94 I LSM enumeration example 179 Lsm enumeration example example 179 IDL 191 LSM server Implementation - overview 93 abstract data model 94 Implementer - security considerations 190 initialization 97 Index of security parameters 190 local events 118 Informative references 14 message processing 97 318 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 sequencing rules 97 PLSM_SESSIONINFO_EX_LEVEL1 35 timer events 118 PLSMSESSIONINFORMATION 34 timers 97 PLSMSESSIONINFORMATION_EX 35 LSM_SESSIONINFO_EX_LEVEL1 structure 35 PNASICONFIG 61 LSMSESSIONINFORMATION structure 34 PNETWORKCONFIG 58 LSMSESSIONINFORMATION_EX structure 35 POEMTDCONFIG 63 POLICY_TS_MACHINE structure 68 M PPDCONFIG 63 PPDCONFIG2 63 PPDPARAMS 58 Message processing PPDPARAMSWIRE 82 client 130 PPOLICY_TS_MACHINE 68 legacy 130 PPROTOCOLCOUNTERS 56 local session manager 94 PPROTOCOLSTATUS 55 TermSrv 118 PPROTOCOLSTATUSEX 55 virtual IP 175 PRCM_REMOTEADDRESS 80 server (section 3.5.4 120, section 3.7.4 133) Preconditions 15 legacy 133 Prerequisites 15 local session manager 97 PRESERVED_CACHE 57 TermSrv 120 Product behavior 229 virtual IP 175 PropValue field - encoding in TSProperty structure 91 Messages Protocol Details common data types 17 overview 93 transport 17 PROTOCOLCOUNTERS structure 56 Methods PROTOCOLSTATUS structure 55 LegacyApi 133 PROTOCOLSTATUS_INFO_TYPE enumeration 27 RCMListener 127 PROTOCOLSTATUSEX structure 55 RCMPublic 120 PSESSION_CHANGE 80 msTSProperty01 attribute 92 PSESSIONENUM 28 PSESSIONENUM_EX 30 N PSESSIONENUM_LEVEL1 29 PSESSIONENUM_LEVEL2 29 NASICONFIG structure 61 PSESSIONENUM_LEVEL3 29 NETWORKCONFIG structure 58 PSESSIONID 37 Normative references 12 PSYSTEM_THREAD_INFORMATION 42 NT6_TS_UNICODE_STRING structure 42 PTHINWIRECACHE 58 PTS_ALL_PROCESSES_INFO 38 O PTS_ALL_PROCESSES_INFO_NT6 40 PTS_COUNTER 43 PTS_COUNTER_HEADER 43 OEMTDCONFIG structure 63 PTS_PROCESS_INFORMATION_NT4 38 OldRpcWinStationEnumerateProcesses method 159 PTS_SYS_PROCESS_INFORMATION 38 Overview (synopsis) 14 PTS_SYS_PROCESS_INFORMATION_NT6 40 PTS_TRACE 77 P PTSHARE_CACHE 58 PTSHARE_COUNTERS 57 Parameter index - security 190 PTSVIP_SOCKADDR 82 Parameters - security index 190 PTSVIPAddress 83 PASYNCCONFIG 59 PTSVIPSession 84 PBEEPINPUT 80 PUSERCONFIG 45 PCACHE_STATISTICS 57 PVARDATA_WIRE 81 PCDCONFIG 66 PWDCONFIG 64 PCLIENT_STACK_ADDRESS 81 PWINSTACONFIGWIRE 82 PCONNECTCONFIG 61 PWINSTATIONCLIENT 49 PDCONFIG structure 63 PWINSTATIONCLIENTDATA 80 PDCONFIG2 structure 63 PWINSTATIONCONFIG 67 PDPARAMS structure 58 PWINSTATIONCONFIG2 67 PDPARAMSWIRE structure 82 PWINSTATIONCREATE 67 Permissions - caller - overview 93 PWINSTATIONINFORMATION 54 PEXECENVDATA 31 PWINSTATIONLOADINDICATORDATA 74 PEXECENVDATA_LEVEL1 32 PWINSTATIONPRODID 76 PEXECENVDATA_LEVEL2 32 PWINSTATIONPRODUCTINFO 85 PEXECENVDATAEX 33 PWINSTATIONREMOTEADDRESS 76 PEXECENVDATAEX_LEVEL1 33 PWINSTATIONSHADOW 75 pExtendedClientCredentials 77 PWINSTATIONUSERTOKEN 73 PFLOWCONTROLCONFIG 59 PWINSTATIONVALIDATIONINFORMATION 84 PLISTENERENUM 36 PWINSTATIONVIDEODATA 74 PLISTENERENUM_LEVEL1 37 319 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 Q RpcWinStationCheckLoopBack method 170 RpcWinStationCloseServer method 139 RpcWinStationCloseServerEx method 168 QUERY_SESSION_DATA_TYPE enumeration 27 RpcWinStationConnect method 151 RpcWinStationDisconnect method 152 R RpcWinStationEnumerate method 140 RpcWinStationEnumerateProcesses method 160 RCM_REMOTEADDRESS structure 80 RpcWinStationGetAllProcesses method 162 RCMListener method 127 RpcWinStationGetAllProcesses_NT6 method 172 RCMPublic method 120 RpcWinStationGetLanAdapterName method 165 RECEIVEFLOWCONTROLCLASS enumeration 60 RpcWinStationGetMachinePolicy method 170 RECONNECT_TYPE enumeration 23 RpcWinStationGetProcessSid method 163 References 12 RpcWinStationGetTermSrvCountersValue method 164 informative 14 RpcWinStationIsHelpAssistantSession method 169 normative 12 RpcWinStationNameFromLogonId method 151 Relationship to other protocols 15 RpcWinStationOpenServer method 138 RESERVED_CACHE structure 57 RpcWinStationOpenSessionDirectory method 173 RpcCloseEnum method 112 RpcWinStationQueryInformation method 142 RpcCloseListener method 128 RpcWinStationReadRegistry method 159 RpcCloseSession method 99 RpcWinStationReInitializeSecurity method 165 RpcConnect method 99 RpcWinStationRename method 141 RpcConnectCallback method 171 RpcWinStationReset method 153 RpcDisconnect method 100 RpcWinStationSendMessage method 148 RpcEnumAddFilter method 113 RpcWinStationSetInformation method 146 RpcFilterByCallersName method 113 RpcWinStationShadow method 157 RpcFilterBySessionType method 114 RpcWinStationShadowStop method 167 RpcFilterByState method 112 RpcWinStationShutdownSystem method 154 RpcGetAllListeners method 124 RpcWinStationTerminateProcess method 161 RpcGetAllSessions method 116 RpcWinStationUpdateSettings method 166 RpcGetAllSessionsEx method 117 RpcWinStationWaitSystemEvent method 155 RpcGetClientData method 121 RpcGetConfigData method 122 S RpcGetEnumResult method 113 RpcGetEnumResultEx method 115 Schema elements - directory service 85 RpcGetLastInputTime method 123 SDCLASS enumeration 22 RpcGetLoggedOnCount method 106 Security RpcGetProtocolStatus method 122 implementer considerations 190 RpcGetRemoteAddress method 123 parameter index 190 RpcGetSessionCounters method 105 Sequencing rules RpcGetSessionIds method 115 client 130 RpcGetSessionInformation method 105 legacy 130 RpcGetSessionInformationEx method 107 local session manager 94 RpcGetSessionIP method 176 TermSrv 118 RpcGetSessionProtocolLastInputTime method 124 virtual IP 175 RpcGetSessionType method 106 server (section 3.5.4 120, section 3.7.4 133) RpcGetState method 102 legacy 133 RpcGetTerminalName method 101 local session manager 97 RpcGetTimes method 104 TermSrv 120 RpcGetUserCertificates method 125 virtual IP 175 RpcGetUserName method 101 Server RpcIcaServerPing method 139 abstract data model (section 3.3.1 94, section 3.5.1 RpcIsListening method 129 118, section 3.7.1 130) RpcIsSessionDesktopLocked method 102 initialization (section 3.3.3 97, section 3.5.3 120, RpcLogoff method 101 section 3.7.3 133) RpcLogonIdFromWinStationName method 150 legacy RpcOpenEnum method 111 abstract data model 130 RpcOpenListener method 127 initialization 133 RpcOpenSession method 98 local events 174 RpcQuerySessionData method 126 message processing 133 RpcRegisterAsyncNotification method 109 sequencing rules 133 RpcShadow2 method 177 timer events 174 RpcShowMessageBox method 103 timers 133 RpcStartListener method 129 LegacyApi method 133 RpcStopListener method 128 local events (section 3.3.6 118, section 3.5.6 130, RpcUnRegisterAsyncNotification method 110 section 3.7.6 174) RpcWaitAsyncNotification method 109 local session manager RpcWaitForSessionState method 108 abstract data model 94 RpcWinStationBreakPoint method 158 320 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 initialization 97 sequencing rules 120 local events 118 timer events 129 message processing 97 timers 120 sequencing rules 97 TermSrvBindSecure example 183 timer events 118 Termsrvbindsecure example example 183 timers 97 THINWIRECACHE structure 58 message processing (section 3.5.4 120, section 3.7.4 Timer events 133) client (section 3.2.5 94, section 3.4.5 118, section RCMListener method 127 3.6.5 130) RCMPublic method 120 legacy 130 sequencing rules (section 3.5.4 120, section 3.7.4 local session manager 94 133) TermSrv 118 TermSrv virtual IP 175 abstract data model 118 server (section 3.3.5 118, section 3.5.5 129, section initialization 120 3.7.5 174) local events 130 legacy 174 message processing 120 local session manager 118 sequencing rules 120 TermSrv 129 timer events 129 virtual IP 176 timers 120 Timers timer events (section 3.3.5 118, section 3.5.5 129, client (section 3.2.2 94, section 3.4.2 118, section section 3.7.5 174) 3.6.2 130) timers (section 3.3.2 97, section 3.5.2 120, section legacy 130 3.7.2 133) local session manager 94 virtual IP TermSrv 118 abstract data model 175 virtual IP 174 initialization 175 server (section 3.3.2 97, section 3.5.2 120, section local events 176 3.7.2 133) message processing 175 legacy 133 sequencing rules 175 local session manager 97 timer events 176 TermSrv 120 timers 175 virtual IP 175 SESSION_CHANGE structure 80 Tracking changes 242 SESSION_FILTER enumeration 27 TRANSMITFLOWCONTROLCLASS enumeration 61 SESSIONENUM structure 28 Transport 17 SESSIONENUM_EX structure 30 TS_ALL_PROCESSES_INFO structure 38 SESSIONENUM_LEVEL1 structure 29 TS_ALL_PROCESSES_INFO_NT6 structure 40 SESSIONENUM_LEVEL2 structure 29 TS_COUNTER structure 43 SESSIONENUM_LEVEL3 structure 29 TS_COUNTER_HEADER structure 43 SESSIONID structure 37 TS_PROCESS_INFORMATION_NT4 structure 38 SESSIONTYPE enumeration 25 TS_SYS_PROCESS_INFORMATION structure 38 SHADOW_CONTROL_REQUEST enumeration 25 TS_SYS_PROCESS_INFORMATION_NT6 structure 40 SHADOW_PERMISSION_REQUEST enumeration 26 TS_SYSTEMTIME structure 53 SHADOW_REQUEST_RESPONSE enumeration 26 TS_TIME_ZONE_INFORMATION structure 52 SHADOWCLASS enumeration 22 TS_TRACE structure 77 SHADOWSTATECLASS enumeration 75 TS_UNICODE_STRING structure 40 Standards assignments 16 TSHARE_CACHE structure 58 Structures 27 TSHARE_COUNTERS structure 57 SYSTEM_THREAD_INFORMATION structure 42 TSProperty packet 87 TSVIP_SOCKADDR structure 82 T TSVIPAddress structure 83 TSVIPSession structure 84 TermService listener example 181 Termservice listener example example 181 U TermSrv client abstract data model 118 USERCONFIG structure 45 initialization 118 UserParameters packet 86 local events 118 message processing 118 V sequencing rules 118 timer events 118 VARDATA_WIRE structure 81 timers 118 Vendor-extensible fields 16 TermSrv server Versioning 16 abstract data model 118 Virtual IP client initialization 120 abstract data model 174 local events 130 initialization 174 message processing 120 local events 175 321 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015 message processing 175 WINSTATIONCLIENT structure 49 sequencing rules 175 WINSTATIONCLIENTDATA structure 80 timer events 175 WINSTATIONCONFIG structure 67 timers 174 WINSTATIONCONFIG2 structure 67 Virtual IP server WINSTATIONCREATE structure 67 abstract data model 175 WINSTATIONINFOCLASS enumeration 19 initialization 175 WINSTATIONINFORMATION structure 54 local events 176 WINSTATIONLOADINDICATORDATA structure 74 message processing 175 WINSTATIONPRODID structure 76 sequencing rules 175 WINSTATIONPRODUCTINFO structure 85 timer events 176 WINSTATIONREMOTEADDRESS structure 76 timers 175 WINSTATIONSHADOW structure 75 WINSTATIONSTATECLASS enumeration 21 W WINSTATIONUSERTOKEN structure 73 WINSTATIONVALIDATIONINFORMATION structure 84 WINSTATIONVIDEODATA structure 74 WDCONFIG structure 64 WINSTACONFIGWIRE structure 82 322 / 322 [MS-TSTS] - v20151016 Terminal Services Terminal Server Runtime Interface Protocol Copyright © 2015 Microsoft Corporation Release: October 16, 2015