xnetworking: stop copying struct padding in default_security_info_bytes #75
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/76"
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?
Imported from ivall/xcl. Originally posted by certified-retart on 2026-11-23T01:17:39Z.
Summary
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.mainreaches on Windows; the obstacle is replaced vtables — proposal: proxies #172Imported from ivall/xcl. Originally posted by ivall on 2026-11-23T10:29:30Z.
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!mainreaches on Windows; the obstacle is replaced vtables — proposal: proxies #172