Skip to content

feat(connector): expose the server's Input capability flags on ConnectionResult - #1488

Merged
Marc-André Moreau (mamoreau-devolutions) merged 1 commit into
Devolutions:masterfrom
GlassOnTin:feat/expose-server-input-flags
Jul 31, 2026
Merged

feat(connector): expose the server's Input capability flags on ConnectionResult#1488
Marc-André Moreau (mamoreau-devolutions) merged 1 commit into
Devolutions:masterfrom
GlassOnTin:feat/expose-server-input-flags

Conversation

@GlassOnTin

Copy link
Copy Markdown
Contributor

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. 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/Finalized activation states (so they are refreshed correctly across a Deactivation-Reactivation Sequence too), and surfaces them as ConnectionResult::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.log reports

VRDP: Network packet length is incorrect 0x0004. Closing connection.

(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-path TS_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: capture input_flags from the CapabilitySet::Input in Server Demand Active (empty if absent); add the field to ConnectionActivationState::{ConnectionFinalization, Finalized}.
  • connection.rs: add ConnectionResult::input_flags, populated from the Finalized state.
  • Call sites in ironrdp-client, ironrdp-web, ffi, and the e2e test updated for the new variant field (all currently ignore it).

Testing

  • Two new integration tests in ironrdp-testsuite-core/tests/session/connection_activation.rs: the fixture's Demand Active yields SCANCODES | MOUSEX | UNICODE | FASTPATH_INPUT_2 in the ConnectionFinalization state, and a Demand Active with the Input capability stripped yields InputFlags::empty().
  • cargo check --workspace --all-targets, cargo clippy --workspace --all-targets, and cargo fmt --check are clean; the 7 activation tests pass.

…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.
@mamoreau-devolutions
Marc-André Moreau (mamoreau-devolutions) merged commit 9bcf134 into Devolutions:master Jul 31, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants