RDPDR_DTYP_SMARTCARD device over the rdpdr SVC, allowing applications on the RDP server to use PCSC-connected smartcards on the client machine.
Channel: rdpdr (Device Redirection Virtual Channel)Device type:
RDPDR_DTYP_SMARTCARD
Client implementation: channels/smartcard/client/Header:
<winpr/smartcard.h> (WinPR PCSC abstraction)
Build Requirements
Smartcard redirection requires PC/SC middleware headers and libraries.On macOS, the system PCSC framework (
PCSC/winscard.h) is used automatically when WITH_PCSC=ON.Activating Smartcard Redirection
Enable the smartcard device on the client via the command line:rdpdr client plugin detects the /smartcard option and registers a SMARTCARD_DEVICE entry in the device list that gets announced to the server.
SMARTCARD_DEVICE Structure
SMARTCARD_CONTEXT represents one active PCSC context opened by a server application:
Server-Side Callbacks (via RdpdrServerContext)
The server side uses theRdpdrServerContext smartcard hooks from <freerdp/server/rdpdr.h>:
RDPDR_DTYP_SMARTCARD) is announced by the client. The server can record device->DeviceId and open a PCSC context targeting the redirected reader.Protocol Flow
Device announcement
The RDPDR client plugin announces the smartcard as
RDPDR_DTYP_SMARTCARD. The server’s OnSmartcardCreate callback fires.PCSC context setup
Server applications call
SCardEstablishContext() which the WinPR PCSC shim translates to [MS-RDPESC] Establish_Call IRPs forwarded to the client.Card operations
Each PCSC call (
SCardConnect, SCardTransmit, SCardBeginTransaction, etc.) becomes an IRP. The client executes the call against the real local PCSC daemon and returns the result.Supported PCSC Operations
The FreeRDP smartcard channel supports the full [MS-RDPESC] operation set including:SCardEstablishContext/SCardReleaseContextSCardConnect/SCardReconnect/SCardDisconnectSCardBeginTransaction/SCardEndTransactionSCardTransmit— APDUs for card communicationSCardStatus/SCardGetStatusChangeSCardListReaders/SCardListCardsSCardGetAttrib/SCardSetAttrib
