xnetworking: add RAII guards for CryptoAPI handles, document unsafe invariants, and split tests #342
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!342
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/342/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?
@pawelsicinski on GitHub · 2026-11-23 23:59 UTC · original
pawelsicinski:main→main· +8678 −0 · 5 files · 2 commits · closed without mergingFollow up on
docs/xnetworking-rust-review.mdforcrates/xcl/src/hle/xgameruntime/networking.rs: wrap owned Windows CryptoAPI certificate/chain handles in RAII guards, document FFI# Safetypreconditions and// SAFETY:justifications, and move unit tests into a dedicated test file.What is in it
CertContextGuardandCertChainGuard<'a>RAII wrappers incrates/xcl/src/hle/xgameruntime/networking.rsand refactorXNetworkingVerifyServerCertificateto releaseCERT_CHAIN_CONTEXTandCERT_CONTEXTautomatically on every return path.# Safetydoc sections to exportedpub unsafefunctions and// SAFETY:comments to unsafe FFI/pointer operations innetworking.rs.#[cfg(test)] mod testsblock intocrates/xcl/src/hle/xgameruntime/networking_tests.rs(via#[path = "networking_tests.rs"]), matchingadapter_tests.rs/agility_tests.rs.raii_guards_drop_chain_before_contextcovering null-pointer handling and reverse drop order (chainfreed beforecontext).Tested
networking.rsandnetworking_tests.rs(no local Rust toolchain on the authoring machine yet; pending CI / Windowscargo testrun).Regression run
main:
(pending — not run yet; requires
scripts/smoke.ps1on a Windows machine with Rust and a title)PR:
(pending — not run yet)
Not tested
cargo build --workspaceandcargo test --workspace(nocargo/rustcinstalled on this machine).scripts/smoke.ps1regression run on a real title.AI use
# Safety/// SAFETY:comments, test file split, and new unit test.@futurepro62 on GitHub · 2026-11-24 03:47 UTC · original
Tested exact head
045751d(on its base21b8723).Tested
cargo build --workspace, thenXCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4: 656 passed, 0 failed, 40 ignored. SKIPPED (no wave64):gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware.Not tested
scripts/smoke.ps1(no title on this machine), AMD, a release build. I did not review the diff.AI use
@upipibi on GitHub · 2026-11-24 06:00 UTC · original
Full-suite run on this PR's head
045751d, since the description says the authoring machine had no Rust toolchain yet:Tested
cargo build --workspacethencargo test --workspace --no-fail-fast -- --test-threads=4: 656 passed, 0 failed, 40 ignored (17 test binaries, the e2e title included). It builds and every test passes on this head; the networking tests innetworking_tests.rsare among them.gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware(no wave64)Not tested: AMD / wave64; no retail title. This PR changes runtime files (
networking.rs,present.rs), so it still needs thexcl-smokepair.AI-assisted (Claude Code).
@raylitebull on GitHub · 2026-11-24 10:42 UTC · original
Closing because this diff adds ~8,678 lines of duplicated source files at the repository root instead of editing
crates/xcl/src/. Feel free to reopen a clean PR modifying the files undercrates/xcl/src/.Pull request closed