Fix Win7 RDP PDU and bitmap stride handling#1408
Conversation
There was a problem hiding this comment.
Pull request overview
This PR targets two Windows 7 RDP interoperability issues in ironrdp-session. First, it handles the case where a Win7 server concatenates multiple Share Control PDUs inside a single MCS Send Data Indication on the I/O channel by iterating over each sub-PDU. Second, it fixes bitmap rendering when the server sends bitmap data whose per-row stride (source width) is wider than the destination rectangle width, by introducing a normalize_bitmap_rows helper that repacks rows to the destination width before handing data to the apply_* functions.
Changes:
- Add
process_io_channel_data_indicationto split and process concatenated Share Control PDUs on the I/O channel. - Add
normalize_bitmap_rowshelper and route all compressed (RDP6/RLE) and uncompressed bitmap paths through it to strip stride padding / extra columns down to the destination rectangle width. - Replace the previous inline row-padding-stripping logic in the uncompressed path with the shared helper.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
crates/ironrdp-session/src/x224/mod.rs |
Routes I/O-channel data through a new PDU-splitting method; splitting assumes a Share Control Header and mis-handles Multitransport Request PDUs. |
crates/ironrdp-session/src/fast_path.rs |
Adds normalize_bitmap_rows and uses it across all bitmap color-depth paths to normalize source stride to the destination rectangle width. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| let total_length = usize::from(u16::from_le_bytes([data[offset], data[offset + 1]])); | ||
| if total_length == 0 || offset + total_length > data.len() { | ||
| if offset == 0 { | ||
| return self.process_io_channel(data_ctx); | ||
| } | ||
| return Err(reason_err!( | ||
| "X224", | ||
| "invalid concatenated Share Control PDU length: {total_length}" | ||
| )); | ||
| } |
Benoît Cortier (CBenoit)
left a comment
There was a problem hiding this comment.
Thank you for the PR!
|
|
||
| const DEFAULT_POINTER_CACHE_SIZE: u16 = 32; | ||
|
|
||
| /// 中文注释:根据连接配置和服务端能力生成 Client Confirm Active,legacy 图形模式会跳过增强 surface 能力。 |
There was a problem hiding this comment.
Could you translate the comments in English? Not many of us understands Chinese. Thanks! 🙂
No description provided.