ironrdp-rdpdr crate implements the RDPDR static virtual channel for device redirection as specified in MS-RDPEFS. This channel enables redirection of local devices (drives, smartcards, printers, ports) to the remote session.
The RDPDR channel must always be advertised alongside the “rdpsnd” channel for the server to send anything back to it. See MS-RDPEFS Appendix A<1>.
Overview
The RDPDR channel multiplexes multiple device types over a single virtual channel. It handles device announcement, capability negotiation, and device-specific I/O operations.Core Types
Rdpdr
The main processor for the RDPDR channel.ironrdp-rdpdr/src/lib.rs:34
Configuration Methods:
with_smartcard(device_id: u32) -> Self- Adds smartcard redirection capabilitywith_drives(initial_drives: Option<Vec<(u32, String)>>) -> Self- Adds drive redirection capabilityadd_drive(device_id: u32, name: String) -> ClientDeviceListAnnounce- Dynamically announces a new driveremove_device(device_id: u32) -> Option<ClientDeviceListRemove>- Removes a device
Device Types
Supported device types:Usage Examples
Basic Setup
Drive Redirection
Smartcard Redirection
Backend Interface
RdpdrBackend
The backend trait handles device-specific I/O operations:ironrdp-rdpdr/src/backend.rs:1
NoopRdpdrBackend
A no-operation backend implementation for testing:Protocol Flow
Initialization Sequence
- Server Announce: Server sends
VersionAndIdPduwithServerAnnounceRequest - Client Announce: Client responds with
ClientAnnounceReplyandClientNameRequest - Capabilities Exchange: Server sends
CoreCapabilityrequest, client responds - Client ID Confirm: Server sends confirmation, client responds with
ClientDeviceListAnnounce - Device Responses: Server sends
ServerDeviceAnnounceResponsefor each device
Drive I/O Operations
For filesystem devices, the channel supports:DeviceCreate- Open files/directoriesDeviceClose- Close file handlesDeviceRead- Read file dataDeviceWrite- Write file dataQueryInformation- Get file metadataSetInformation- Set file metadataQueryDirectory- List directory contentsQueryVolumeInformation- Get volume information
Smartcard Operations
For smartcard devices:ScardEstablishContext- Initialize smartcard contextScardListReaders- List available readersScardConnect- Connect to a cardScardTransmit- Send APDU to cardScardDisconnect- Disconnect from cardScardReleaseContext- Release context
PDU Modules
The crate organizes PDUs into submodules:pdu::efs
Enhanced File System (EFS) redirection PDUs from MS-RDPEFS:
ClientDeviceListAnnounce- Announce devices to serverServerDeviceAnnounceResponse- Server response to device announcementDeviceIoRequest- Generic I/O request structureServerDriveIoRequest- Drive-specific I/O operationsCapabilities- Client/server capabilities
pdu::esc
Smartcard redirection PDUs from MS-RDPESC:
ScardCall- Smartcard API call typesScardIoCtlCode- I/O control codes for smartcard operations- Device control request/response structures
Directory Display
When directories are shared:computer_name field passed to Rdpdr::new().
Related Crates
- ironrdp-rdpdr-native: Native platform implementations for drive and device redirection
- ironrdp-svc: Static virtual channel infrastructure
- ironrdp-pdu: Protocol data unit encoding/decoding

