HLE xpackage: fix bool vtable slots, symlink dir walk, and estimate_download guard #1308

Closed
geiyiliyabumo wants to merge 1 commit from upstream-pr/1308 into main
geiyiliyabumo commented 2026-11-24 17:18:15 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by geiyiliyabumo on 2026-11-24T17:18:15Z.


Summary

Audits \crates/victory-hle/src/modules/xpackage.rs\ and fixes four issues:

  • Replaces \HRESULT-returning \missing\ stubs on \ool-returning vtable slots \x40\ (\XPackageUpdateInstallationMonitor) and \x50\ (\XPackageUnregisterInstallationProgressChanged) with typed implementations matching
    egister_progress, and wires \xc0\ (\mount_path_size).
  • Prevents infinite recursion on directory symlinks/junctions and saturates byte summation in \dir_bytes.
  • Checks \ytes.is_null()\ in \estimate_download\ before mutating *confirm.
  • Adds a 32-byte ABI assertion on \Progress\ and 5 deterministic synthetic unit tests covering all implemented slots.

Verification

  • \cargo test -p victory-hle --lib modules::xpackage\ ? 6 passed, 0 failed
  • \cargo clippy -p victory-hle --all-targets -- -D warnings\ ? clean
  • \cargo xtask policy\ ? 154 files ok

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

<!-- greyfinch-sync:Marvisak/VIctory:issue:6587429759 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1308). Originally posted by [geiyiliyabumo](https://github.com/geiyiliyabumo) on 2026-11-24T17:18:15Z. --- ## Summary Audits \crates/victory-hle/src/modules/xpackage.rs\ and fixes four issues: - Replaces \HRESULT\-returning \missing\ stubs on \ool\-returning vtable slots \x40\ (\XPackageUpdateInstallationMonitor\) and \x50\ (\XPackageUnregisterInstallationProgressChanged\) with typed implementations matching \ egister_progress\, and wires \xc0\ (\mount_path_size\). - Prevents infinite recursion on directory symlinks/junctions and saturates byte summation in \dir_bytes\. - Checks \ytes.is_null()\ in \estimate_download\ before mutating \*confirm\. - Adds a 32-byte ABI assertion on \Progress\ and 5 deterministic synthetic unit tests covering all implemented slots. ## Verification - \cargo test -p victory-hle --lib modules::xpackage\ ? 6 passed, 0 failed - \cargo clippy -p victory-hle --all-targets -- -D warnings\ ? clean - \cargo xtask policy\ ? 154 files ok *AI-assisted; synthetic tests only, no game files.*
DenRakEiw commented 2026-11-24 18:04:40 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-24T17:26:41Z.

Review: APPROVED


Tested head 942a567 (fast-forward on main ffe310e) on Windows 11 x64 (Rust 1.98.1 MSVC):

  • cargo test -p victory-hle: 99 passed, 0 failed (plus no_dll_planting: 1 passed)
  • cargo clippy -p victory-hle --all-targets: 0 warnings
  • cargo xtask policy: ok

Clean fixes for xpackage bool vtable slots, symlink directory walking, and estimate_download guards. Approving.

AI-assisted (Gemini 4 Neon).

<!-- greyfinch-sync:Marvisak/VIctory:review:6044159090 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1308#pullrequestreview-6044159090). Originally posted by [DenRakEiw](https://github.com/DenRakEiw) on 2026-11-24T17:26:41Z. **Review:** APPROVED --- Tested head `942a567` (fast-forward on `main` `ffe310e`) on Windows 11 x64 (Rust 1.98.1 MSVC): - `cargo test -p victory-hle`: **99 passed, 0 failed** (plus `no_dll_planting`: 1 passed) - `cargo clippy -p victory-hle --all-targets`: **0 warnings** - `cargo xtask policy`: ok Clean fixes for `xpackage` bool vtable slots, symlink directory walking, and `estimate_download` guards. Approving. AI-assisted (Gemini 4 Neon).
upstream-sync closed this pull request 2026-11-25 01:06:11 +00:00
Marvisak commented 2026-11-25 01:08:08 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T00:37:08Z.


Automated triage for the maintainers. Closing because another open pull request covers the same change.

See #1274. Its one substantive change is #1274's slot 0x50. The rest is stubs for two more slots nobody calls, a rewrite of the folder walk for a recursion that cannot happen (directory entries' metadata does not follow links), and 300 lines of tests pinning current behaviour.

If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7148700746 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1308#issuecomment-7148700746). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T00:37:08Z. --- Automated triage for the maintainers. Closing because another open pull request covers the same change. See #1274. Its one substantive change is #1274's slot 0x50. The rest is stubs for two more slots nobody calls, a rewrite of the folder walk for a recursion that cannot happen (directory entries' metadata does not follow links), and 300 lines of tests pinning current behaviour. If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

Pull request closed

Sign in to join this conversation.
No reviewers
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!1308
No description provided.