HLE: implement remaining XNetworking UDP port-change and UTF-16 security slots #851

Open
opened 2026-11-24 12:27:46 +00:00 by geiyiliyabumo · 1 comment
geiyiliyabumo commented 2026-11-24 12:27:46 +00:00 (Migrated from github.com)
Contributor

Imported from Marvisak/VIctory. Originally posted by geiyiliyabumo on 2026-11-24T12:27:46Z.


Summary

Implements the 5 remaining missing::<N> vtable slots (0x30, 0x38, 0x58, 0x60, 0x68) in crates/victory-hle/src/modules/xnetworking.rs for the offline Xbox XNetworking service, plus 4 deterministic unit tests.

Because external PR creation is currently restricted (collaborators_only), the CI-green branch is ready on my fork for cherry-pick / review:

  • Branch: geiyiliyabumo/VIctory@feat/xnetworking-udp-and-utf16-slots
  • Commit: geiyiliyabumo/VIctory@36ae257 (based on main ffe310e)

Changes (crates/victory-hle/src/modules/xnetworking.rs)

  • Preferred local UDP port change callbacks (slots 0x30 / 0x38):
    • Wired 0x30 (XNetworkingRegisterPreferredLocalUdpMultiplayerPortChanged) to register (put(out, token())) and 0x38 (XNetworkingUnregisterPreferredLocalUdpMultiplayerPortChanged) to unregister (true), matching 0x80/0x88 since neither hint nor port changes offline.
  • UTF-16 security information async trio (slots 0x58 / 0x60 / 0x68):
    • Added dedicated static SECURITY_UTF16: u8 = 0; identity tag and wide(*const u16) helper (matching net.rs / files.rs / dstorage.rs).
    • Wired 0x58 (security_info_utf16_async), 0x60 (security_info_utf16_size), and 0x68 (security_info_utf16_result), mirroring the ANSI trio (0x40/0x48/0x50) and completing immediately with UNREACHABLE.
  • Unit tests (4 new, 5 total in xnetworking):
    • a_port_change_callback_registers_but_never_runs
    • utf16_security_information_is_unreachable_offline
    • a_null_utf16_url_completes_like_an_empty_one
    • utf16_and_ansi_results_are_not_interchangeable (verifies SECURITY_UTF16 vs SECURITY tag isolation via xasync::finished_with)

Verification (Windows 11 x64 MSVC)

  • rustfmt --edition 2024 --check crates/victory-hle/src/modules/xnetworking.rs: PASS
  • cargo xtask policy: PASS (154 files ok)
  • cargo clippy --workspace --all-targets --locked -- -D warnings (default + --features diagnostics): PASS (0 warnings)
  • cargo test -p victory-hle --locked -- xnetworking: 5/5 PASS
  • cargo test --workspace --locked: PASS (all workspace crates green)

AI-assisted; synthetic tests only, no game files.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6581778653 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/851). Originally posted by [geiyiliyabumo](https://github.com/geiyiliyabumo) on 2026-11-24T12:27:46Z. --- ### Summary Implements the 5 remaining `missing::<N>` vtable slots (`0x30`, `0x38`, `0x58`, `0x60`, `0x68`) in `crates/victory-hle/src/modules/xnetworking.rs` for the offline Xbox `XNetworking` service, plus 4 deterministic unit tests. Because external PR creation is currently restricted (`collaborators_only`), the CI-green branch is ready on my fork for cherry-pick / review: - **Branch**: `geiyiliyabumo/VIctory@feat/xnetworking-udp-and-utf16-slots` - **Commit**: `geiyiliyabumo/VIctory@36ae257` (based on `main` `ffe310e`) ### Changes (`crates/victory-hle/src/modules/xnetworking.rs`) - **Preferred local UDP port change callbacks (slots `0x30` / `0x38`)**: - Wired `0x30` (`XNetworkingRegisterPreferredLocalUdpMultiplayerPortChanged`) to `register` (`put(out, token())`) and `0x38` (`XNetworkingUnregisterPreferredLocalUdpMultiplayerPortChanged`) to `unregister` (`true`), matching `0x80`/`0x88` since neither hint nor port changes offline. - **UTF-16 security information async trio (slots `0x58` / `0x60` / `0x68`)**: - Added dedicated `static SECURITY_UTF16: u8 = 0;` identity tag and `wide(*const u16)` helper (matching `net.rs` / `files.rs` / `dstorage.rs`). - Wired `0x58` (`security_info_utf16_async`), `0x60` (`security_info_utf16_size`), and `0x68` (`security_info_utf16_result`), mirroring the ANSI trio (`0x40`/`0x48`/`0x50`) and completing immediately with `UNREACHABLE`. - **Unit tests (4 new, 5 total in `xnetworking`)**: - `a_port_change_callback_registers_but_never_runs` - `utf16_security_information_is_unreachable_offline` - `a_null_utf16_url_completes_like_an_empty_one` - `utf16_and_ansi_results_are_not_interchangeable` (verifies `SECURITY_UTF16` vs `SECURITY` tag isolation via `xasync::finished_with`) ### Verification (Windows 11 x64 MSVC) - `rustfmt --edition 2024 --check crates/victory-hle/src/modules/xnetworking.rs`: **PASS** - `cargo xtask policy`: **PASS** (`154 files ok`) - `cargo clippy --workspace --all-targets --locked -- -D warnings` (default + `--features diagnostics`): **PASS** (0 warnings) - `cargo test -p victory-hle --locked -- xnetworking`: **5/5 PASS** - `cargo test --workspace --locked`: **PASS** (all workspace crates green) *AI-assisted; synthetic tests only, no game files.*
Marvisak commented 2026-11-25 07:03:27 +00:00 (Migrated from github.com)
Author
Contributor

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T06:55:26Z.


Automated triage for the maintainers.

This is already on main: PR #1248 ("XNetworking: wire UDP port change callbacks and UTF-16 security queries", merged 2026-11-25) filled these slots. In crates/victory-hle/src/modules/xnetworking.rs the vtable now has register at 0x30, security_info_utf16_async at 0x58 and the UTF-16 result slots after it, with tests of their own.

Proposed for closing as fixed in main. It will be closed in 48 hours unless you reply (for example, if something in your branch is still missing from main) or a maintainer removes the triage: proposed close label.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7155299749 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/851#issuecomment-7155299749). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T06:55:26Z. --- <!-- victory-issue-triage v1 verdict=proposed-close seen=2026-11-24T12:27:46Z at=2026-11-25T06:55:26Z --> Automated triage for the maintainers. This is already on `main`: PR #1248 ("XNetworking: wire UDP port change callbacks and UTF-16 security queries", merged 2026-11-25) filled these slots. In `crates/victory-hle/src/modules/xnetworking.rs` the vtable now has `register` at `0x30`, `security_info_utf16_async` at `0x58` and the UTF-16 result slots after it, with tests of their own. Proposed for closing as fixed in `main`. It will be closed in 48 hours unless you reply (for example, if something in your branch is still missing from `main`) or a maintainer removes the `triage: proposed close` label. --- _Generated by [Claude Code](https://claude.ai/code)_
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Marvisak/VIctory#851
No description provided.