feat(connector): expose the server's Input capability flags on ConnectionResult - #1488
Merged
Marc-André Moreau (mamoreau-devolutions) merged 1 commit intoJul 31, 2026
Conversation
…tionResult Per MS-RDPBCGR 2.2.8.1.2, a client must not send fast-path input events unless the server advertised INPUT_FLAG_FASTPATH_INPUT or INPUT_FLAG_FASTPATH_INPUT2 in its Input Capability Set. Some servers enforce this: VirtualBox's VRDP closes the connection outright on receiving a 4-byte fast-path scancode PDU, because it never advertises fast-path input (its Demand Active offers InputFlags(SCANCODES) alone). Client code could not honour the requirement because the connector discarded the server's capability sets after Demand Active. Capture the Input capability flags during capabilities exchange, carry them through the ConnectionFinalization/Finalized activation states, and surface them as ConnectionResult::input_flags so the session layer can choose between fast-path and slow-path input.
Marc-André Moreau (mamoreau-devolutions)
approved these changes
Jul 31, 2026
Marc-André Moreau (mamoreau-devolutions)
merged commit Jul 31, 2026
9bcf134
into
Devolutions:master
22 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Per [MS-RDPBCGR] 2.2.8.1.2, a client must not send fast-path input events unless the server advertised
INPUT_FLAG_FASTPATH_INPUTorINPUT_FLAG_FASTPATH_INPUT2in its Input Capability Set. Today the connector discards the server's capability sets after Demand Active, so client code has no way to honour that requirement.This PR captures the server's Input capability flags during capabilities exchange, carries them through the
ConnectionFinalization/Finalizedactivation states (so they are refreshed correctly across a Deactivation-Reactivation Sequence too), and surfaces them asConnectionResult::input_flags. The session layer can then choose between fast-path and slow-path input per server.Motivation / real-world interop
This is not theoretical: VirtualBox's VRDP server closes the connection outright on receiving a fast-path input PDU — its
VBox.logreports(a single fast-path scancode event is a 4-byte packet). VirtualBox never advertises fast-path input; its Demand Active offers
InputFlags(SCANCODES)alone. mstsc and FreeRDP honour the negotiation and fall back to slow-pathTS_INPUT_PDUs, which is why they work against VRDE.Haven (Android RDP client built on IronRDP) has been shipping this exact change as a vendored-connector patch since v5.86.1, with the slow-path fallback keyed off
ConnectionResult::input_flags. Verified against a real VirtualBox 7.2.6 VRDE server: before the gate, the first arrow-key press killed the session with the log line above; with the gate, extended input sessions run clean, and a fast-path-capable server on the same host still takes the fast-path branch. (Discussed in #1158; this is the third and last piece Haven carries in its connector fork, alongside #1237 and #1472.)Changes
connection_activation.rs: captureinput_flagsfrom theCapabilitySet::Inputin Server Demand Active (empty if absent); add the field toConnectionActivationState::{ConnectionFinalization, Finalized}.connection.rs: addConnectionResult::input_flags, populated from theFinalizedstate.ironrdp-client,ironrdp-web, ffi, and the e2e test updated for the new variant field (all currently ignore it).Testing
ironrdp-testsuite-core/tests/session/connection_activation.rs: the fixture's Demand Active yieldsSCANCODES | MOUSEX | UNICODE | FASTPATH_INPUT_2in theConnectionFinalizationstate, and a Demand Active with the Input capability stripped yieldsInputFlags::empty().cargo check --workspace --all-targets,cargo clippy --workspace --all-targets, andcargo fmt --checkare clean; the 7 activation tests pass.