Skip to content

Commit 84ddffa

Browse files
committed
feat(connector): expose SUPPORT_DYN_VC_GFX_PROTOCOL early-cap flag for EGFX clients
Currently, `early_capability_flags` in the GCC core data is built from a fixed set in `connection.rs`. Clients that want to use the Graphics Pipeline Extension (MS-RDPEGFX) — by attaching a DvcClientProcessor for `Microsoft::Windows::RDS::Graphics` — have no way to set `SUPPORT_DYN_VC_GFX_PROTOCOL` without forking the connector, and modern Windows servers won't open the EGFX channel unless the client advertises support. This commit adds an opt-in `Config.support_dyn_vc_gfx_protocol: bool` (default `false`). When set, the flag is OR'd into `early_capability_flags` alongside the existing `WANT_32_BPP_SESSION` conditional. Existing consumers are unaffected; the doc comment includes a safety note that setting this without an EGFX implementation will cause Windows to stop sending legacy bitmap updates, leaving the desktop blank. Used downstream by Haven (an Android RDP/VNC client) which implements EGFX with ClearCodec + RemoteFxProgressive decoders; this lets us drop the vendored ironrdp-connector fork. Default `false` to preserve current behaviour.
1 parent 0282d18 commit 84ddffa

8 files changed

Lines changed: 38 additions & 0 deletions

File tree

crates/ironrdp-client/src/config.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -763,6 +763,7 @@ impl PartialConfig {
763763
request_data: None,
764764
pointer_software_rendering: false,
765765
multitransport_flags: None,
766+
support_dyn_vc_gfx_protocol: false,
766767
compression_type,
767768
performance_flags: PerformanceFlags::default(),
768769
timezone_info: TimezoneInfo::default(),

crates/ironrdp-connector/src/connection.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -703,6 +703,10 @@ fn create_gcc_blocks<'a>(
703703
early_capability_flags |= ClientEarlyCapabilityFlags::WANT_32_BPP_SESSION;
704704
}
705705

706+
if config.support_dyn_vc_gfx_protocol {
707+
early_capability_flags |= ClientEarlyCapabilityFlags::SUPPORT_DYN_VC_GFX_PROTOCOL;
708+
}
709+
706710
Some(early_capability_flags)
707711
},
708712
dig_product_id: Some(config.dig_product_id.clone()),

crates/ironrdp-connector/src/lib.rs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,34 @@ pub struct Config {
258258
/// [\[MS-RDPBCGR\] 2.2.1.3.7]: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-rdpbcgr/861f2bbb-6ca2-4c5a-8c44-0714fa901e70
259259
/// [`MultiTransportChannelData`]: ironrdp_pdu::gcc::MultiTransportChannelData
260260
pub multitransport_flags: Option<gcc::MultiTransportFlags>,
261+
262+
/// Advertise client support for the Graphics Pipeline Extension
263+
/// (MS-RDPEGFX) over the Dynamic Virtual Channel.
264+
///
265+
/// When `true`, the `SUPPORT_DYN_VC_GFX_PROTOCOL` flag is set in
266+
/// [`ClientEarlyCapabilityFlags`], telling the server it may
267+
/// negotiate the `Microsoft::Windows::RDS::Graphics` channel for
268+
/// surface-based graphics updates instead of (or in addition to)
269+
/// the legacy slow-path bitmap protocol.
270+
///
271+
/// Setting this **without** wiring an EGFX-capable
272+
/// [`DvcClientProcessor`] for that channel will cause modern
273+
/// Windows servers to stop sending legacy bitmap updates and
274+
/// route everything over EGFX — which the connector consumer
275+
/// can't decode, leaving the desktop blank. To enable EGFX:
276+
///
277+
/// 1. Set this field to `true`.
278+
/// 2. Attach a [`DvcClientProcessor`] for
279+
/// `Microsoft::Windows::RDS::Graphics` via
280+
/// [`ClientConnector::with_static_channel`] +
281+
/// [`ironrdp_dvc::DrdynvcClient::with_dynamic_channel`].
282+
/// 3. Decode `ironrdp_pdu::rdp::vc::dvc::gfx::ServerPdu` and
283+
/// paint the surfaces.
284+
///
285+
/// Default: `false` (legacy slow-path bitmap only).
286+
///
287+
/// [`DvcClientProcessor`]: https://docs.rs/ironrdp-dvc/latest/ironrdp_dvc/trait.DvcClientProcessor.html
288+
pub support_dyn_vc_gfx_protocol: bool,
261289
}
262290

263291
ironrdp_core::assert_impl!(Config: Send, Sync);

crates/ironrdp-testsuite-core/tests/session/autodetect.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ fn test_config() -> ironrdp_connector::Config {
5353
enable_server_pointer: false,
5454
pointer_software_rendering: false,
5555
multitransport_flags: None,
56+
support_dyn_vc_gfx_protocol: false,
5657
performance_flags: Default::default(),
5758
timezone_info: Default::default(),
5859
alternate_shell: String::new(),

crates/ironrdp-testsuite-extra/tests/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,7 @@ fn default_client_config() -> connector::Config {
392392
enable_server_pointer: true,
393393
pointer_software_rendering: true,
394394
multitransport_flags: None,
395+
support_dyn_vc_gfx_protocol: false,
395396
performance_flags: Default::default(),
396397
timezone_info: Default::default(),
397398
alternate_shell: String::new(),

crates/ironrdp-web/src/session.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1426,6 +1426,7 @@ fn build_config(
14261426
request_data: None,
14271427
pointer_software_rendering: false,
14281428
multitransport_flags: None,
1429+
support_dyn_vc_gfx_protocol: false,
14291430
performance_flags: PerformanceFlags::default(),
14301431
desktop_scale_factor: 0,
14311432
hardware_id: None,

crates/ironrdp/examples/screenshot.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,7 @@ fn build_config(
265265
compression_type,
266266
pointer_software_rendering: true,
267267
multitransport_flags: None,
268+
support_dyn_vc_gfx_protocol: false,
268269
performance_flags: PerformanceFlags::default(),
269270
desktop_scale_factor: 0,
270271
hardware_id: None,

ffi/src/connector/config.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ pub mod ffi {
216216
compression_type: None,
217217
pointer_software_rendering: self.pointer_software_rendering.unwrap_or(false),
218218
multitransport_flags: None,
219+
support_dyn_vc_gfx_protocol: false,
219220
performance_flags: self.performance_flags.ok_or("performance flag is missing")?,
220221
desktop_scale_factor: 0,
221222
hardware_id: None,

0 commit comments

Comments
 (0)