HLE: report required size on string getter buffer errors #446
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/446"
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 Marvisak/VIctory. Originally posted by enzoduarte1 on 2026-11-24T03:30:44Z.
What
xgameruntime::put_stringreturnedE_NOT_SUFFICIENT_BUFFERwithout touchingusedwhen the title passed no buffer (or one that was too small). String getters in this runtime use the usual two-call pattern — call with no buffer to learn the required size, then call again with that buffer — so the first call could not get an answer.The error branch now writes
text.len() + 1throughusedwhen it is non-null, and leaves the buffer untouched on failure. Exact-fit and null-usedbehavior are unchanged. A test covers the size query, the follow-up fetch, a short buffer and a caller that does not ask for the size.Tested
x86_64-pc-windows-gnu(no MSVC linker on this machine).cargo test -p victory-hle --lib xgameruntime::: 2 passed.cargo test --workspace --exclude victory-loader -- --test-threads=1: all suites passed.cargo clippy -p victory-hle --all-targets -- -A clippy::field_reassign_with_default -D warnings: clean. The allowed lint is the pre-existing warning fixed by PR #355.rustfmt --edition 2024 --check crates/victory-hle/src/modules/xgameruntime.rsandgit diff --check: clean.cargo xtask policy: 151 files ok. No game files or data taken from them were added.cargo test -p victory-loader --test load_probe. Its fixture passes MSVC's/DELAYLOADflag, which MinGW rejects here; the same failure occurs on unmodifiedmain.Checklist
cargo fmt,cargo clippy --workspace --all-targetsandcargo test --workspacepass — see the toolchain limitations above; the changed crate is clean.cargo xtask policypasses. The change adds no game files or data taken from them (docs/asset-policy.md).Imported from Marvisak/VIctory. Originally posted by mercuryVM on 2026-11-24T05:14:16Z.
Review: APPROVED
Tested
881caefon Windows 11, RTX 5070, MSVC:cargo test --workspace --no-fail-fastpasses (265 passed, 0 failed).put_stringcaller (storage.rs,xsystem.rs×3,xuser.rs,xpackage.rs,xstore.rs). None readsusedafter a failure or depends on it staying unchanged. The two that pass a nullusedare unaffected.0xfffill.No issues found.
AI-assisted (Claude Code).
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T00:30:16Z.
Automated triage for the maintainers.
Needs work. This changes a runtime return value:
put_stringincrates/victory-hle/src/modules/xgameruntime.rswould write the required size throughusedonE_NOT_SUFFICIENT_BUFFER. Its callers (xsystem.rs,xuser.rs,storage.rs) implement getters whose public documentation describes fixed-size buffers with documented maximum sizes; none is documented as call-once-to-get-the-size, and the docs don't sayusedis written on failure. Please add evidence that the real runtime writesusedon this error (public documentation for a specific getter, or the title's call sites relying on it) and name the caller that needs it.CI: no check runs on the head commit.
Generated by Claude Code
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.