xnetworking: stop copying struct padding in default_security_info_bytes #76
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!76
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/76/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@certified-retart on GitHub · 2026-11-23 01:17 UTC · original
certified-retart:fix/xnetworking-security-info-padding→main· +33 −16 · 1 files · 1 commits · merged 2026-11-23 10:29 UTCSummary
Implements the first change requested in
docs/xnetworking-rust-review.md: stop copying uninitialized#[repr(C)]struct padding indefault_security_info_bytes.What changed
default_security_info_bytes(crates/xcl/src/hle/xgameruntime/networking.rs):unsaferaw struct byte copy (which read uninitialized padding bytes betweenenabled_http_security_protocol_flags: u32andthumbprint_count: usize) with a safe zero-initializedVec<u8>sized tosize_of::<XNetworkingSecurityInformation>(), writingDEFAULT_TLS_FLAGS.to_le_bytes()atoffset_of!(XNetworkingSecurityInformation, enabled_http_security_protocol_flags).thumbprint_count == 0, a nullthumbprintspointer, and deterministic zero padding on x86_64 Windows.crates/xcl/src/hle/xgameruntime/networking.rs):security_info_utf8_and_utf16_follow_gdk_arg_orderto use storage properly aligned toXNetworkingSecurityInformation(pre-filled with non-zero sentinels0xAA/0x55) and assert all three fields (enabled_http_security_protocol_flags,thumbprint_count == 0,thumbprints.is_null()) for both UTF-8 and UTF-16.default_security_info_bytes_zeroes_padding_and_fieldsverifying exact byte length,DEFAULT_TLS_FLAGSat the field offset, and zero bytes everywhere else.Verification
rustc 1.100.0(x86_64-pc-windows-msvc), Windows 10 Pro10.0.19045.cargo test -p xcl --lib hle::xgameruntime::networking: 6 passed, 0 failed.@ivall on GitHub · 2026-11-23 10:29 UTC · original
Merged. Tested on Windows 11 with an RX 9070 (RDNA4):
cargo test --workspacegreen with the retail samples (shader pack, console DLLs, texture archive), also withXCL_SPLIT_WAVE64=1(the 32-lane split path forced on RDNA). Unicorn Overlord and XDefiant run with this round merged. Thanks!