HLE: reject null out in QueryApiImpl before lookup and add xgameruntime unit tests #1029

Open
opened 2026-11-26 04:17:36 +00:00 by github-bot · 2 comments
Owner

@⁠geiyiliyabumo on GitHub · 2026-11-24 15:11 UTC · original

Summary

Fixes a real null-argument handling bug in QueryApiImpl in crates/victory-hle/src/modules/xgameruntime.rs and expands deterministic synthetic unit tests from 1 to 14 passing 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@test/hle-xgameruntime
  • Commit: geiyiliyabumo/VIctory@8466edd (based on main ffe310e)

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

  • Bug fix: QueryApiImpl previously fell through to the "area not implemented" path when called with a known (provider, iid) and a null out pointer (returning ERROR_NOT_SUPPORTED, logging a false warning, and memoising the pair in QUERIED). It now returns E_INVALIDARG upfront before lookup/logging/memoisation.
  • Tests (1 -> 14 synthetic): covers QueryApiImpl null out/unknown/whole-AREAS-table uniqueness, put, put_string, text, token, Guid, Object/Methods/add_ref/missing::<N>, and runtime init/export helpers.

Verification (Windows 11 x64 MSVC)

  • rustfmt --edition 2024 --check crates/victory-hle/src/modules/xgameruntime.rs: PASS
  • cargo xtask policy: PASS (154 files ok)
  • cargo clippy -p victory-hle --all-targets --locked -- -D warnings (default + --features diagnostics): PASS (0 warnings)
  • cargo test -p victory-hle --locked -- xgameruntime::: 14 passed, 0 failed (victory-hle 107/107 PASS)

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

**@⁠geiyiliyabumo** on GitHub · 2026-11-24 15:11 UTC · [original](https://github.com/Marvisak/VIctory/issues/1029) ### Summary Fixes a real null-argument handling bug in `QueryApiImpl` in `crates/victory-hle/src/modules/xgameruntime.rs` and expands deterministic synthetic unit tests from 1 to **14 passing 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@test/hle-xgameruntime` - **Commit**: `geiyiliyabumo/VIctory@8466edd` (based on `main` `ffe310e`) ### Changes (`crates/victory-hle/src/modules/xgameruntime.rs`) - **Bug fix**: `QueryApiImpl` previously fell through to the "area not implemented" path when called with a known `(provider, iid)` and a null `out` pointer (returning `ERROR_NOT_SUPPORTED`, logging a false warning, and memoising the pair in `QUERIED`). It now returns `E_INVALIDARG` upfront before lookup/logging/memoisation. - **Tests (1 -> 14 synthetic)**: covers `QueryApiImpl` null `out`/unknown/whole-`AREAS`-table uniqueness, `put`, `put_string`, `text`, `token`, `Guid`, `Object`/`Methods`/`add_ref`/`missing::<N>`, and runtime init/export helpers. ### Verification (Windows 11 x64 MSVC) - `rustfmt --edition 2024 --check crates/victory-hle/src/modules/xgameruntime.rs`: **PASS** - `cargo xtask policy`: **PASS** (`154 files ok`) - `cargo clippy -p victory-hle --all-targets --locked -- -D warnings` (default + `--features diagnostics`): **PASS** (0 warnings) - `cargo test -p victory-hle --locked -- xgameruntime::`: **14 passed, 0 failed** (`victory-hle` `107/107` PASS) *AI-assisted; synthetic tests only, no game files.*
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:17:36 +00:00
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 06:54 UTC · original · edited 2026-11-25 09:58 UTC

Automated triage for the maintainers.

Confirmed on main: in QueryApiImpl (crates/victory-hle/src/modules/xgameruntime.rs), a known (provider, interface) pair with a null out skips the success branch and falls through to the "runtime API area not implemented" warning, records the pair in QUERIED and returns NOT_SUPPORTED, so a later diagnosis would wrongly list an implemented area as missing. It is minor (the title passes a valid out). Open pull request #1199 by the same author carries a fix (it returns early for a null out without marking the area missing); note it returns NOT_SUPPORTED where this issue proposes E_INVALIDARG, so the review there should settle which.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 06:54 UTC · [original](https://github.com/Marvisak/VIctory/issues/1029#issuecomment-7155289817) · edited 2026-11-25 09:58 UTC <!-- victory-issue-triage v1 verdict=confirmed seen=2026-11-25T09:09:08Z at=2026-11-25T09:50:38Z --> Automated triage for the maintainers. Confirmed on `main`: in `QueryApiImpl` (`crates/victory-hle/src/modules/xgameruntime.rs`), a known (provider, interface) pair with a null `out` skips the success branch and falls through to the "runtime API area not implemented" warning, records the pair in `QUERIED` and returns `NOT_SUPPORTED`, so a later diagnosis would wrongly list an implemented area as missing. It is minor (the title passes a valid `out`). Open pull request #1199 by the same author carries a fix (it returns early for a null `out` without marking the area missing); note it returns `NOT_SUPPORTED` where this issue proposes `E_INVALIDARG`, so the review there should settle which. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠StExpeditus on GitHub · 2026-11-25 09:09 UTC · original

Validated the fork branch on Windows 11 Pro 26200 (Intel Core i5-14600K, Rust 1.98.1 MSVC), commit 6ebc0af: cargo test -p victory-hle --locked --no-fail-fast -> 146 passed, 0 failed, 0 ignored. Synthetic tests only, no game files.

**@⁠StExpeditus** on GitHub · 2026-11-25 09:09 UTC · [original](https://github.com/Marvisak/VIctory/issues/1029#issuecomment-7157943884) Validated the fork branch on Windows 11 Pro 26200 (Intel Core i5-14600K, Rust 1.98.1 MSVC), commit `6ebc0af`: `cargo test -p victory-hle --locked --no-fail-fast` -> **146 passed, 0 failed, 0 ignored**. Synthetic tests only, no game files.
This discussion has been locked. Commenting is limited to contributors.
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.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory#1029
No description provided.