MS Rdpesc
MS Rdpesc
Tools. The Open Specifications documentation does 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 documents are intended for use in conjunction with publicly available standards
specifications and network programming art and, as such, assume that the reader either is familiar
with the aforementioned material or has immediate access to it.
1 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
Revision Summary
Revision Revision
Date History Class Comments
7/3/2007 1.0.1 Editorial Changed language and formatting in the technical content.
7/20/2007 1.0.2 Editorial Changed language and formatting in the technical content.
8/10/2007 1.0.3 Editorial Changed language and formatting in the technical content.
9/28/2007 1.0.4 Editorial Changed language and formatting in the technical content.
10/23/2007 1.0.5 Editorial Changed language and formatting in the technical content.
1/25/2008 2.0.1 Editorial Changed language and formatting in the technical content.
3/14/2008 2.0.2 Editorial Changed language and formatting in the technical content.
5/16/2008 2.0.3 Editorial Changed language and formatting in the technical content.
6/20/2008 2.0.4 Editorial Changed language and formatting in the technical content.
7/25/2008 2.0.5 Editorial Changed language and formatting in the technical content.
8/29/2008 2.0.6 Editorial Changed language and formatting in the technical content.
10/24/2008 2.0.7 Editorial Changed language and formatting in the technical content.
1/16/2009 3.0.1 Editorial Changed language and formatting in the technical content.
2/27/2009 3.0.2 Editorial Changed language and formatting in the technical content.
4/10/2009 3.0.3 Editorial Changed language and formatting in the technical content.
7/2/2009 4.0.1 Editorial Changed language and formatting in the technical content.
8/14/2009 4.0.2 Editorial Changed language and formatting in the technical content.
11/6/2009 4.1.1 Editorial Changed language and formatting in the technical content.
2 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
Revision Revision
Date History Class Comments
technical content.
7/14/2016 11.0.1 Editorial Changed language and formatting in the technical content.
3 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
Revision Revision
Date History Class Comments
technical content.
4 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
Table of Contents
1 Introduction .......................................................................................................... 10
1.1 Glossary ......................................................................................................... 10
1.2 References ...................................................................................................... 12
1.2.1 Normative References ................................................................................. 12
1.2.2 Informative References ............................................................................... 13
1.3 Overview ........................................................................................................ 13
1.4 Relationship to Other Protocols .......................................................................... 15
1.5 Prerequisites/Preconditions ............................................................................... 15
1.6 Applicability Statement ..................................................................................... 16
1.7 Versioning and Capability Negotiation ................................................................. 16
1.8 Vendor-Extensible Fields ................................................................................... 16
1.9 Standards Assignments..................................................................................... 16
2 Messages ............................................................................................................... 18
2.1 Transport ........................................................................................................ 18
2.2 Common Data Types ........................................................................................ 18
2.2.1 Common Structures .................................................................................... 18
[Link] REDIR_SCARDCONTEXT......................................................................... 18
[Link] REDIR_SCARDHANDLE .......................................................................... 18
[Link] Connect_Common ................................................................................. 19
[Link] LocateCards_ATRMask ........................................................................... 19
[Link] ReaderState_Common_Call .................................................................... 19
[Link] ReaderStateA ....................................................................................... 20
[Link] ReaderStateW ...................................................................................... 20
[Link] SCardIO_Request ................................................................................. 20
[Link] ReadCache_Common............................................................................. 21
[Link] WriteCache_Common ............................................................................ 21
[Link] ReaderState_Return .............................................................................. 21
2.2.2 TS Server-Generated Structures ................................................................... 22
[Link] EstablishContext_Call ............................................................................ 22
[Link] Context_Call......................................................................................... 22
[Link] ListReaderGroups_Call ........................................................................... 23
[Link] ListReaders_Call ................................................................................... 23
[Link] ContextAndStringA_Call ......................................................................... 24
[Link] ContextAndStringW_Call ........................................................................ 24
[Link] ContextAndTwoStringA_Call ................................................................... 25
[Link] ContextAndTwoStringW_Call .................................................................. 26
[Link] LocateCardsA_Call ................................................................................ 26
[Link] LocateCardsW_Call................................................................................ 27
[Link] GetStatusChangeA_Call ......................................................................... 27
[Link] GetStatusChangeW_Call ........................................................................ 28
[Link] ConnectA_Call ...................................................................................... 28
[Link] ConnectW_Call ..................................................................................... 28
[Link] Reconnect_Call ..................................................................................... 28
[Link] HCardAndDisposition_Call ...................................................................... 29
[Link] State_Call ............................................................................................ 30
[Link] Status_Call .......................................................................................... 30
[Link] Transmit_Call ....................................................................................... 31
[Link] Control_Call ......................................................................................... 32
[Link] GetAttrib_Call ....................................................................................... 32
[Link] SetAttrib_Call ....................................................................................... 33
[Link] LocateCardsByATRA_Call ....................................................................... 33
[Link] LocateCardsByATRW_Call ...................................................................... 34
[Link] ReadCacheA_Call .................................................................................. 34
[Link] ReadCacheW_Call ................................................................................. 34
5 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
[Link] WriteCacheA_Call .................................................................................. 35
[Link] WriteCacheW_Call ................................................................................. 35
[Link] GetTransmitCount_Call .......................................................................... 35
[Link] ScardAccessStartedEvent_Call ................................................................ 35
[Link] GetReaderIcon_Call ............................................................................... 36
[Link] GetDeviceTypeId_Call............................................................................ 36
2.2.3 TS Client-Generated Structures .................................................................... 36
[Link] ReadCache_Return ................................................................................ 36
[Link] EstablishContext_Return ........................................................................ 37
[Link] Long_Return ........................................................................................ 37
[Link] ListReaderGroups_Return and ListReaders_Return .................................... 37
[Link] LocateCards_Return and GetStatusChange_Return ................................... 38
[Link] Control_Return ..................................................................................... 38
[Link] Reconnect_Return ................................................................................. 38
[Link] Connect_Return .................................................................................... 39
[Link] State_Return ........................................................................................ 39
[Link] Status_Return ...................................................................................... 39
[Link] Transmit_Return ................................................................................... 40
[Link] GetAttrib_Return .................................................................................. 41
[Link] GetTransmitCount_Return ...................................................................... 41
[Link] GetReaderIcon_Return .......................................................................... 41
[Link] GetDeviceTypeId_Return ....................................................................... 42
2.2.4 Card/Reader State ...................................................................................... 42
2.2.5 Protocol Identifier ....................................................................................... 42
2.2.6 Access Mode Flags ...................................................................................... 43
2.2.7 Reader State .............................................................................................. 44
2.2.8 Return Code ............................................................................................... 45
3 Protocol Details ..................................................................................................... 50
3.1 Protocol Server Details ..................................................................................... 50
3.1.1 Abstract Data Model .................................................................................... 50
3.1.2 Timers ...................................................................................................... 50
3.1.3 Initialization ............................................................................................... 50
3.1.4 Message Processing Events and Sequencing Rules .......................................... 50
[Link] SCARD_IOCTL_ESTABLISHCONTEXT (IOCTL 0x00090014) ......................... 54
[Link] SCARD_IOCTL_RELEASECONTEXT (IOCTL 0x00090018) ............................ 54
[Link] SCARD_IOCTL_ISVALIDCONTEXT (IOCTL 0x0009001C) ............................. 54
[Link] SCARD_IOCTL_ACCESSSTARTEDEVENT (IOCTL 0x000900E0) .................... 54
[Link] SCARD_IOCTL_LISTREADERGROUPSA (IOCTL 0x00090020) ...................... 55
[Link] SCARD_IOCTL_LISTREADERGROUPSW (IOCTL 0x00090024) ..................... 55
[Link] SCARD_IOCTL_LISTREADERSA (IOCTL 0x00090028) ................................ 55
[Link] SCARD_IOCTL_LISTREADERSW (IOCTL 0x0009002C) ............................... 55
[Link] SCARD_IOCTL_INTRODUCEREADERGROUPA (IOCTL 0x00090050) .............. 55
[Link] SCARD_IOCTL_INTRODUCEREADERGROUPW (IOCTL 0x00090054) ............. 56
[Link] SCARD_IOCTL_FORGETREADERGROUPA (IOCTL 0x00090058) ................... 56
[Link] SCARD_IOCTL_FORGETREADERGROUPW (IOCTL 0x0009005C) .................. 56
[Link] SCARD_IOCTL_INTRODUCEREADERA (IOCTL 0x00090060) ........................ 56
[Link] SCARD_IOCTL_INTRODUCEREADERW (IOCTL 0x00090064) ....................... 56
[Link] SCARD_IOCTL_FORGETREADERA (IOCTL 0x00090068) ............................. 56
[Link] SCARD_IOCTL_FORGETREADERW (IOCTL 0x0009006C) ............................ 57
[Link] SCARD_IOCTL_ADDREADERTOGROUPA (IOCTL 0x00090070) .................... 57
[Link] SCARD_IOCTL_ADDREADERTOGROUPW (IOCTL 0x00090074) .................... 57
[Link] SCARD_IOCTL_REMOVEREADERFROMGROUPA (IOCTL 0x00090078) ........... 57
[Link] SCARD_IOCTL_REMOVEREADERFROMGROUPW (IOCTL 0x0009007C) .......... 57
[Link] SCARD_IOCTL_LOCATECARDSA (IOCTL 0x00090098) ............................... 57
[Link] SCARD_IOCTL_LOCATECARDSW (IOCTL 0x0009009C) .............................. 58
[Link] SCARD_IOCTL_GETSTATUSCHANGEA (IOCTL 0x000900A0) ....................... 58
[Link] SCARD_IOCTL_GETSTATUSCHANGEW (IOCTL 0x000900A4) ...................... 58
6 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
[Link] SCARD_IOCTL_LOCATECARDSBYATRA (IOCTL 0x000900E8) ...................... 58
[Link] SCARD_IOCTL_LOCATECARDSBYATRW (IOCTL 0x000900EC) ..................... 58
[Link] SCARD_IOCTL_CANCEL (IOCTL 0x000900A8)........................................... 59
[Link] SCARD_IOCTL_CONNECTA (IOCTL 0x000900AC) ...................................... 59
[Link] SCARD_IOCTL_CONNECTW (IOCTL 0x000900B0) ..................................... 59
[Link] SCARD_IOCTL_DISCONNECT (IOCTL 0x000900B8) ................................... 59
[Link] SCARD_IOCTL_BEGINTRANSACTION (IOCTL 0x000900BC) ........................ 59
[Link] SCARD_IOCTL_ENDTRANSACTION (IOCTL 0x000900C0) ........................... 59
[Link] SCARD_IOCTL_STATUSA (IOCTL 0x000900C8) ......................................... 60
[Link] SCARD_IOCTL_STATUSW (IOCTL 0x000900CC) ........................................ 60
[Link] SCARD_IOCTL_TRANSMIT (IOCTL 0x000900D0) ....................................... 60
[Link] SCARD_IOCTL_RECONNECT (IOCTL 0x000900B4) .................................... 60
[Link] SCARD_IOCTL_CONTROL (IOCTL 0x000900D4) ........................................ 60
[Link] SCARD_IOCTL_GETATTRIB (IOCTL 0x000900D8)...................................... 60
[Link] SCARD_IOCTL_SETATTRIB (IOCTL 0x000900DC)...................................... 61
[Link] SCARD_IOCTL_STATE (IOCTL 0x000900C4) ............................................. 61
[Link] SCARD_IOCTL_GETTRANSMITCOUNT (IOCTL 0x00090100)........................ 61
[Link] SCARD_IOCTL_READCACHEA (IOCTL 0x000900F0) ................................... 61
[Link] SCARD_IOCTL_READCACHEW (IOCTL 0x000900F4) .................................. 61
[Link] SCARD_IOCTL_WRITECACHEA (IOCTL 0x000900F8) ................................. 62
[Link] SCARD_IOCTL_WRITECACHEW (IOCTL 0x000900FC) ................................ 62
[Link] SCARD_IOCTL_RELEASETARTEDEVENT.................................................... 62
[Link] SCARD_IOCTL_GETREADERICON (IOCTL 0x00090104) ............................. 62
[Link] SCARD_IOCTL_GETDEVICETYPEID (IOCTL 0x00090108) ........................... 62
3.1.5 Timer Events .............................................................................................. 62
3.1.6 Other Local Events ...................................................................................... 62
3.2 Protocol Client Details ....................................................................................... 63
3.2.1 Abstract Data Model .................................................................................... 63
3.2.2 Timers ...................................................................................................... 63
3.2.3 Initialization ............................................................................................... 63
3.2.4 Higher-Layer Triggered Events ..................................................................... 63
3.2.5 Message Processing Events and Sequencing Rules .......................................... 63
[Link] Sending Outgoing Messages ................................................................... 63
[Link] Processing Incoming Replies ................................................................... 63
[Link] Messages ............................................................................................. 64
[Link].1 Sending EstablishContext Message .................................................... 64
[Link].2 Processing EstablishContext Reply ..................................................... 64
[Link].3 Sending ReleaseContext Message ...................................................... 64
[Link].4 Processing ReleaseContext Reply ....................................................... 64
[Link].5 Sending IntroduceReader (ASCII) Message ......................................... 64
[Link].6 Processing IntroduceReader (ASCII) Reply ......................................... 64
[Link].7 Sending IntroduceReader (Unicode) Message ...................................... 64
[Link].8 Processing IntroduceReader (Unicode) Reply ...................................... 64
[Link].9 Sending ForgetReader (ASCII) Message ............................................. 64
[Link].10 Processing ForgetReader (ASCII) Reply .............................................. 64
[Link].11 Sending ForgetReader (Unicode) Message .......................................... 65
[Link].12 Processing ForgetReader (Unicode) Reply ........................................... 65
[Link].13 Sending IntroduceReaderGroup (ASCII) Message ................................ 65
[Link].14 Processing IntroduceReaderGroup (ASCII) Reply ................................. 65
[Link].15 Sending IntroduceReaderGroup (Unicode) Message ............................. 65
[Link].16 Processing IntroduceReaderGroup (Unicode) Reply .............................. 65
[Link].17 Sending ForgetReaderGroup (ASCII) Message 1 .................................. 65
[Link].18 Processing ForgetReaderGroup (ASCII) Reply ..................................... 65
[Link].19 Sending ForgetReaderGroup (ASCII) Message 2 .................................. 65
[Link].20 Processing ForgetReaderGroup (Unicode) Reply .................................. 65
[Link].21 Sending AddReaderToGroup (ASCII) Message ..................................... 65
[Link].22 Processing AddReaderToGroup (ASCII) Reply ...................................... 66
[Link].23 Sending AddReaderToGroup (Unicode) Message .................................. 66
7 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
[Link].24 Processing AddReaderToGroup (Unicode) Reply................................... 66
[Link].25 Sending RemoveReaderFromGroup (ASCII) Message ........................... 66
[Link].26 Processing RemoveReaderFromGroup (ASCII) Reply ............................ 66
[Link].27 Sending RemoveReaderFromGroup (Unicode) Message ........................ 66
[Link].28 Processing RemoveReaderFromGroup (Unicode) Reply ......................... 66
[Link].29 Sending ListReaderGroups (ASCII) Message ....................................... 66
[Link].30 Processing ListReaderGroups (ASCII) Reply ........................................ 66
[Link].31 Sending ListReaderGroups (Unicode) Message .................................... 66
[Link].32 Processing ListReaderGroups (Unicode) Reply ..................................... 66
[Link].33 Sending ListReaders (ASCII) Message ................................................ 67
[Link].34 Processing ListReadersReply (ASCII) Reply ......................................... 67
[Link].35 Sending ListReaders (Unicode) Message ............................................. 67
[Link].36 Processing ListReadersReply (Unicode) Reply ...................................... 67
[Link].37 Sending LocateCards (ASCII) Message ............................................... 67
[Link].38 Processing LocateCards (ASCII) Reply ................................................ 67
[Link].39 Sending LocateCards (Unicode) Message ............................................ 67
[Link].40 Processing LocateCards (Unicode) Reply ............................................. 67
[Link].41 Sending GetStatusChange (ASCII) Message ........................................ 67
[Link].42 Processing GetStatusChange (ASCII) Reply ........................................ 67
[Link].43 Sending GetStatusChange (Unicode) Message ..................................... 67
[Link].44 Processing GetStatusChange (Unicode) Reply ..................................... 68
[Link].45 Sending Cancel Message .................................................................. 68
[Link].46 Processing Cancel Reply ................................................................... 68
[Link].47 Sending Connect (ASCII) Message ..................................................... 68
[Link].48 Processing Connect (ASCII) Reply ..................................................... 68
[Link].49 Sending Connect (Unicode) Message .................................................. 68
[Link].50 Processing Connect (Unicode) Reply .................................................. 68
[Link].51 Sending Reconnect Message ............................................................. 68
[Link].52 Processing Reconnect Reply .............................................................. 68
[Link].53 Sending Disconnect Message ............................................................ 68
[Link].54 Processing Disconnect Reply ............................................................. 68
[Link].55 Sending Status (ASCII) Message ....................................................... 69
[Link].56 Processing Status (ASCII) Reply ........................................................ 69
[Link].57 Sending Status (Unicode) Message .................................................... 69
[Link].58 Processing Status (Unicode) Reply ..................................................... 69
[Link].59 Sending State Message .................................................................... 69
[Link].60 Processing State Message Reply ........................................................ 69
[Link].61 Sending BeginTransaction Message.................................................... 69
[Link].62 Processing BeginTransaction Reply .................................................... 69
[Link].63 Sending EndTransaction Message ...................................................... 69
[Link].64 Processing EndTransaction Reply ....................................................... 69
[Link].65 Sending Transmit Message ............................................................... 69
[Link].66 Processing Transmit Reply ................................................................ 70
[Link].67 Sending Control Message ................................................................. 70
[Link].68 Processing Control Reply .................................................................. 70
[Link].69 Sending GetReaderCapabilities Message ............................................. 70
[Link].70 Processing GetReaderCapabilities Reply.............................................. 70
[Link].71 Sending SetReaderCapabilities Message ............................................. 70
[Link].72 Processing SetReaderCapabilities Reply .............................................. 70
[Link].73 Sending WaitForResourceManager Message ........................................ 70
[Link].74 Processing WaitForResourceManager Reply ......................................... 70
[Link].75 Sending LocateCardsByATR (ASCII) Message ...................................... 70
[Link].76 Processing LocateCardsByATR (Unicode) Reply.................................... 70
[Link].77 Processing LocateCardsByATR (ASCII) Reply....................................... 70
[Link].78 Sending LocateCardsByATR (Unicode) Message ................................... 71
[Link].79 Sending ReadCache (ASCII) Message................................................. 71
[Link].80 Processing ReadCache (ASCII) Reply ................................................. 71
[Link].81 Sending ReadCache (Unicode) Message.............................................. 71
8 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
[Link].82 Processing ReadCache (Unicode) Reply .............................................. 71
[Link].83 Sending WriteCache (ASCII) Message ................................................ 71
[Link].84 Processing WriteCache (ASCII) Reply ................................................. 71
[Link].85 Sending WriteCache (Unicode) Message ............................................. 71
[Link].86 Processing WriteCache (Unicode) Reply .............................................. 71
[Link].87 Sending GetTransmitCount Message .................................................. 71
[Link].88 Processing GetTransmitCount Reply ................................................... 71
[Link].89 Sending GetReaderIcon Message ....................................................... 72
[Link].90 Processing GetReaderIcon Reply ....................................................... 72
[Link].91 Sending GetDeviceTypeId Message .................................................... 72
[Link].92 Processing GetDeviceTypeId Reply .................................................... 72
3.2.6 Timer Events .............................................................................................. 72
3.2.7 Other Local Events ...................................................................................... 72
4 Protocol Examples ................................................................................................. 73
4.1 Establish Context Call ....................................................................................... 74
4.2 Establish Context Return ................................................................................... 74
4.3 List Readers Call .............................................................................................. 74
4.4 List Readers Return .......................................................................................... 74
4.5 Get Status Change Call ..................................................................................... 74
4.6 Get Status Change Return ................................................................................. 75
4.7 Connect Call .................................................................................................... 75
4.8 Connect Return ................................................................................................ 75
4.9 Begin Transaction Call ...................................................................................... 75
4.10 Begin Transaction Return .................................................................................. 76
4.11 Status Call ...................................................................................................... 76
4.12 Status Return .................................................................................................. 76
4.13 End Transaction Call ......................................................................................... 76
4.14 End Transaction Return ..................................................................................... 76
4.15 Disconnect Call ................................................................................................ 77
4.16 Disconnect Return ............................................................................................ 77
4.17 Release Context Call ......................................................................................... 77
4.18 Release Context Return .................................................................................... 77
5 Security ................................................................................................................. 78
5.1 Security Considerations for Implementers ........................................................... 78
5.2 Index of Security Parameters ............................................................................ 78
6 Appendix A: Full IDL .............................................................................................. 79
7 Appendix B: Product Behavior ............................................................................... 86
8 Change Tracking .................................................................................................... 87
9 Index ..................................................................................................................... 88
9 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
1 Introduction
This document specifies an extension (including virtual channels) to the Remote Desktop Protocol:
File System Virtual Channel Extension for supporting smart card reader-like devices.
Sections 1.5, 1.8, 1.9, 2, and 3 of this specification are normative. All other sections and examples in
this specification are informative.
1.1 Glossary
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.
build number: A part of a sequential numbering system that is used to differentiate one version of
a software product from another.
call packet: A combination of I/O control (IOCTL) and a data structure request from a protocol
client that corresponds to that IOCTL.
card type: A string that specifies a specific type of smart card that is recognized by Smart Cards
for Windows.
device: Any peripheral or part of a computer system that can send or receive data.
HRESULT: An integer value that indicates the result or status of an operation. A particular
HRESULT can have different meanings depending on the protocol using it. See [MS-ERREF]
section 2.1 and specific protocol documents for further details.
I/O control (IOCTL): A command that is issued to a target file system or target device in order
to query or alter the behavior of the target; or to query or alter the data and attributes that are
associated with the target or the objects that are exposed by the target.
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.
Microsoft Terminal Services (TS): A component that allows a user to access applications or data
stored on a remote computer over a network connection.
operating system version: A uniquely identifiable numbered string that is used to identify a
particular operating system.
10 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
protocol server: An endpoint that processes the call packet from a protocol client.
reader group name: The friendly, human-readable name for a reader group.
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 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 communication protocol used primarily between client and
server. The term has three definitions that are often used interchangeably: a runtime
environment providing for communication facilities between computers (the RPC runtime); a set
of request-and-response message exchanges between computers (the RPC exchange); and the
single message from an RPC exchange (the RPC message). For more information, see [C706].
return packet: An encoded structure containing the result of a call packet operation executed on
the protocol client.
smart card: A portable device that is shaped like a business card and is embedded with a memory
chip and either a microprocessor or some non-programmable logic. Smart cards are often used
as authentication tokens and for secure key storage. Smart cards used for secure key storage
have the ability to perform cryptographic operations with the stored key without allowing the
key itself to be read or otherwise extracted from the card.
smart card reader: A device used as a communication medium between the smart card and a
Host; for example, a computer. Also referred to as a Reader.
smart card reader name: The friendly, human-readable name of the smart card reader. Also
referred to as a Reader Name.
Smart Cards for Windows: An implementation of the ICC Resource Manager according to
[PCSC5].
static virtual channel: A static transport used for lossless communication between a client
component and a server component over a main data connection, as specified in [MS-
RDPBCGR].
TS server: A Microsoft Terminal Services program that responds to a request from a TS client.
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).
Unicode string: A Unicode 8-bit string is an ordered sequence of 8-bit units, a Unicode 16-bit
string is an ordered sequence of 16-bit code units, and a Unicode 32-bit string is an ordered
sequence of 32-bit code units. In some cases, it could be acceptable not to terminate with a
terminating null character. Unless otherwise specified, all Unicode strings follow the UTF-16LE
encoding scheme with no Byte Order Mark (BOM).
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
11 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
this term does not imply or require that the algorithms described in [RFC4122] or [C706] must
be used for generating the UUID.
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.
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 dochelp@[Link]. We will
assist you in finding the relevant information.
[C706] The Open Group, "DCE 1.1: Remote Procedure Call", C706, August 1997,
[Link]
[MS-DCOM] Microsoft Corporation, "Distributed Component Object Model (DCOM) Remote Protocol".
[MS-RDPBCGR] Microsoft Corporation, "Remote Desktop Protocol: Basic Connectivity and Graphics
Remoting".
[MS-RDPEFS] Microsoft Corporation, "Remote Desktop Protocol: File System Virtual Channel
Extension".
[PCSC3] PC/SC Workgroup, "Interoperability Specification for ICCs and Personal Computer Systems -
Part 3: Requirements for PC-Connected Interface Devices", June 2007,
[Link]
12 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
[PCSC5] PC/SC Workgroup, "Interoperability Specification for ICCs and Personal Computer Systems -
Part 5: ICC Resource Manager Definition", September 2005,
[Link]
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC
2119, March 1997, [Link]
None.
1.3 Overview
The following figure illustrates a baseline for terminology related to clients and servers.
Remote Desktop Protocol (RDP) Device Redirection enables client devices (for example, printers,
smart card readers, drives, audio, serial ports, and parallel ports) to be available to server-side
applications, within the context of a single RDP session. This protocol is specified in [MS-RDPEFS].
Smart Card Redirection redirects the TS client–side Smart Cards for Windows. When Smart Card
Redirection is in effect, TS server application smart card subsystem calls (for example,
EstablishContext) are automatically remapped to the TS client–side Smart Cards for Windows, which
will then receive the corresponding request. Smart Card Redirection devices are only required to
understand one type of device I/O request.
The following figure shows a high-level sequence diagram of the protocol for redirected calls. Device
Announce and Device Disconnect are handled via the lower-layer protocols.
13 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
Figure 2: High-level protocol sequence
The following figure specifies how the messages are encoded and routed from a TS client to a TS
server. The following numbered list details corresponding actions related to the pictured protocol flow.
14 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
The input for this protocol (call packet) is a combination of an I/O control (IOCTL) and the
corresponding structure as specified in section 3.2.5.
3. The encoded value from 2 is combined with the IOCTL and transported over RDP Device
Redirection, as specified in [MS-RDPEFS] section 2.
4. On the TS client, Remote Desktop Protocol: File System Virtual Channel Extension will route the
packet from 3 to protocol server for the Smart Card Redirection, as specified in [MS-RDPEFS]
section 2.
5. After Smart Card Redirection receives the message, the encoded structure is decoded, as specified
in [MS-RPCE] section 2.2.6.
7. Based on the IOCTL, the structure members are used as input parameters to the Smart Cards for
Windows, as specified in [PCSC5] section 3.
8. The output parameters including the return code are packaged into the return packet structure for
this IOCTL.
11. The encoded value from 10 is sent to RDP Device Redirection (as specified in [MS-RDPEFS]) as a
reply to the call packet from 4.
12. RDP Device Redirection (as specified in [MS-RDPEFS]) routes the reply back to the protocol client.
13. On receipt of packet from 12, the encoded structure is decoded as specified by to [MS-RPCE]
section 2.2.6.
The output from the Smart Card Redirection is the return packet. This data will then be processed by
higher layers.
This protocol extension expands Remote Desktop Protocol: File System Virtual Channel Extension [MS-
RDPEFS] functionality to provide support for Smart Cards for Windows.
This protocol relies on the Distributed Component Object Model (DCOM) Remote Protocol [MS-DCOM],
which uses remote procedure call (RPC) as its transport.
This protocol uses the Remote Procedure Call Protocol Extensions ([MS-RPCE] section 2) to encode
packet structures carried within an RDP session.
1.5 Prerequisites/Preconditions
RDP Device Redirection transport (as specified in [MS-RDPEFS] section [Link].5) must be configured
to redirect smart card devices.
15 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
1.6 Applicability Statement
This specification applies to redirecting Smart Cards for Windows API-based calls for a Terminal
Services client, as specified in [PCSC5] section 3.
Protocol Versions: Smart Card Redirection supports the dialects SCREDIR_VERSION_XP (1),
SCREDIR_VERSION_LONGHORN (2), and SCREDIR_VERSION_WINDOWS_8 (3).
Capability Negotiation: The Smart Card Redirection protocol does not support negotiation of the
dialect to use. Instead, an implementation is configured with the dialect to use.
The TS server determines the dialect to use by analyzing the client build number on device
announce as specified in [MS-RDPBCGR] section [Link].2 using the following mapping.<1>
This protocol uses HRESULTs as defined in [MS-ERREF] section 2.1. Vendors can define their own
HRESULT values, provided that they set the C bit (0x20000000) for each vendor-defined value,
indicating that the value is a customer code.
This protocol uses Win32 error codes. These values are taken from the Windows error number space,
as specified in [MS-ERREF] section 2.2. Vendors SHOULD reuse those values with their indicated
meaning. Choosing any other value runs the risk of a collision in the future.
This protocol uses NTSTATUS values as specified in [MS-ERREF] section 2.3. Vendors are free to
choose their own values for this field, provided that they set the C bit (0x20000000) for each vendor-
defined value, indicating it is a that customer code.
IOCTL fields used in this specification are extensible. Vendors MUST implement the corresponding
functions.
This protocol uses the following RPC UUID for the type_scard_pack interface.
16 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
17 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
2 Messages
The following sections specify how Remote Desktop Protocol: Smart Card Virtual Channel Extension
messages are transported, and common data types.
2.1 Transport
All messages MUST be transported over established RDP Device Extensions (as specified in [MS-
RDPEFS] section 2.1). This protocol uses the device enumerate and announcement messages, as
specified in [MS-RDPEFS] section 3.
Remote Desktop Protocol: File System Virtual Channel Extension is responsible for providing a unique
Device ID as defined in [MS-RDPEFS] section 3.1.1.
All structures in this section MUST be encoded as specified in [MS-RPCE] section 2. Unless otherwise
stated, the structure MUST be initialized to zero before use.
The structures defined in the following sections are common among both TS server-generated
structures (for more information, see section 2.2.2) and TS client-generated structures (for more
information, see section 2.2.3).
[Link] REDIR_SCARDCONTEXT
pbContext: An array of cbContext bytes that contains Smart Cards for Windows context. The data
is implementation-specific and MUST NOT be interpreted or changed on the Protocol server.
[Link] REDIR_SCARDHANDLE
REDIR_SCARDHANDLE represents a smart card reader handle associated with Smart Cards for
Windows context.
18 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
pbHandle: An array of cbHandle bytes that corresponds to a smart card reader handle on the TS
client. The data is implementation-specific and MUST NOT be interpreted or changed on the
Protocol server.
[Link] Connect_Common
The Connect_Common structure contains information common to both versions of the Connect
function (for more information, see sections [Link] and [Link]).
dwShareMode: A flag that indicates whether other applications are allowed to form connections to
the card. Possible values of this field are specified in section 2.2.6.
[Link] LocateCards_ATRMask
cbAtr: The number of bytes used in the rgbAtr and rgbMask fields.
rgbAtr: Values for the card's Answer To Reset (ATR) string. This value MUST be formatted as
specified in [ISO/IEC-7816-3] section 8. Unused bytes MUST be set to 0 and MUST be ignored.
rgbMask: Values for the mask for the card's ATR string. Each bit that cannot vary between cards of
the same type MUST be set to 1. Unused bytes MUST be set to 0 and MUST be ignored.
[Link] ReaderState_Common_Call
The ReaderState_Common_Call structure contains the state of the reader at the time of the call as
seen by the caller.
dwCurrentState: A bitmap that specifies the current reader state according to the TS client.
Possible values are specified in section 2.2.7.
19 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
dwEventState: A bitmap that defines the state of the reader after a state change. Possible values
are specified in section 2.2.7.
rgbAtr: The value for the card's ATR string. If cbAtr is NOT zero, this value MUST be formatted in
accordance to [ISO/IEC-7816-3] section 8. Unused bytes MUST be set to 0 and MUST be ignored.
[Link] ReaderStateA
The ReaderStateA structure contains information used in calls that only require Smart Cards for
Windows context and an ASCII string.
Common: A packet that specifies the state of the reader at the time of the call. For information
about this packet, see section [Link].
[Link] ReaderStateW
The ReaderStateW structure is a Unicode representation of the state of a smart card reader.
Common: A packet that specifies the state of the reader at the time of the call. For information
about this packet, see section [Link].
[Link] SCardIO_Request
The SCardIO_Request structure represents the data to be prepended to a Transmit command (for
more information, see section [Link]).
dwProtocol: The protocol in use. Possible values are specified in section 2.2.5.
20 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
[Link] ReadCache_Common
The ReadCache_Common structure contains information common to both the ReadCacheA_Call and
ReadCacheW_Call structures.
CardIdentifier: A UUID that specifies the name of the smart card with which the name-value pair
is associated.
fPbDataIsNULL: A Boolean value specifying whether the caller wants to retrieve the length of the
data. It MUST be set to TRUE (0x00000001) if the caller wants only to retrieve the length of the
data; otherwise, it MUST be set to FALSE (0x00000000).
cbDataLen: The length of the buffer specified on the server side. If cbDataLen is set to
SCARD_AUTOALLOCATE with a value of 0xFFFFFFFF, a buffer of any length can be returned.
Otherwise, the returned buffer MUST NOT exceed cbDataLen bytes. This field MUST be ignored if
fPbDataIsNULL is set to TRUE (0x00000001).
[Link] WriteCache_Common
The WriteCache_Common structure contains information common between the WriteCacheA_Call and
WriteCacheW_Call structures.
CardIdentifier: A UUID that identifies the smart card with which the data SHOULD be stored.
CardIdentifier MUST be a unique value per the smart card.
[Link] ReaderState_Return
The ReaderState_Return structure specifies state information returned from Smart Cards for
Windows.
21 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
typedef struct _ReaderState_Return {
unsigned long dwCurrentState;
unsigned long dwEventState;
[range(0,36)] unsigned long cbAtr;
byte rgbAtr[36];
} ReaderState_Return;
dwCurrentState: A bitmap that defines the current state of the reader at the time of the call.
Possible values are specified in section 2.2.7.
dwEventState: A bitmap that defines the state of the reader after a state change as seen by Smart
Cards for Windows. Possible values are specified in section 2.2.7.
rgbAtr: The values for the card's ATR string. Unused bytes MUST be set to zero and MUST be
ignored on receipt.
All structures in this section are sent from the TS server to the TS client.
[Link] EstablishContext_Call
The EstablishContext_Call structure is used to specify the scope of Smart Cards for Windows
context to be created (for more information, see section [Link]).
dwScope: The scope of the context that will be established. The following table shows valid values of
this field.
Value Meaning
SCARD_SCOPE_USER The context is a user context; any database operations MUST be performed
0x00000000 with the domain of the user.
SCARD_SCOPE_SYSTEM The context is the system context; any database operations MUST be
0x00000002 performed within the domain of the system.
[Link] Context_Call
22 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
Context: A valid context, as specified in section [Link].
[Link] ListReaderGroups_Call
The ListReaderGroups_Call structure contains the parameters for the List Readers Groups call (for
more information, see sections [Link] and [Link]).
fmszGroupsIsNULL: A Boolean value specifying whether the caller wants to retrieve just the length
of the data. Set to FALSE (0x00000000) in order to allow the data to be returned. Set to TRUE
(0x00000001) and only the length of the data will be returned.
cchGroups: The length of the string buffer specified by the caller. If cchGroups is set to
SCARD_AUTOALLOCATE with a value of 0xFFFFFFFF, a string of any length can be returned.
Otherwise, the returned string MUST NOT exceed cchGroups characters in length, including any
null characters. When the string to be returned exceeds cchGroups characters in length, including
any null characters, ListReaderGroups_Return.ReturnCode MUST be set to
SCARD_E_INSUFFICIENT_BUFFER (0x80100008). The cchGroups field MUST be ignored if
fmszGroupsIsNULL is set to TRUE (0x00000001). Also, if fmszGroupsIsNULL is set to FALSE
(0x00000000) but cchGroups is set to 0x00000000, then the call MUST succeed,
ListReaderGroups_Return.cBytes MUST be set to the length of the data, in bytes, and
ListReaderGroups_Return.msz MUST be set to NULL.
[Link] ListReaders_Call
The ListReaders_Call structure contains the parameters for the List Readers call (for more information,
see sections [Link] and [Link]).
mszGroups: The names of the reader groups defined in the system. Reader groups not present on
the protocol server MUST be ignored. The value of this is dependent on the context (IOCTL)
that it is used.
Value Meaning
23 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
Value Meaning
0x0009002C
fmszReadersIsNULL: A Boolean value specifying whether the caller wants to retrieve the length of
the data. Set to FALSE (0x00000000) to allow the data to be returned. Set to TRUE
(0x00000001), and only the length of the data will be returned.
cchReaders: The length of the string buffer specified by the caller. If cchReaders is set to
SCARD_AUTOALLOCATE with a value of 0xFFFFFFFF, a string of any length can be returned.
Otherwise, the returned string MUST NOT exceed cchReaders characters in length, including any
NULL characters. When the string to be returned exceeds cchReaders characters in length,
including any null characters, ListReaders_Return.ReturnCode MUST be set to
SCARD_E_INSUFFICIENT_BUFFER (0x80100008). The cchReaders field MUST be ignored if
fmszReadersIsNULL is set to TRUE (0x00000001). Also, if fmszReadersIsNULL is set to FALSE
(0x00000000) but cchReaders is set to 0x00000000, then the call MUST succeed,
ListReaders_Return.cBytes MUST be set to the length of the data in bytes, and
ListReaders_Return.msz MUST be set to NULL.
[Link] ContextAndStringA_Call
The ContextAndStringA_Call structure contains information used in calls that only require a Smart
Cards for Windows context and an ASCII string.
sz: The value of this string depends on the context (based on IOCTL) in which this structure is used.
Value Meaning
[Link] ContextAndStringW_Call
The ContextAndStringW_Call structure contains information used in calls that only require a Smart
Cards for Windows context and a Unicode string.
24 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
Context: A valid context, as specified in section [Link].
sz: The value of this Unicode string depends on the context (based on IOCTL) in which this structure
is used.
Value Meaning
[Link] ContextAndTwoStringA_Call
The contents of the ContextAndTwoStringA_Call structure are used in those calls that require a valid
Smart Cards for Windows context (as specified in section 3.2.5) and two strings (friendly names).
sz1: The value of this ASCII string depends on the context (based on IOCTL) in which it is used.
Value Meaning
sz2: The value of this ASCII string depends on the context (based on IOCTL) in which it is used.
Value Meaning
25 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
[Link] ContextAndTwoStringW_Call
The contents of the ContextAndTwoStringW_Call structure is used in those calls that require a valid
Smart Cards for Windows context (as specified in section 3.2.5) and two strings (friendly names).
sz1: The value of this Unicode string depends on the context (based on IOCTL) in which it is used.
Value Meaning
sz2: The value of this Unicode string depends on the context (based on IOCTL) in which it is used.
Value Meaning
[Link] LocateCardsA_Call
The parameters of the LocateCardsA_Call structure specify the list of smart card readers to search
for the specified card types. For call information, see section [Link].
26 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
Context: A valid context, as specified in section [Link].
mszCards: An ASCII multistring of card names to locate. Card names MUST be registered in
Smart Cards for Windows. Unknown card types MUST be ignored.
rgReaderStates: The reader state information specifying which readers are searched for the cards
listed in mszCards.
[Link] LocateCardsW_Call
The parameters of the LocateCardsW_Call structure specify the list of smart card readers to search
for the specified card types. For more information, see section [Link].
mszCards: A Unicode multistring of card names to locate. Card names MUST be registered in
Smart Cards for Windows. Unknown card types MUST be ignored.
rgReaderStates: The reader state information used to locate the cards listed in mszCards.
[Link] GetStatusChangeA_Call
The GetStatusChangeA_Call structure provides the state change in the reader as specified in section
[Link].
dwTimeOut: The maximum amount of time, in milliseconds, to wait for an action. If this member is
set to 0xFFFFFFFF (INFINITE), the caller MUST wait until an action occurs.
27 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
[Link] GetStatusChangeW_Call
The GetStatusChangeW_Call structure provides the state change in the Reader as specified in section
[Link].
dwTimeOut: Maximum amount of time, in milliseconds, to wait for an action. If set to 0xFFFFFFFF
(INFINITE), the caller MUST wait until an action occurs.
[Link] ConnectA_Call
ConnectA_Call opens a connection to the smart card located in the reader identified by a reader
name.
Common: Additional parameters that are required for the Connect call are specified in section
[Link]. For more information, see section [Link].
[Link] ConnectW_Call
The ConnectW_Call structure is used to open a connection to the smart card located in the reader
identified by a reader name.
Common: Additional parameters that are required for the Connect call. For more information, see
sections [Link] and [Link].
[Link] Reconnect_Call
The Reconnect_Call structure is used to reopen a connection to the smart card associated with a
valid context. For more information, see section [Link].
28 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
typedef struct _Reconnect_Call {
REDIR_SCARDHANDLE hCard;
unsigned long dwShareMode;
unsigned long dwPreferredProtocols;
unsigned long dwInitialization;
} Reconnect_Call;
dwShareMode: A flag that indicates whether other applications can form connections to this card.
For acceptable values of this field, see section 2.2.6.
dwPreferredProtocols: A bit mask of acceptable protocols for this connection. For specifics on
possible values, see section 2.2.5.
Value Meaning
[Link] HCardAndDisposition_Call
The HCardAndDisposition_Call structure defines the action taken on the disposition of a smart card
associated with a valid context when a connection is terminated.
dwDisposition: The action to take on the card in the connected reader upon close. This value is
ignored on a BeginTransaction message call, as specified in section [Link].61.
Value Meaning
29 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
Value Meaning
0x00000003
[Link] State_Call
The State_Call structure defines parameters to the State call (as specified in section [Link]) for
querying the contents of a smart card reader.
fpbAtrIsNULL: A Boolean value specifying whether the caller wants to retrieve the length of the
data. Set to FALSE (0x00000000) to allow the data to be returned. Set to TRUE (0x00000001),
and only the length of the data will be returned. SHOULD be set to TRUE if cbAtrLen is set to
SCARD_AUTOALLOCATE (0xFFFFFFFF).
Name Value
FALSE 0x00000000
TRUE 0x00000001
cbAtrLen: The length of the buffer specified on the TS server side. If cbAtrLen is set to
SCARD_AUTOALLOCATE with a value of 0xFFFFFFFF, an array of any length can be returned.
Otherwise, the returned array MUST NOT exceed cbAtrLen bytes in length. When the array to be
returned exceeds cbAtrLen bytes in length, State_Return.ReturnCode MUST be set to
SCARD_E_INSUFFICIENT_BUFFER (0x80100008). Also, cbAtrLen is ignored if fpbAtrIsNULL is
set to TRUE (0x00000001). If fpbAtrIsNULL is set to FALSE (0x00000000) but cbAtrLen is set
to 0x00000000, then the call MUST succeed, State_Return.cbAtrLen MUST be set to the length of
the data in bytes, and State_Return.rgAtr MUST be set to NULL.
[Link] Status_Call
Status_Call obtains the status of a connection for a valid smart card reader handle.
fmszReaderNamesIsNULL: A Boolean value specifying whether the caller wants to retrieve the
length of the data. Set to FALSE (0x00000000) to allow the data to be returned. Set to TRUE
(0x00000001), and only the length of the data will be returned. Also, cchReaderLen is ignored if
this value is TRUE (0x00000001).
30 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
Name Value
FALSE 0x00000000
TRUE 0x00000001
cchReaderLen: The length of the string buffer specified on the TS server side. If cchReaderLen is
set to SCARD_AUTOALLOCATE with a value of 0xFFFFFFFF, a string of any length can be returned.
Otherwise, the returned string MUST NOT exceed cchReaderLen characters in length, including
any null characters. When the string to be returned exceeds cchReaderLen characters in length,
including any null characters, Status_Return.ReturnCode MUST be set to
SCARD_E_INSUFFICIENT_BUFFER (0x80100008). The cchReaderLen field MUST be ignored if
fmszReaderNamesIsNULL is TRUE (0x00000001). Also, if fmszReaderNamesIsNULL is set to
FALSE (0x00000000) but cchReaderLen is set to 0x00000000, then the call MUST succeed,
Status_Return.cbAtrLen MUST be set to the length of the data in bytes, and Status_Return.pbAtr
MUST be set to NULL.
[Link] Transmit_Call
The Transmit_Call structure is used to send data to the smart card associated with a valid context.
pbSendBuffer: The data to be written to the card. The format of the data is specific to an individual
card. For more information about data formats, see [ISO/IEC-7816-4] sections 5 through 7.
pioRecvPci: If non-NULL, this field is an SCardIO_Request packet that is set up in the same way
as the ioSendPci field and passed as the pioRecvPci parameter of the Transmit call. If the value
of this is NULL, the caller is not requesting the pioRecvPci value to be returned.
fpbRecvBufferIsNULL: A Boolean value specifying whether the caller wants to retrieve the length of
the data. MUST be set to TRUE (0x00000001) if the caller wants only to retrieve the length of the
data; otherwise, it MUST be set to FALSE (0x00000000).
Name Value
FALSE 0x00000000
TRUE 0x00000001
31 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
[Link] Control_Call
Normally, communication is to the smart card via the reader. However, in some cases, the ability to
communicate directly with the smart card reader is requested. The Control_Call structure provides
the ability to talk to the reader.
dwControlCode: The control code for the operation. These values are specific to the hardware
device. This protocol MUST NOT restrict or define any values for this control codes.
pvInBuffer: A buffer that contains the data required to perform the operation. This field SHOULD be
NULL if the dwControlCode field specifies an operation that does not require input data.
Otherwise, this data is specific to the function being performed.
fpvOutBufferIsNULL: A Boolean value specifying whether the caller wants to retrieve the length of
the data. MUST be set to TRUE (0x00000001) if the caller wants only to retrieve the length of the
data; otherwise, it MUST be set to FALSE (0x00000000).
Name Value
FALSE 0x00000000
TRUE 0x00000001
cbOutBufferSize: The maximum size of the buffer to be returned. This field MUST be ignored if
fpvOutBufferIsNULL is set to TRUE (0x00000001).
[Link] GetAttrib_Call
dwAttrId: An identifier for the attribute to get. For more information on defined attributes, see
[PCSC3] section 3.1.2.
fpbAttrIsNULL: A Boolean value specifying whether the caller wants to retrieve the length of the
data. Set to FALSE (0x00000000) in order to allow the data to be returned. Set to TRUE
(0x00000001) and only the length of the data will be returned.
32 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
Name Value
FALSE 0x00000000
TRUE 0x00000001
cbAttrLen: The length of the buffer specified on the TS Server side. If cbAttrLen is set to
SCARD_AUTOALLOCATE with a value of 0xFFFFFFFF then any buffer length can be returned.
Otherwise, the returned buffer MUST NOT exceed cbAttrLen bytes in length. When the buffer to
be returned exceeds cbAttrLen bytes in length, GetAttrib_Return.ReturnCode MUST be set to
SCARD_E_INSUFFICIENT_BUFFER (0x80100008). The cbAttrLen field MUST be ignored if
fpbAttrIsNULL is set to TRUE (0x00000001). Also, if fpbAttrIsNULL is set to FALSE
(0x00000000) but cbAttrLen is set to 0x00000000, then the call MUST succeed,
GetAttrib_Return.cbAttrLen MUST be set to the length of the data, in bytes, and
GetAttrib_Return.pbAttr MUST be set to NULL.
[Link] SetAttrib_Call
The SetAttrib_Call structure allows users to set smart card reader attributes.
dwAttrId: The identifier of the attribute to set. The values are write-only. For more information on
possible values, see [PCSC3] section 3.1.2.
cbAttrLen: The size, in bytes, of the data corresponding to the pbAttr field.
pbAttr: A buffer that contains the attribute whose identifier is supplied in the dwAttrId field. The
format is specific to the value being set.
[Link] LocateCardsByATRA_Call
The LocateCardsByATRA_Call structure returns information concerning the status of the smart card
of interest (ATR).
33 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
rgReaderStates: The states of the readers that the application is monitoring. The states reflect what
the application determines to be the current states of the readers and that might differ from the
actual states.
[Link] LocateCardsByATRW_Call
The LocateCardsByATRW_Call structure returns information concerning the status of the smart card
of interest (ATR).
rgReaderStates: The states of the readers that the application is monitoring. The states reflects
what the application believes is the current states of the readers and might differ from the actual
states.
[Link] ReadCacheA_Call
The ReadCacheA_Call structure is used to obtain the card and reader information from the cache.
Common: Additional parameters for the Read Cache call (for additional information, see section
[Link]), as specified in section [Link].
[Link] ReadCacheW_Call
The ReadCacheW_Call structure is used to obtain the card and reader information from the cache.
Common: Additional parameters for the Read Cache call (for additional information, see section
[Link]), as specified in section [Link].
34 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
[Link] WriteCacheA_Call
The WriteCacheA_Call structure is used to write the card and reader information to the cache.
Common: Additional parameters for the Write Cache call (for more information, see section
[Link]), as specified in section [Link].
[Link] WriteCacheW_Call
The WriteCacheW_Call structure is used to write the card and reader information to the cache.
Common: Additional parameters for the Write Cache call (for more information, see section [Link].
[Link] GetTransmitCount_Call
The GetTransmitCount_Call structure is used to obtain the number of transmit calls sent to the card
since the reader was introduced.
[Link] ScardAccessStartedEvent_Call
ScardAccessStartedEvent_Call is just an uninitialized 4-byte buffer that is sent as the IOCTL requires
a payload. There is no corresponding serialized structure for this call.
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
Unused
Unused (4 bytes): The field is uninitialized. It SHOULD contain random data and MUST be ignored on
receipt.
35 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
[Link] GetReaderIcon_Call
The GetReaderIcon_Call structure is used to obtain the reader icon from the smart card reader's INF
file.
[Link] GetDeviceTypeId_Call
The GetDeviceTypeId_Call structure is used to obtain the reader's device ID from the smart card
reader's INF file.
These structures originate from the client process and compose part of the return packet. If the
ReturnCode field of the structure is nonzero, all other fields MUST be set to zero and MUST be
ignored on receipt.
[Link] ReadCache_Return
The ReadCache_Return structure is used to obtain the data that corresponds to the lookup item
requested in ReadCacheA_Call as specified in section [Link], or ReadCacheW_Call as specified in
section [Link]. For more call information, see sections [Link] and [Link].
ReturnCode: HRESULT or Win32 Error codes. Zero indicates success; any other value indicates
failure.
36 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
[Link] EstablishContext_Return
The EstablishContext_Return structure is used to provide a response to an Establish Context call (for
more information, see section [Link].)
ReturnCode: HRESULT or Win32 Error code. Zero indicates success; any other value indicates
failure.
[Link] Long_Return
The Long_Return structure is used for return codes for calls that return only a long value.
ReturnCode: HRESULT or Win32 Error code. Zero indicates success; any other value indicates
failure.
The ListReaderGroups_Return and ListReaders_Return structures are used to obtain results for those
calls that return a multistring, in addition to a long return value. For more information, see sections
[Link], [Link], [Link], and [Link].
ReturnCode: HRESULT or Win32 Error code. The value returned from the Smart Card Redirection
call.
msz: The meaning of this field is specific to the context (IOCTL) in which it is used.
Value Meaning
37 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
Value Meaning
The LocateCards_Return and GetStatusChange_Return structures are used to obtain the results on
those calls that return updated reader state information. (for more information, see sections [Link],
[Link], [Link], [Link], [Link], and [Link]).
ReturnCode: HRESULT or Win32 Error code. Zero indicates success; any other value indicates
failure.
[Link] Control_Return
The Control_Return structure is used to obtain information from a Control_Call (for more information,
see section [Link]).
ReturnCode: HRESULT or Win32 Error code. Zero indicates success; any other value indicates
failure.
pvOutBuffer: Contains the return data specific to the value of the Control_Call structure.
[Link] Reconnect_Return
The Reconnect_Return structure is used to obtain return information from a Reconnect call (for more
information, see section [Link]).
38 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
ReturnCode: HRESULT or Win32 Error code. Zero indicates success; any other value indicates
failure.
dwActiveProtocol: A flag that indicates the established active protocol. For more information on
acceptable values, see section 2.2.5 .
[Link] Connect_Return
The Connect_Return structure is used to obtain return information from a Connect call (for more
information, see sections [Link] and [Link]).
ReturnCode: HRESULT or Win32 Error code. Zero indicates success; any other value indicates
failure.
dwActiveProtocol: A value that indicates the active smart card transmission protocol. Possible
values are specified in section 2.2.5.
[Link] State_Return
The State_Return structure defines return information about the state of the smart card reader (for
more information, see section [Link]).
ReturnCode: HRESULT or Win32 Error code. Zero indicates success; any other value indicates
failure.
dwState: The current state of the smart card in the Reader. Possible values are specified in section
2.2.4.
dwProtocol: The current protocol, if any. Possible values are specified in section 2.2.5.
rgAtr: A pointer to a buffer that receives the ATR string from the currently inserted card, if available.
[Link] Status_Return
The Status_Return structure defines return information about the status of the smart card reader
(for more information, see sections [Link] and [Link]).
39 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
[range(0,65536)] unsigned long cBytes;
[unique] [size_is(cBytes)] byte *mszReaderNames;
unsigned long dwState;
unsigned long dwProtocol;
byte pbAtr[32];
[range(0,32)] unsigned long cbAtrLen;
} Status_Return;
ReturnCode: HRESULT or Win32 Error code. Zero indicates success; any other value indicates
failure.
mszReaderNames: A multistring containing the names that the reader is known by. The value of
this is dependent on the context (IOCTL) that it is used.
Value Meaning
dwState: The current state of the smart card in the reader. Possible values are specified in section
2.2.4.
dwProtocol: The current protocol, if any. Possible values are specified in section 2.2.5.
pbAtr: A pointer to a buffer that receives the ATR string from the currently inserted card, if
available.
[Link] Transmit_Return
The Transmit_Return structure defines return information from a smart card after a Transmit call (for
more information, see section [Link]).
ReturnCode: HRESULT or Win32 Error code. Zero indicates success; any other value indicates
failure.
pioRecvPci: The protocol header structure for the instruction, followed by a buffer in which to
receive any returned protocol control information (PCI) that is specific to the protocol in use. If
this field is NULL, a protocol header MUST NOT be returned.
40 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
[Link] GetAttrib_Return
The GetAttrib_Return structure defines attribute information from a smart card reader (for more
information, see section [Link]).
ReturnCode: HRESULT or Win32 Error code. Zero indicates success; any other value indicates
failure.
pbAttr: A pointer to an array that contains any values returned from the corresponding call.
[Link] GetTransmitCount_Return
The GetTransmitCount_Return structure defines the number of transmit calls that were performed on
the smart card reader (for more information, see section [Link]).
ReturnCode: HRESULT or Win32 Error code. Zero indicates success; any other value indicates
failure.
cTransmitCount: The field specifies the number of successful Transmit calls (for more information,
see section [Link]) performed on the reader since it was introduced to the system.
[Link] GetReaderIcon_Return
The GetReaderIcon_Return structure is used to obtain the data that corresponds to the lookup item
requested in the GetReaderIcon_Call as specified in section [Link]. For more information, see
section [Link].
ReturnCode: HRESULT or Win32 error code. Zero indicates success; any other value indicates
failure.
41 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
[Link] GetDeviceTypeId_Return
The GetDeviceTypeId_Return structure is used to obtain the data that corresponds to the lookup item
requested in GetDeviceTypeId_Call as specified in section [Link]. For more information, see
section [Link].
ReturnCode: HRESULT or Win32 error code. Zero indicates success; any other value indicates
failure.
The following represents the current state of the smart card reader according to Smart Cards for
Windows.
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
CardReaderState
Value Meaning
SCARD_PRESENT There is a card in the reader but it has not been moved into position for use.
0x00000002
SCARD_SWALLOWED There is a card in the reader in position for use. The card is not powered.
0x00000003
SCARD_POWERED There is power being applied to the card but the mode of the card is unknown.
0x00000004
SCARD_NEGOTIABLE The card has been reset and is awaiting PTS negotiation.
0x00000005
SCARD_SPECIFICMODE The card has been reset and specific communication protocols have been
0x00000006 established.
A Protocol Identifier.
42 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
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
ProtocolIdentifier
ProtocolIdentifier (4 bytes): This field MUST have a value from Table A which is logically OR'ed
with a value from Table B.
Table A
Value Meaning
SCARD_PROTOCOL_RAW Transmission protocol raw is active. The data from the smart card is
0x00010000 raw and does not conform to any transmission protocol.
Table B
Value Meaning
SCARD_PROTOCOL_DEFAULT A bitwise OR with this value forces the use of the default transmission
0x80000000 parameters and card clock frequency.
SCARD_PROTOCOL_OPTIMAL Optimal transmission parameters and card clock frequency MUST be used.
0x00000000 This flag is considered the default. No actual value is defined for this flag; it
is there for compatibility with [PCSC5] section 3.1.3.
Access mode flags provide possible values for applications to connect to the smart card.
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
AccessModeFlag
Value Meaning
SCARD_SHARE_EXCLUSIVE This application is not willing to share this smart card with other applications.
0x00000001
SCARD_SHARE_SHARED This application is willing to share this smart card with other applications.
0x00000002
43 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
Value Meaning
SCARD_SHARE_DIRECT This application demands direct control of the smart card reader; therefore, it
0x00000003 is not available to other applications.
The Reader State packet has a sub-structure as shown in the following table.
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
Reader State
Reader State (4 bytes): Both the dwCurrentState field and the dwEventState field, found in the
ReaderState_Common_Call (section [Link]) and ReaderState_Return (section [Link])
structures, consist of the following two subfields.
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
Count State
Count (2 bytes): The contents of this field depend on the value of the associated reader name. If
the reader name (for more information, see sections [Link] and [Link] for the szReader field) is
\\?PnP?\Notification, then Count is a count of the number of readers installed on the system and
all bits except SCARD_STATE_CHANGED in State MUST be zero. Otherwise, Count is a count of
the number of times a card has been inserted and/or removed from the smart card reader being
monitored.
State (2 bytes): The state of a reader. The value MUST be according to the following table.
Value Meaning
SCARD_STATE_UNAWARE The application requires the current state but does not know it. The use of
0x0000 this value results in an immediate return from state transition monitoring
services.
SCARD_STATE_IGNORE The application requested that this reader be ignored. If this bit is set in
0x0001 the dwCurrentState field of a ReaderState_Common_Call structure,
other bits MUST NOT be set in the dwEventState field of the
corresponding ReaderState_Return structure.
SCARD_STATE_CHANGED There is a difference between the state believed by the application, and
0x0002 the state known by Smart Cards for Windows.
SCARD_STATE_UNKNOWN The reader name is not recognized by Smart Cards for Windows. If this bit
0x0004 is set in the dwEventState field of the ReaderState_Return structure,
both SCARD_STATE_IGNORE and SCARD_STATE_CHANGED values MUST
be set. This bit SHOULD NOT be set in the dwCurrentState field of a
ReaderState_Common_Call structure.
SCARD_STATE_UNAVAILABLE The actual state of this reader is not available. If this bit is set, all of the
0x0008 following bits MUST be clear.
44 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
Value Meaning
SCARD_STATE_EMPTY There is no card in the reader. If this bit is set, all of the following bits
0x0010 MUST be clear.
SCARD_STATE_ATRMATCH There is a card in the reader with an ATR that matches one of the target
0x0040 cards. If this bit is set, SCARD_STATE_PRESENT MUST be set.
SCARD_STATE_EXCLUSIVE The card in the reader is allocated for exclusive use by another
0x0080 application. If this bit is set, SCARD_STATE_PRESENT MUST be set.
SCARD_STATE_INUSE The card in the reader is in use by one or more other applications, but it
0x0100 can be connected to in shared mode. If this bit is set,
SCARD_STATE_PRESENT MUST be set.
SCARD_STATE_MUTE The card in the reader is unresponsive or is not supported by the reader
0x0200 or software.
SCARD_STATE_UNPOWERED This implies that the card in the reader has not been turned on.
0x0400
The following Smart Card Facility Codes for Windows-specific return codes MAY be returned by the
protocol server to the protocol client and are of the data type NTSTATUS, with the sev field set to
STATUS_SEVERITY_WARNING (0x2) and the reserved bit (N) set to 0.
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
ReturnCode
Value Meaning
45 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
Value Meaning
0x80100005
SCARD_E_INSUFFICIENT_BUFFER The data buffer to receive returned data is too small for the
0x80100008 returned data.
SCARD_E_CANT_DISPOSE The system could not dispose of the media in the requested
0x8010000E manner.
SCARD_E_SYSTEM_CANCELLED The action was canceled by the system, presumably to log off
0x80100012 or shut down.
SCARD_E_INVALID_ATR An ATR obtained from the registry is not a valid ATR string.
0x80100015
SCARD_P_SHUTDOWN The operation has been stopped to allow the server application
46 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
Value Meaning
0x80100018 to exit.
SCARD_E_UNSUPPORTED_FEATURE This smart card does not support the requested feature.
0x80100022
SCARD_E_DIR_NOT_FOUND The specified directory does not exist in the smart card.
0x80100023
SCARD_E_FILE_NOT_FOUND The specified file does not exist in the smart card.
0x80100024
SCARD_E_NO_DIR The supplied path does not represent a smart card directory.
0x80100025
SCARD_E_READER_UNSUPPORTED The reader device driver does not meet minimal requirements
0x8010001A for support.
SCARD_E_DUPLICATE_READER The reader device driver did not produce a unique reader
0x8010001B name.
SCARD_E_CARD_UNSUPPORTED The smart card does not meet minimal requirements for
0x8010001C support.
SCARD_E_NO_FILE The supplied path does not represent a smart card file.
0x80100026
SCARD_E_WRITE_TOO_MANY The smart card does not have enough memory to store the
0x80100028 information.
SCARD_E_BAD_SEEK There was an error trying to set the smart card file object
0x80100029 pointer.
47 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
Value Meaning
0x8010002B component.
SCARD_W_UNSUPPORTED_CARD The reader cannot communicate with the smart card due to
0x80100065 ATR configuration conflicts.
SCARD_W_UNPOWERED_CARD Power has been removed from the smart card, so that further
0x80100067 communication is impossible.
SCARD_W_RESET_CARD The smart card has been reset, so any shared state
0x80100068 information is invalid.
SCARD_W_WRONG_CHV The card cannot be accessed because the wrong PIN was
0x8010006B presented.
SCARD_W_EOF The end of the smart card file has been reached.
0x8010006D
48 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
Value Meaning
0x8010006E
SCARD_W_CACHE_ITEM_STALE The requested cache item is too old and was deleted from the
0x80100071 cache.
SCARD_W_CACHE_ITEM_TOO_BIG The new cache item exceeds the maximum per-item size
0x80100072 defined for the cache.
49 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
3 Protocol Details
The following sections specify details of the Remote Desktop Protocol: Smart Card Virtual Channel
Extension, including abstract data models, interface method syntax, and message processing rules.
This section describes a conceptual model of a 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 provided that their external behavior is consistent with that described in this
document.
dwDeviceId: The device id assigned by Remote Desktop Protocol: File System Virtual Channel
Extension that identifies this protocol.
3.1.2 Timers
None.
3.1.3 Initialization
Initialization is triggered by the Remote Desktop Protocol: File System Virtual Channel Extension when
it enumerates all pre-logon devices. At this time, TS client initialization is performed.
If the TS server operating system version is earlier than 5.1, the device is not announced to the
TS server
The dwDeviceId field MUST be set to the device Id selected by Remote Desktop Protocol: File System
Virtual Channel Extension, and rgSCardContextList MUST be set to the empty list.
Only the control codes specified in the IOCTL Processing Rules in the following table are valid. Invalid
packets MUST be dropped without a reply.
Functio
n Value for
numbe IoControlCo
r de IRP_MJ_DEVICE_CONTROL request Input packet, Output packet
50 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
Functio
n Value for
numbe IoControlCo
r de IRP_MJ_DEVICE_CONTROL request Input packet, Output packet
51 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
Functio
n Value for
numbe IoControlCo
r de IRP_MJ_DEVICE_CONTROL request Input packet, Output packet
52 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
Functio
n Value for
numbe IoControlCo
r de IRP_MJ_DEVICE_CONTROL request Input packet, Output packet
The TS client MUST be able to process multiple requests simultaneously within the limits of its
resources.
Any errors from the Smart Cards for Windows layer MUST be transferred to the TS server and
MUST NOT be modified by the TS client. No exceptions are thrown in this protocol.
1. The IoControlCode MUST be present, as specified in the preceding IOCTL Processing Rules table,
for the specific protocol version implemented.<2>
2. The input data type is interpreted according to the IOCTL Processing Rules table. The data MUST
be decoded as specified in [MS-RPCE] section 2.2.6.
3. Processing MUST be performed according to the corresponding section that follows. On success, it
MUST return a structure as specified in the preceding IOCTL Processing Rules table.
4. If the protocol encounters problems decoding the input or encoding the results, then
DR_DEVICE_IOCOMPLETION.IOStatus (as specified in [MS-RDPEFS] section [Link]) MUST be set
to an NTSTATUS code (as specified in [MS-ERREF] section 2.3), the most common of which appear
in the following table.
STATUS_NO_MEMORY Not enough virtual memory or paging file quota is available to complete the
0xC0000017 specified operation.
53 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
Return value/code Description
STATUS_BUFFER_TOO_SMALL The buffer is too small to contain the entry. No information has been written to
0xC0000023 the buffer.
7. The return packet is then sent according to Remote Desktop Protocol: File System Virtual Channel
Extension.
Establish Context creates a new Smart Cards for Windows context specified for use in subsequent
communication with Smart Cards for Windows.
Release Context releases a previously established Smart Cards for Windows context as specified in
section [Link]. The context MUST exist in rgSCardContextList.
Return Values: This method sets Long_Return.ReturnCode (for more information, see section [Link])
to SCARD_S_SUCCESS on success; otherwise, it sets one of the smart card-specific errors or one of
the return codes from Winerror.h. No specialized error codes are associated with this method.
If the call is successful, Context_Call.Context (for more information, see section [Link]) is removed
from rgSCardContextList.
Is Valid Context checks if a previously established Smart Cards for Windows context from
SCARD_IOCTL_ESTABLISHCONTEXT is still valid. For this call to succeed, Context_Call.Context (for
more information, see section [Link]) MUST exist in rgSCardContextList and the Smart Cards for
Windows communication channel MUST still be present.
Return Values: This method sets Long_Return.ReturnCode (for more information, see section [Link])
to SCARD_S_SUCCESS on success; otherwise, it sets one of the smart card-specific errors or one of
the return codes from Winerror.h. No specialized error codes are associated with this method.
Access Started Event waits until Smart Cards for Windows is running.
54 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
Return Values: This method sets Long_Return.ReturnCode (for more information, see section [Link])
to SCARD_S_SUCCESS if Smart Cards for Windows is running; otherwise, it sets one of the smart
card-specific errors or one of the return codes from Winerror.h. No specialized error codes are
associated with this method.
The ASCII version List Reader Groups returns the reader groups known to Smart Cards for
Windows. ListReaderGroups_Return is constructed according to ListReaderGroups_Return and
ListReaders_Return and the information in ListReaderGroups_Call.
Return Values: This method sets ListReaderGroups_Return.ReturnCode (for more information, see
section [Link]) to SCARD_S_SUCCESS on success; otherwise, it sets one of the smart card-specific
errors or one of the return codes from Winerror.h. No specialized error codes are associated with this
method.
The Unicode version List Reader Groups returns the reader groups known to Smart Cards for
Windows. ListReaderGroups_Return is constructed according to ListReaderGroups_Return and
ListReaders_Return and the information in ListReaderGroups_Call.
Return Values: This method sets ListReaderGroups_Return.ReturnCode (for more information, see
section [Link]) to SCARD_S_SUCCESS on success; otherwise, it sets one of the smart card-specific
errors or one of the return codes from Winerror.h. No specialized error codes are associated with this
method.
The ASCII version of List Readers returns the smart card readers known to Smart Cards for
Windows. ListReaders_Return is constructed according to ListReaderGroups_Return and
ListReaders_Return and ListReaders_Call.
Return Values: The method sets ListReaders_Return.ReturnCode (for more information, see section
[Link]) to SCARD_S_SUCCESS on success; otherwise, it sets one of the smart card-specific errors or
one of the return codes from Winerror.h. No specialized error codes are associated with this method.
The Unicode version of List Readers returns the smart card readers known to Smart Cards for
Windows. ListReaders_Return is constructed according to ListReaderGroups_Return and
ListReaders_Return and ListReaders_Call.
Return Values: The method sets ListReaders_Return.ReturnCode (for more information, see section
[Link]) to SCARD_S_SUCCESS on success; otherwise, it sets one of the smart card-specific errors or
one of the return codes from Winerror.h. No specialized error codes are associated with this method.
The ASCII version of Introduce Reader Group adds the reader group specified in
ContextAndStringA_Call.sz (for more information, see section [Link]) to the list of reader groups
known to Smart Cards for Windows.
Return Values: The method sets Long_Return.ReturnCode (for more information, see section [Link])
to SCARD_S_SUCCESS on success; otherwise, it sets one of the smart card-specific errors or one of
the return codes from Winerror.h. No specialized error codes are associated with this method.
55 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
[Link] SCARD_IOCTL_INTRODUCEREADERGROUPW (IOCTL 0x00090054)
The Unicode version of Introduce Reader Group adds the reader group specified in
ContextAndStringW_Call.sz (for more information, see section [Link]) to the list of reader groups
known to Smart Cards for Windows.
Return Values: The method sets Long_Return.ReturnCode (for more information, see section [Link])
to SCARD_S_SUCCESS on success; otherwise, it sets one of the smart card-specific errors or one of
the return codes from Winerror.h. No specialized error codes are associated with this method.
The ASCII version of Forget Reader Group removes the reader group specified in
ContextAndStringA_Call.sz (for more information, see section [Link]) from the list of reader groups
known to the Smart Cards for Windows.
Return Values: The method sets Long_Return.ReturnCode (for more information, see section [Link])
to SCARD_S_SUCCESS on success; otherwise, it sets one of the smart card-specific errors or one of
the return codes from Winerror.h. No specialized error codes are associated with this method.
The Unicode version of Forget Reader Group removes the reader group specified in
ContextAndStringW_Call.sz (for more information, see section [Link]) from the list of reader groups
known to Smart Cards for Windows.
Return Values: The method sets Long_Return.ReturnCode (for more information, see section [Link])
to SCARD_S_SUCCESS on success; otherwise, it sets one of the smart card-specific errors or one of
the return codes from Winerror.h. No specialized error codes are associated with this method.
The ASCII version of Introduce Reader adds the device name specified in
ContextAndTwoStringA_Call.sz2 (for more information, see section [Link]) to the smart card reader
specified in ContextAndTwoStringA_Call.sz1.
Return Values: The method sets Long_Return.ReturnCode (for more information, see section [Link])
to SCARD_S_SUCCESS on success; otherwise, it sets one of the smart card-specific errors or one of
the return codes from Winerror.h. No specialized error codes are associated with this method.
The Unicode version of Introduce Reader adds the device name specified in
ContextAndTwoStringW_Call.sz2 (for more information, see section [Link]) to the smart card
reader specified in ContextAndTwoStringW_Call.sz1.
Return Values: The method sets Long_Return.ReturnCode (for more information, see section [Link])
to SCARD_S_SUCCESS on success; otherwise, it sets one of the smart card-specific errors or one of
the return codes from Winerror.h. No specialized error codes are associated with this method.
The ASCII version of Forget Reader removes the smart card reader specified in
ContextAndStringA_Call.sz (for more information, see section [Link]) from the list of smart card
readers known to Smart Cards for Windows.
56 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
Return Values: The method sets Long_Return.ReturnCode (for more information, see section [Link])
to SCARD_S_SUCCESS on success; otherwise, it sets one of the smart card-specific errors or one of
the return codes from Winerror.h. No specialized error codes are associated with this method.
The Unicode version of Forget Reader removes the smart card reader specified in
ContextAndStringW_Call.sz (for more information, see section [Link]) from the list of smart card
readers known to Smart Cards for Windows.
Return Values: The method sets Long_Return.ReturnCode (for more information, see section [Link])
to SCARD_S_SUCCESS on success; otherwise, it sets one of the smart card-specific errors or one of
the return codes from Winerror.h. No specialized error codes are associated with this method.
The ASCII version of Add Reader to Group adds the smart card reader specified in
ContextAndTwoStringA_Call.sz2 (for more information, see section [Link]).
Return Values: The method sets Long_Return.ReturnCode (for more information, see section [Link])
to SCARD_S_SUCCESS on success; otherwise, it sets one of the smart card-specific errors or one of
the return codes from Winerror.h. No specialized error codes are associated with this method.
The Unicode version of Add Reader to Group adds the smart card reader specified in
ContextAndTwoStringW_Call.sz2 (for more information, see section [Link]).
Return Values: The method sets Long_Return.ReturnCode (for more information, see section [Link])
to SCARD_S_SUCCESS on success; otherwise, it sets one of the smart card-specific errors or one of
the return codes from Winerror.h. No specialized error codes are associated with this method.
The ASCII version of Remove Reader From Group removes the smart card reader specified in
ContextAndTwoStringA_Call.sz2 (for more information, see section [Link]).
Return Values: The method sets Long_Return.ReturnCode (for more information, see section [Link])
to SCARD_S_SUCCESS on success; otherwise, it sets one of the smart card-specific errors or one of
the return codes from Winerror.h. No specialized error codes are associated with this method.
The Unicode version of Remove Reader From Group removes the smart card reader specified in
ContextAndTwoStringW_Call.sz2 (for more information, see section [Link]).
Return Values: The method sets Long_Return.ReturnCode (for more information, see section [Link])
to SCARD_S_SUCCESS on success; otherwise, it sets one of the smart card-specific errors or one of
the return codes from Winerror.h. No specialized error codes are associated with this method.
The ASCII version of Locate Cards searches the readers specified in LocateCardsA_Call.mszCards (for
more information, see section [Link]). Unknown Card Types MUST be ignored. LocateCards_Return
is constructed according to LocateCards_Return and GetStatusChange_Return by using the
information in LocateCardsA_Call.
57 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
Return Values: The method sets LocateCards_Return.ReturnCode (for more information, see section
[Link]) to SCARD_S_SUCCESS on success; otherwise, it sets one of the smart card-specific errors or
one of the return codes from Winerror.h. No specialized error codes are associated with this method.
The Unicode version of Locate Cards searches the readers specified in LocateCardsW_Call.mszCards
(for more information, see section [Link]). Unknown Card Types MUST be ignored.
LocateCards_Return is constructed according to LocateCards_Return and GetStatusChange_Return by
using the information in LocateCardsW_Call.
The ASCII version of Get Status Change monitors the smart card readers specified in
GetStatusChangeA_Call.rgReaderStates (for more information, see section [Link]) MUST correctly
represent the state of the Readers as known by Smart Cards for Windows.
The Unicode version of Get Status Change monitors the smart card readers specified in
GetStatusChangeW_Call.rgReaderStates (for more information, see section [Link]) MUST correctly
represent the state of the readers as known by Smart Cards for Windows.
The ASCII version of Locate Cards By ATR searches the Readers specified in
LocateCardsByATRA_Call.rgAtrMasks (for more information, see section [Link]). Unknown card
types MUST be ignored. LocateCards_Return is constructed according to LocateCards_Return and
GetStatusChange_Return by using the information in LocateCardsByATRA_Call.
Return Values: The method sets LocateCards_Return.ReturnCode (for more information, see section
[Link]) to SCARD_S_SUCCESS on success; otherwise, it sets one of the smart card-specific errors or
one of the return codes from Winerror.h. No specialized error codes are associated with this method.
The Unicode version of Locate Cards By ATR searches the readers specified in
LocateCardsByATRW_Call.rgAtrMasks (LocateCardsByATRW_Call). Unknown Card Types MUST be
ignored. LocateCards_Return is constructed according to LocateCards_Return and
GetStatusChange_Return by using the information in LocateCardsByATRW_Call.
Return Values: The method sets LocateCards_Return.ReturnCode (for more information, see section
[Link]) to SCARD_S_SUCCESS on success; otherwise, it sets one of the smart card-specific errors or
one of the return codes from Winerror.h. No specialized error codes are associated with this method.
58 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
[Link] SCARD_IOCTL_CANCEL (IOCTL 0x000900A8)
The Cancel method MUST instruct Smart Cards for Windows to cancel any outstanding calls by
using the context specified by Context_Call.Context (for more information, see section [Link]).
Return Values: The method sets Long_Return.ReturnCode (for more information, see section [Link])
to SCARD_S_SUCCESS on success; otherwise, it sets one of the smart card-specific errors or one of
the return codes from Winerror.h. No specialized error codes are associated with this method.
The ASCII version of Connect establishes a handle to a smart card reader. On success,
Connect_Return is initialized according to Control_Return.
Return Values: The method sets the Connect_Return.ReturnCode (for more information, see section
[Link]) to SCARD_S_SUCCESS on success; otherwise, it sets one of the smart card-specific errors or
one of the return codes from Winerror.h. No specialized error codes are associated with this method.
The Unicode version of Connect establishes a smart card reader handle. On success,
Connect_Return is initialized according to Control_Return and the caller is given a handle to execute
additional methods on the reader.
Return Values: The method sets the Connect_Return.ReturnCode (for more information, see section
[Link]) to SCARD_S_SUCCESS on success; otherwise, it sets one of the smart card-specific errors or
one of the return codes from Winerror.h. No specialized error codes are associated with this method.
The disconnect method releases a smart card reader handle that was acquired in ConnectA_Call or
ConnectW_Call,using HCardAndDisposition_Call.dwDisposition. After a successful call, The smart card
reader handle is released and MUST be made available to the system.
The Begin Transaction method locks a smart card reader for exclusive access for the specified smart
card reader handle. If the caller is unable to receive exclusive access, this call MUST block until the
request can be met.
Return Values: The method sets Long_Return.ReturnCode (for more information, see section [Link])
to SCARD_S_SUCCESS on success; otherwise, it sets one of the smart card-specific errors or one of
the return codes from Winerror.h. No specialized error codes are associated with this method.
The End Transaction method releases a smart card reader after being locked by a previously
successful call to Begin Transaction (for more information, see section [Link]).
Return Values: The method sets Long_Return.ReturnCode (for more information, see section [Link])
to SCARD_S_SUCCESS on success; otherwise, it sets one of the smart card-specific errors or one of
the return codes from Winerror.h. No specialized error codes are associated with this method.
59 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
[Link] SCARD_IOCTL_STATUSA (IOCTL 0x000900C8)
The ASCII version of the Status call returns the current state of the smart card reader and any
smart card inserted. On success, Status_Return MUST be initialized according to Status_Return.
Return Values: The method sets Status_Return.ReturnCode (for more information, see section
[Link]) to SCARD_S_SUCCESS on success; otherwise, it sets one of the smart card-specific errors
or one of the return codes from Winerror.h. No specialized error codes are associated with this
method.
The Unicode version of the Status call returns the current state of the smart card reader and any
smart card inserted. On success, Status_Return MUST be initialized according to Status_Return.
Return Values: The method sets Status_Return.ReturnCode (for more information, see section
[Link]) to SCARD_S_SUCCESS on success; otherwise, it sets one of the smart card-specific errors
or one of the return codes from Winerror.h. No specialized error codes are associated with this
method.
The Transmit function sends a command to a smart card inserted to the smart card reader
associated with the smart card reader handle. On success, the command has been successfully sent to
the card and the response has been placed in Transmit_Return.
Return Values: The method sets Transmit_Return.ReturnCode (for more information, see section
[Link]) to SCARD_S_SUCCESS on success; otherwise, it sets one of the smart card-specific errors
or one of the return codes from Winerror.h. No specialized error codes are associated with this
method.
The reconnect method re-establishes a smart card reader handle. On success, the handle is valid
once again.
Return Values: The method sets Reconnect_Return.ReturnCode (for more information, see section
[Link]) to SCARD_S_SUCCESS on success; otherwise, it sets one of the smart card-specific errors or
one of the return codes from Winerror.h. No specialized error codes are associated with this method.
The Control function sends a command to a smart card reader associated with the smart card reader
handle. On success, the command has been successfully sent to the smart card reader and the
response has been placed in Control_Return.
Return Values: The method sets Control_Return.ReturnCode (for more information, see section
[Link]) to SCARD_S_SUCCESS on success; otherwise, it sets one of the smart card-specific errors or
one of the return codes from Winerror.h. No specialized error codes are associated with this method.
The Get Attribute function requests an attribute of the smart card reader associated with the smart
card reader handle. On success, the attribute is copied to GetAttrib_Return.
Return Values: The method sets GetAttrib_Return.ReturnCode (for more information, see section
[Link]) to SCARD_S_SUCCESS on success; otherwise, it sets one of the smart card-specific errors
60 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
or one of the return codes from Winerror.h. No specialized error codes are associated with this
method.
The Set Attribute function changes the value of an attribute of the smart card reader associated with
the smart card reader handle.
Return Values: The method sets Long_Return.ReturnCode (for more information, see section [Link])
to SCARD_S_SUCCESS on success; otherwise, it sets one of the smart card-specific errors or one of
the return codes from Winerror.h. No specialized error codes are associated with this method.
The State method returns the current state of the smart card reader and any smart card inserted.
On success, Status_Return MUST be initialized as specified in section [Link].
Return Values: The method sets State_Return.ReturnCode (for more information, see section [Link])
to SCARD_S_SUCCESS on success; otherwise, it sets one of the smart card-specific errors or one of
the return codes from Winerror.h. No specialized error codes are associated with this method.
The Get Transmit Count retrieves the number of times a successful Transmit method (for more
information, see section [Link]) has been performed on the smart card reader. On success,
GetTrasmitCount_Return MUST be initialized as specified in section [Link].
Return Values: The method sets State_Return.ReturnCode (for more information, see section [Link])
to SCARD_S_SUCCESS on success; otherwise, it sets one of the smart card-specific errors or one of
the return codes from Winerror.h. No specialized error codes are associated with this method.
The ASCII version of Read Cache retrieves cached data for a specific smart card. Data is cached
according to the smart card UUID (ReadCacheA_Call.[Link]; for more information,
see section [Link]), the Card Lookup Name (ReadCacheA_Call.szLookupName; for more information,
see section [Link]), and the freshness of the data (ReadCacheA_Call.[Link];
for more information, see section [Link]). All three MUST match in order for this call to be successful.
On success, ReadCache_Return MUST be initialized as specified in section [Link].
Return Values: The method sets ReadCache_Return.ReturnCode (for more information, see section
[Link]) to SCARD_S_SUCCESS on success; otherwise, it sets one of the smart card-specific errors or
one of the return codes from Winerror.h. No specialized error codes are associated with this method.
The Unicode version of Read Cache retrieves cached data for a specific smart card in a Smart
Cards for Windows cache. Data is cached according to the smart card UUID
(ReadCacheA_Call.[Link]; for more information, see section [Link]), the Card
Lookup Name (ReadCacheW_Call.szLookupName; for more information, see section [Link]), and the
freshness of the data (ReadCacheW_Call.[Link]; for more information, see
section [Link]). All three MUST match in order for this call to be successful. On success,
ReadCache_Return MUST be initialized as specified in section [Link].
Return Values: The method sets ReadCache_Return.ReturnCode (for more information, see section
[Link]) to SCARD_S_SUCCESS on success; otherwise, it sets one of the smart card-specific errors or
one of the return codes from Winerror.h. No specialized error codes are associated with this method.
61 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
[Link] SCARD_IOCTL_WRITECACHEA (IOCTL 0x000900F8)
The ASCII version of Write Cache stores data for a specific smart card in a Smart Cards for
Windows cache. Data is cached according to the smart card UUID
(ReadCacheA_Call.szLookupName; for more information, see section [Link]), and the freshness of
the data (ReadCacheA_Call.[Link]).
Return Values: The method sets Long_Return.ReturnCode (for more information, see section [Link])
to SCARD_S_SUCCESS on success; otherwise, it sets one of the smart card-specific errors or one of
the return codes from Winerror.h. No specialized error codes are associated with this method
The Unicode version of Write Cache stores data for a specific smart card in a Smart Cards for
Windows cache. Data is cached according to the smart card UUID
(ReadCacheA_Call.szLookupName; for more information, see section [Link]), and the freshness of
the data (ReadCacheA_Call.[Link]).
Return Values: The method sets Long_Return.ReturnCode (for more information, see section [Link])
to SCARD_S_SUCCESS on success; otherwise, it sets one of the smart card-specific errors or one of
the return codes from Winerror.h. No specialized error codes are associated with this method
[Link] SCARD_IOCTL_RELEASETARTEDEVENT
Get Reader Icon retrieves the icon from the INF file for a specific smart card reader name (for more
information, see GetReaderIcon_Call.szReaderName, section [Link]). On success,
GetReaderIcon_Return.pbData contains the icon; for more information, see section [Link].
Return Values: This method sets GetReaderIcon_Return.ReturnCode (for more information, see
section [Link]) to SCARD_S_SUCCESS on success; otherwise, it sets one of the smart card–specific
errors or another error code. No specialized error codes are associated with this method.
Get Device Type ID retrieves the device type from the INF file for a specific smart card reader name
(GetDeviceTypeId_Call.szReaderName; for more information, see section [Link]). On success,
GetDeviceTypeId_Return.dwDeviceId contains the device type ID; for more information, see
section [Link].
Return Values: This method sets GetDeviceTypeId_Return.ReturnCode (for more information, see
section [Link]) to SCARD_S_SUCCESS on success; otherwise, it sets one of the smart card–specific
errors or another error code. No specialized error codes are associated with this method.
None.
62 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
For each context in rgSCardContextList, Cancel is called causing all outstanding messages to be
processed. After there are no more outstanding messages, Release Context is called on each context
and the context MUST be removed from rgSCardContextList.
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 provided that their external behavior is consistent with that described in this
document.
3.2.2 Timers
3.2.3 Initialization
Initialization occurs when the protocol server sends a device-announce message according to
Remote Desktop Protocol: File System Virtual Channel Extension. At that time, dwDeviceId MUST
receive the unique device ID announced. The rgOutstandingMessage field MUST be set to the
empty list.
None.
Messages are constructed according to Remote Desktop Protocol: File System Virtual Channel
Extension as a device I/O control message on the redirected device dwDeviceId. The call packet
MUST follow the format specified in IOCTL Processing Rules. The structure MUST be encoded as
specified in [MS-RPCE] section 2. The output buffer length SHOULD be set to 2,048 bytes.
The message is sent to the protocol server by using a transport as specified in [MS-RDPEFS] section
2.1.
The following steps MUST be applied to each message when they are received.
63 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
Otherwise, the call is considered a failure and the error MUST be propagated to the higher layer.
[Link] Messages
The response message MUST be decoded as Long_Return, as specified in [MS-RPCE] section 2.2.6.
64 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
[Link].11 Sending ForgetReader (Unicode) Message
65 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
ContextAndTwoStringA_Call MUST be initialized, as specified in section [Link], for a
SCARD_IOCTL_ADDREADERTOGROUPA call.
66 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
The OutputBuffer MUST be decoded as ListReaderGroups_Return, as specified in [MS-RPCE] section
2.2.6.
67 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
GetStatusChangeW_Call MUST be initialized, as specified in section [Link].
68 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
[Link].55 Sending Status (ASCII) Message
The OutputBuffer MUST be decoded as Status_Return, as specified in [MS-RPCE] section 2.2.6, and
interpreted as a SCARD_IOCTL_STATUSA return.
The OutputBuffer MUST be decoded as Status_Return, as specified in [MS-RPCE] section 2.2.6, and
interpreted as a SCARD_IOCTL_STATUSW return.
The OutputBuffer MUST be decoded as State_Return, as specified in [MS-RPCE] section 2.2.6, and
interpreted as a SCARD_IOCTL_STATE return.
69 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
Transmit_Call MUST be initialized as specified in section [Link].
70 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
The OutputBuffer MUST be decoded as LocateCards_Return, as specified in [MS-RPCE] section 2.2.6.
71 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
[Link].89 Sending GetReaderIcon Message
None.
None.
72 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
4 Protocol Examples
This example shows the messages sent to perform a simple querying of a card in the TS client
machine. It assumes that a channel has already been set up on the between the TS client and the TS
server. In addition, a PC/SC-compatible resource manager is running on the TS client and there
exists a smart card reader with a smart card inserted. The following figure represents the program
flow.
This representation of the protocol flow is simplified in that there is only one application sending data
over this protocol. In an actual implementation there could be multiple outstanding calls at any time.
73 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
All packets are constructed as specified in sections 3.2.5 and [Link]. The Status field refers to the
IoStatus field as specified in [MS-RDPEFS] section [Link]. The CompletionId field is also specified
in [MS-RDPEFS] section [Link].
The Status field is specified as the IoStatus field in [MS-RDPEFS] section [Link].
74 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
dwEventState = 0
cbAtr = 0
pbAtr = {0} }
}
}
}
75 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
}
76 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
4.15 Disconnect Call
IoControlCode = SCARD_IOCTL_DISCONNECT
CompletionId = 0
HCardAndDisposition_Call = {
hCard = {
Context = { cbContext = 4, pbContext = {0x00,0x00,0x01,0xcd} }
cbHandle = 4
pbHandle = {0x00,0x00,0x01,0xea}}
dwDisposition = SCARD_RESET_CARD
}
77 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
5 Security
This protocol has no security aspects and relies on the underlying transport for any security.
None.
None.
78 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
6 Appendix A: Full IDL
For ease of implementation, the full Interface Definition Language (IDL) is provided below where
[Link] is the IDL as specified in [MS-DTYP] section 5 and [Link] is the IDL as specified in
[MS-DCOM] section 6.
import "[Link]";
import "[Link]";
[
uuid(A35AF600-9CF4-11CD-A076-08002B2BD711),
version(1.0),
pointer_default(unique)
]
interface type_scard_pack
{
//
// Packing for calls that use the same params
//
typedef struct _REDIR_SCARDCONTEXT
{
[range(0, 16)] unsigned long cbContext;
[unique] [size_is(cbContext)] byte *pbContext;
} REDIR_SCARDCONTEXT;
79 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
[string] const char * sz2;
} ContextAndTwoStringA_Call;
//
// Call specific packing
//
typedef struct _EstablishContext_Call
{
unsigned long dwScope;
} EstablishContext_Call;
80 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
typedef struct _GetStatusChangeA_Call
{
REDIR_SCARDCONTEXT Context;
unsigned long dwTimeOut;
[range(0, 11)] unsigned long cReaders;
[size_is(cReaders)] ReaderStateA *rgReaderStates;
} GetStatusChangeA_Call;
81 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
} GetStatusChangeW_Call;
82 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
{
REDIR_SCARDHANDLE hCard;
long fmszReaderNamesIsNULL;
unsigned long cchReaderLen;
unsigned long cbAtrLen;
} Status_Call;
typedef struct _Status_Return
{
long ReturnCode;
[range(0, 65536)] unsigned long cBytes;
[unique] [size_is(cBytes)] byte *mszReaderNames;
unsigned long dwState;
unsigned long dwProtocol;
byte pbAtr[32];
[range(0, 32)] unsigned long cbAtrLen;
} Status_Return;
83 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
typedef struct _GetAttrib_Call
{
REDIR_SCARDHANDLE hCard;
unsigned long dwAttrId;
long fpbAttrIsNULL;
unsigned long cbAttrLen;
} GetAttrib_Call;
84 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
[string] wchar_t * szLookupName;
WriteCache_Common Common;
} WriteCacheW_Call;
}
85 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
7 Appendix B: Product Behavior
The information in this specification is applicable to the following Microsoft products or supplemental
software. References to product versions include updates to those products.
Exceptions, if any, are noted in this section. If an update version, service pack or Knowledge Base
(KB) number appears with a product name, the behavior changed in that update. The new behavior
also applies to subsequent updates 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.7: The Windows XP and Windows Server 2003 versions always use
SCREDIR_VERSION_XP. Windows Vista and Windows Server 2008 are always
SCREDIR_VERSION_LONGHORN. All other versions use SCREDIR_VERSION_WINDOWS_8.
<2> Section 3.1.4: Windows XP and Windows Server 2003 implement function numbers 5 through 58.
Windows Vista, Windows Server 2008, Windows 7, and Windows Server 2008 R2 implement function
numbers 5 through 64. All other versions implement 5 through 66.
86 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
8 Change Tracking
This section identifies changes that were made to this document since the last release. Changes are
classified as Major, Minor, or None.
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:
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 None means that no new technical changes were introduced. Minor editorial and
formatting changes may have been made, but the relevant technical content is identical to the last
released version.
The changes made to this document are listed in the following table. For more information, please
contact dochelp@[Link].
Revision
Section Description
class
87 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
9 Index
A EstablishContext_Call structure 22
EstablishContext_Return structure 37
Abstract data model Events
client 63 local - client 72
server 50 local - server 62
Access_Mode_Flags packet 43 timer - client 72
Applicability 16 timer - server 62
Examples
B begin transaction call 75
begin transaction call example 75
Begin transaction call example 75 begin transaction return 76
Begin transaction return example 76 begin transaction return example 76
connect call 75
C connect call example 75
connect return 75
Capability negotiation 16 connect return example 75
Card_Reader_State packet 42 disconnect call 77
Change tracking 87 disconnect call example 77
Client disconnect return 77
abstract data model 63 disconnect return example 77
higher-layer triggered events 63 end transaction call 76
initialization 63 end transaction call example 76
local events 72 end transaction return 76
message processing 63 end transaction return example 76
Processing Incoming Replies method 63 establish context call 74
Sending Outgoing Messages method 63 establish context call example 74
sequencing rules 63 establish context return 74
structures (section 2.2.1 18, section 2.2.3 36) establish context return example 74
timer events 72 get status change call 74
timers 63 get status change call example 74
Common data types 18 get status change return 75
Connect call example 75 get status change return example 75
Connect return example 75 list reader call example 74
Connect_Common structure 19 list reader return example 74
Connect_Return structure 39 list readers call 74
ConnectA_Call structure 28 list readers return 74
ConnectW_Call structure 28 overview 73
Context_Call structure 22 release context call 77
ContextAndStringA_Call structure 24 release context call example 77
ContextAndStringW_Call structure 24 release context return 77
ContextAndTwoStringA_Call structure 25 release context return example 77
ContextAndTwoStringW_Call structure 26 status call 76
Control_Call structure 32 status call example 76
Control_Return structure 38 status return 76
status return example 76
D
F
Data model - abstract
client 63 Fields - vendor-extensible 16
server 50 Full IDL 79
Data types 18
common - overview 18 G
Disconnect call example 77
Disconnect return example 77 Get status change call example 74
Get status change return example 75
E GetAttrib_Call structure 32
GetAttrib_Return structure 41
End transaction call example 76 GetDeviceTypeId_Call structure 36
End transaction return example 76 GetDeviceTypeId_Return structure 42
Establish context call example 74 GetReaderIcon_Call structure 36
Establish context return example 74 GetReaderIcon_Return structure 41
88 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
GetStatusChange_Return 38 SCARD_IOCTL_BEGINTRANSACTION (IOCTL
GetStatusChangeA_Call structure 27 0x000900BC) 59
GetStatusChangeW_Call structure 28 SCARD_IOCTL_CANCEL (IOCTL 0x000900A8) 59
GetTransmitCount_Call structure 35 SCARD_IOCTL_CONNECTA (IOCTL 0x000900AC)
GetTransmitCount_Return structure 41 59
Glossary 10 SCARD_IOCTL_CONNECTW (IOCTL 0x000900B0)
59
H SCARD_IOCTL_CONTROL (IOCTL 0x000900D4) 60
SCARD_IOCTL_DISCONNECT (IOCTL 0x000900B8)
HCardAndDisposition_Call structure 29 59
Higher-layer triggered events - client 63 SCARD_IOCTL_ENDTRANSACTION (IOCTL
0x000900C0) 59
I SCARD_IOCTL_ESTABLISHCONTEXT (IOCTL
0x00090014) 54
IDL 79 SCARD_IOCTL_FORGETREADERA (IOCTL
Implementer - security considerations 78 0x00090068) 56
Implementers - security considerations 78 SCARD_IOCTL_FORGETREADERGROUPA (IOCTL
Index of security parameters 78 0x00090058) 56
Informative references 13 SCARD_IOCTL_FORGETREADERGROUPW (IOCTL
Initialization 0x0009005C) 56
client 63 SCARD_IOCTL_FORGETREADERW (IOCTL
server 50 0x0009006C) 57
Introduction 10 SCARD_IOCTL_GETATTRIB (IOCTL 0x000900D8)
60
L SCARD_IOCTL_GETDEVICETYPEID (IOCTL
0x00090108) 62
List reader call example 74 SCARD_IOCTL_GETREADERICON (IOCTL
List reader return example 74 0x00090104) 62
List readers call example 74 SCARD_IOCTL_GETSTATUSCHANGEA (IOCTL
List readers return example 74 0x000900A0) 58
ListReaderGroups_Call structure 23 SCARD_IOCTL_GETSTATUSCHANGEW (IOCTL
ListReaderGroups_Return structure 37 0x000900A4) 58
ListReaders_Call structure 23 SCARD_IOCTL_GETTRANSMITCOUNT (IOCTL
ListReaders_Return 37 0x00090100) 61
Local events SCARD_IOCTL_INTRODUCEREADERA (IOCTL
client 72 0x00090060) 56
server 62 SCARD_IOCTL_INTRODUCEREADERGROUPA
LocateCards_ATRMask structure 19 (IOCTL 0x00090050) 55
LocateCards_Return structure 38 SCARD_IOCTL_INTRODUCEREADERGROUPW
LocateCardsA_Call structure 26 (IOCTL 0x00090054) 56
LocateCardsByATRA_Call structure 33 SCARD_IOCTL_INTRODUCEREADERW (IOCTL
LocateCardsByATRW_Call structure 34 0x00090064) 56
LocateCardsW_Call structure 27 SCARD_IOCTL_ISVALIDCONTEXT (IOCTL
Long_Return structure 37 0x0009001C) 54
SCARD_IOCTL_LISTREADERGROUPSA (IOCTL
0x00090020) 55
M
SCARD_IOCTL_LISTREADERGROUPSW (IOCTL
0x00090024) 55
Message processing
SCARD_IOCTL_LISTREADERSA (IOCTL
client 63
0x00090028) 55
server 50
SCARD_IOCTL_LISTREADERSW (IOCTL
Messages
0x0009002C) 55
common data types 18
SCARD_IOCTL_LOCATECARDSA (IOCTL
names 64
0x00090098) 57
overview 18
SCARD_IOCTL_LOCATECARDSBYATRA (IOCTL
processing incoming replies 63
0x000900E8) 58
sending outgoing messages 63
SCARD_IOCTL_LOCATECARDSBYATRW (IOCTL
transport 18
0x000900EC) 58
Methods
SCARD_IOCTL_LOCATECARDSW (IOCTL
Processing Incoming Replies 63
0x0009009C) 58
SCARD_IOCTL_ACCESSSTARTEDEVENT (IOCTL
SCARD_IOCTL_READCACHEA (IOCTL 0x000900F0)
0x000900E0) 54
61
SCARD_IOCTL_ADDREADERTOGROUPA (IOCTL
SCARD_IOCTL_READCACHEW (IOCTL
0x00090070) 57
0x000900F4) 61
SCARD_IOCTL_ADDREADERTOGROUPW (IOCTL
0x00090074) 57
89 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
SCARD_IOCTL_RECONNECT (IOCTL 0x000900B4) Return_Code packet 45
60
SCARD_IOCTL_RELEASECONTEXT (IOCTL S
0x00090018) 54
SCARD_IOCTL_RELEASETARTEDEVENT 62 SCARD_IOCTL_ACCESSSTARTEDEVENT (IOCTL
SCARD_IOCTL_REMOVEREADERFROMGROUPA 0x000900E0) method 54
(IOCTL 0x00090078) 57 SCARD_IOCTL_ADDREADERTOGROUPA (IOCTL
SCARD_IOCTL_REMOVEREADERFROMGROUPW 0x00090070) method 57
(IOCTL 0x0009007C) 57 SCARD_IOCTL_ADDREADERTOGROUPW (IOCTL
SCARD_IOCTL_SETATTRIB (IOCTL 0x000900DC) 0x00090074) method 57
61 SCARD_IOCTL_BEGINTRANSACTION (IOCTL
SCARD_IOCTL_STATE (IOCTL 0x000900C4) 61 0x000900BC) method 59
SCARD_IOCTL_STATUSA (IOCTL 0x000900C8) 60 SCARD_IOCTL_CANCEL (IOCTL 0x000900A8)
SCARD_IOCTL_STATUSW (IOCTL 0x000900CC) 60 method 59
SCARD_IOCTL_TRANSMIT (IOCTL 0x000900D0) SCARD_IOCTL_CONNECTA (IOCTL 0x000900AC)
60 method 59
SCARD_IOCTL_WRITECACHEA (IOCTL SCARD_IOCTL_CONNECTW (IOCTL 0x000900B0)
0x000900F8) 62 method 59
SCARD_IOCTL_WRITECACHEW (IOCTL SCARD_IOCTL_CONTROL (IOCTL 0x000900D4)
0x000900FC) 62 method 60
Sending Outgoing Messages 63 SCARD_IOCTL_DISCONNECT (IOCTL 0x000900B8)
method 59
N SCARD_IOCTL_ENDTRANSACTION (IOCTL
0x000900C0) method 59
Normative references 12 SCARD_IOCTL_ESTABLISHCONTEXT (IOCTL
0x00090014) method 54
O SCARD_IOCTL_FORGETREADERA (IOCTL
0x00090068) method 56
Outgoing messages - sending 63 SCARD_IOCTL_FORGETREADERGROUPA (IOCTL
Overview (synopsis) 13 0x00090058) method 56
SCARD_IOCTL_FORGETREADERGROUPW (IOCTL
P 0x0009005C) method 56
SCARD_IOCTL_FORGETREADERW (IOCTL
Parameters - security 78 0x0009006C) method 57
Parameters - security index 78 SCARD_IOCTL_GETATTRIB (IOCTL 0x000900D8)
Preconditions 15 method 60
Prerequisites 15 SCARD_IOCTL_GETDEVICETYPEID (IOCTL
Processing Incoming Replies method 63 0x00090108) method 62
Product behavior 86 SCARD_IOCTL_GETREADERICON (IOCTL
Protocol Details 0x00090104) method 62
overview 50 SCARD_IOCTL_GETSTATUSCHANGEA (IOCTL
Protocol_Identifier packet 42 0x000900A0) method 58
SCARD_IOCTL_GETSTATUSCHANGEW (IOCTL
R 0x000900A4) method 58
SCARD_IOCTL_GETTRANSMITCOUNT (IOCTL
ReadCache_Common structure 21 0x00090100) method 61
ReadCache_Return structure 36 SCARD_IOCTL_INTRODUCEREADERA (IOCTL
ReadCacheA_Call structure 34 0x00090060) method 56
ReadCacheW_Call structure 34 SCARD_IOCTL_INTRODUCEREADERGROUPA (IOCTL
Reader_State packet 44 0x00090050) method 55
ReaderState_Common_Call structure 19 SCARD_IOCTL_INTRODUCEREADERGROUPW (IOCTL
ReaderState_Return structure 21 0x00090054) method 56
ReaderStateA structure 20 SCARD_IOCTL_INTRODUCEREADERW (IOCTL
ReaderStateW structure 20 0x00090064) method 56
Reconnect_Call structure 28 SCARD_IOCTL_ISVALIDCONTEXT (IOCTL
Reconnect_Return structure 38 0x0009001C) method 54
REDIR_SCARDCONTEXT structure 18 SCARD_IOCTL_LISTREADERGROUPSA (IOCTL
REDIR_SCARDHANDLE structure 18 0x00090020) method 55
References 12 SCARD_IOCTL_LISTREADERGROUPSW (IOCTL
informative 13 0x00090024) method 55
normative 12 SCARD_IOCTL_LISTREADERSA (IOCTL 0x00090028)
Relationship to other protocols 15 method 55
Release context call example 77 SCARD_IOCTL_LISTREADERSW (IOCTL
Release context return example 77 0x0009002C) method 55
Replies - processing 63
90 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
SCARD_IOCTL_LOCATECARDSA (IOCTL SCARD_IOCTL_DISCONNECT (IOCTL 0x000900B8)
0x00090098) method 57 method 59
SCARD_IOCTL_LOCATECARDSBYATRA (IOCTL SCARD_IOCTL_ENDTRANSACTION (IOCTL
0x000900E8) method 58 0x000900C0) method 59
SCARD_IOCTL_LOCATECARDSBYATRW (IOCTL SCARD_IOCTL_ESTABLISHCONTEXT (IOCTL
0x000900EC) method 58 0x00090014) method 54
SCARD_IOCTL_LOCATECARDSW (IOCTL SCARD_IOCTL_FORGETREADERA (IOCTL
0x0009009C) method 58 0x00090068) method 56
SCARD_IOCTL_READCACHEA (IOCTL 0x000900F0) SCARD_IOCTL_FORGETREADERGROUPA (IOCTL
method 61 0x00090058) method 56
SCARD_IOCTL_READCACHEW (IOCTL 0x000900F4) SCARD_IOCTL_FORGETREADERGROUPW (IOCTL
method 61 0x0009005C) method 56
SCARD_IOCTL_RECONNECT (IOCTL 0x000900B4) SCARD_IOCTL_FORGETREADERW (IOCTL
method 60 0x0009006C) method 57
SCARD_IOCTL_RELEASECONTEXT (IOCTL SCARD_IOCTL_GETATTRIB (IOCTL 0x000900D8)
0x00090018) method 54 method 60
SCARD_IOCTL_RELEASETARTEDEVENT method 62 SCARD_IOCTL_GETDEVICETYPEID (IOCTL
SCARD_IOCTL_REMOVEREADERFROMGROUPA 0x00090108) method 62
(IOCTL 0x00090078) method 57 SCARD_IOCTL_GETREADERICON (IOCTL
SCARD_IOCTL_REMOVEREADERFROMGROUPW 0x00090104) method 62
(IOCTL 0x0009007C) method 57 SCARD_IOCTL_GETSTATUSCHANGEA (IOCTL
SCARD_IOCTL_SETATTRIB (IOCTL 0x000900DC) 0x000900A0) method 58
method 61 SCARD_IOCTL_GETSTATUSCHANGEW (IOCTL
SCARD_IOCTL_STATE (IOCTL 0x000900C4) method 0x000900A4) method 58
61 SCARD_IOCTL_GETTRANSMITCOUNT (IOCTL
SCARD_IOCTL_STATUSA (IOCTL 0x000900C8) 0x00090100) method 61
method 60 SCARD_IOCTL_INTRODUCEREADERA (IOCTL
SCARD_IOCTL_STATUSW (IOCTL 0x000900CC) 0x00090060) method 56
method 60 SCARD_IOCTL_INTRODUCEREADERGROUPA
SCARD_IOCTL_TRANSMIT (IOCTL 0x000900D0) (IOCTL 0x00090050) method 55
method 60 SCARD_IOCTL_INTRODUCEREADERGROUPW
SCARD_IOCTL_WRITECACHEA (IOCTL 0x000900F8) (IOCTL 0x00090054) method 56
method 62 SCARD_IOCTL_INTRODUCEREADERW (IOCTL
SCARD_IOCTL_WRITECACHEW (IOCTL 0x000900FC) 0x00090064) method 56
method 62 SCARD_IOCTL_ISVALIDCONTEXT (IOCTL
ScardAccessStartedEvent_Call packet 35 0x0009001C) method 54
SCardIO_Request structure 20 SCARD_IOCTL_LISTREADERGROUPSA (IOCTL
Security 78 0x00090020) method 55
implementer considerations 78 SCARD_IOCTL_LISTREADERGROUPSW (IOCTL
parameter index 78 0x00090024) method 55
Sending Outgoing Messages method 63 SCARD_IOCTL_LISTREADERSA (IOCTL
Sequencing rules 0x00090028) method 55
client 63 SCARD_IOCTL_LISTREADERSW (IOCTL
server 50 0x0009002C) method 55
Server SCARD_IOCTL_LOCATECARDSA (IOCTL
abstract data model 50 0x00090098) method 57
initialization 50 SCARD_IOCTL_LOCATECARDSBYATRA (IOCTL
local events 62 0x000900E8) method 58
message processing 50 SCARD_IOCTL_LOCATECARDSBYATRW (IOCTL
SCARD_IOCTL_ACCESSSTARTEDEVENT (IOCTL 0x000900EC) method 58
0x000900E0) method 54 SCARD_IOCTL_LOCATECARDSW (IOCTL
SCARD_IOCTL_ADDREADERTOGROUPA (IOCTL 0x0009009C) method 58
0x00090070) method 57 SCARD_IOCTL_READCACHEA (IOCTL 0x000900F0)
SCARD_IOCTL_ADDREADERTOGROUPW (IOCTL method 61
0x00090074) method 57 SCARD_IOCTL_READCACHEW (IOCTL
SCARD_IOCTL_BEGINTRANSACTION (IOCTL 0x000900F4) method 61
0x000900BC) method 59 SCARD_IOCTL_RECONNECT (IOCTL 0x000900B4)
SCARD_IOCTL_CANCEL (IOCTL 0x000900A8) method 60
method 59 SCARD_IOCTL_RELEASECONTEXT (IOCTL
SCARD_IOCTL_CONNECTA (IOCTL 0x000900AC) 0x00090018) method 54
method 59 SCARD_IOCTL_RELEASETARTEDEVENT method 62
SCARD_IOCTL_CONNECTW (IOCTL 0x000900B0) SCARD_IOCTL_REMOVEREADERFROMGROUPA
method 59 (IOCTL 0x00090078) method 57
SCARD_IOCTL_CONTROL (IOCTL 0x000900D4) SCARD_IOCTL_REMOVEREADERFROMGROUPW
method 60 (IOCTL 0x0009007C) method 57
91 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018
SCARD_IOCTL_SETATTRIB (IOCTL 0x000900DC)
method 61
SCARD_IOCTL_STATE (IOCTL 0x000900C4)
method 61
SCARD_IOCTL_STATUSA (IOCTL 0x000900C8)
method 60
SCARD_IOCTL_STATUSW (IOCTL 0x000900CC)
method 60
SCARD_IOCTL_TRANSMIT (IOCTL 0x000900D0)
method 60
SCARD_IOCTL_WRITECACHEA (IOCTL
0x000900F8) method 62
SCARD_IOCTL_WRITECACHEW (IOCTL
0x000900FC) method 62
sequencing rules 50
structures (section 2.2.1 18, section 2.2.2 22)
timer events 62
timers 50
SetAttrib_Call structure 33
Standards assignments 16
State_Call structure 30
State_Return structure 39
Status call example 76
Status return example 76
Status_Call structure 30
Status_Return structure 39
Structures
client (section 2.2.1 18, section 2.2.3 36)
server (section 2.2.1 18, section 2.2.2 22)
Timer events
client 72
server 62
Timers
client 63
server 50
Tracking changes 87
Transmit_Call structure 31
Transmit_Return structure 40
Transport 18
Transport - message 18
Triggered events - higher-layer - client 63
Vendor-extensible fields 16
Versioning 16
WriteCache_Common structure 21
WriteCacheA_Call structure 35
WriteCacheW_Call structure 35
92 / 92
[MS-RDPESC] - v20180912
Remote Desktop Protocol: Smart Card Virtual Channel Extension
Copyright © 2018 Microsoft Corporation
Release: September 12, 2018