HLE files: wrap missing SetCurrentDirectoryW and Win32/UCRT path twins #2247

Open
github-bot wants to merge 1 commit from github-bot/gh-2247 into main AGit
Owner

@⁠Sidlik900 on GitHub · 2026-11-25 08:46 UTC · original
Sidlik900:hle/files-missing-wrappers → main · +613 −9 · 1 files · 1 commits · open

Claimed in #1633.

Summary

  • Wrap missing SetCurrentDirectoryW alongside SetCurrentDirectoryA in crates/victory-hle/src/modules/files.rs so wide current-directory changes on virtual drives rewrite to the host folder instead of hitting kernel32.dll directly.
  • Add missing narrow Win32 file/directory/disk wrappers (CreateDirectoryA, RemoveDirectoryA, SetFileAttributesA, GetFileAttributesExA, GetDiskFreeSpaceExA, MoveFileA, MoveFileExA, CopyFileA) and missing wide two-path twins (MoveFileW, CopyFileW), using
    arrow_pair so mixed virtual/host path pairs route safely through *W without double-rewriting.
  • Add missing UCRT file/directory wrappers (_stat64, _wstat64i32, _wremove, _unlink, _wunlink,
    ename, _wrename, _mkdir, _wmkdir, _rmdir, _wrmdir, _access, _waccess, _access_s, _waccess_s, _chmod, _utime64).
  • Add synthetic unit tests covering every new wrapper, mixed virtual/host pairs, single-rewrite guarantees on nested virtual drives, and an isolated child-process test for SetCurrentDirectoryA/SetCurrentDirectoryW.

Verification

ustfmt --edition 2024 --check crates\victory-hle\src\modules\files.rs

  • cargo xtask policy (182 files ok)
  • cargo test -p victory-hle --locked (146 unit + idelityfx +
    o_dll_planting passed)
  • cargo test -p victory-hle --all-features --locked (146 unit + idelityfx +
    o_dll_planting passed)
  • cargo test -p xtask -p victory --locked ( ictory: 10 + 2 passed; xtask: 6 passed)
  • cargo clippy --workspace --all-targets --locked -- -D warnings
  • cargo clippy --workspace --all-targets --all-features --locked -- -D warnings

AI-assisted (Antigravity); synthetic tests only, no game data.

**@⁠Sidlik900** on GitHub · 2026-11-25 08:46 UTC · [original](https://github.com/Marvisak/VIctory/pull/2247) `Sidlik900:hle/files-missing-wrappers` → `main` · +613 −9 · 1 files · 1 commits · open Claimed in https://git.gtahub.st/github/Marvisak--VIctory/issues/1633. ### Summary - Wrap missing SetCurrentDirectoryW alongside SetCurrentDirectoryA in crates/victory-hle/src/modules/files.rs so wide current-directory changes on virtual drives rewrite to the host folder instead of hitting kernel32.dll directly. - Add missing narrow Win32 file/directory/disk wrappers (CreateDirectoryA, RemoveDirectoryA, SetFileAttributesA, GetFileAttributesExA, GetDiskFreeSpaceExA, MoveFileA, MoveFileExA, CopyFileA) and missing wide two-path twins (MoveFileW, CopyFileW), using arrow_pair so mixed virtual/host path pairs route safely through *W without double-rewriting. - Add missing UCRT file/directory wrappers (_stat64, _wstat64i32, _wremove, _unlink, _wunlink, ename, _wrename, _mkdir, _wmkdir, _rmdir, _wrmdir, _access, _waccess, _access_s, _waccess_s, _chmod, _utime64). - Add synthetic unit tests covering every new wrapper, mixed virtual/host pairs, single-rewrite guarantees on nested virtual drives, and an isolated child-process test for SetCurrentDirectoryA/SetCurrentDirectoryW. ### Verification - ustfmt --edition 2024 --check crates\victory-hle\src\modules\files.rs - cargo xtask policy (182 files ok) - cargo test -p victory-hle --locked (146 unit + idelityfx + o_dll_planting passed) - cargo test -p victory-hle --all-features --locked (146 unit + idelityfx + o_dll_planting passed) - cargo test -p xtask -p victory --locked ( ictory: 10 + 2 passed; xtask: 6 passed) - cargo clippy --workspace --all-targets --locked -- -D warnings - cargo clippy --workspace --all-targets --all-features --locked -- -D warnings AI-assisted (Antigravity); synthetic tests only, no game data.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:59:51 +00:00
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 13:31 UTC · original

Automated triage for the maintainers. This adds about 25 path wrappers in victory-hle/src/modules/files.rs (narrow Win32 twins such as CreateDirectoryA and MoveFileA, SetCurrentDirectoryW, MoveFileW / CopyFileW, and UCRT functions such as _stat64, rename, _mkdir and _access), registered with hle_export!, plus a narrow_pair helper for mixed virtual/host path pairs. The wrappers follow the existing pattern. Two things keep it from being a merge candidate:

  • The new SetCurrentDirectory* test re-runs the test binary as a child process (std::process::Command::new(std::env::current_exe())), so it needs the maintainer's decision.
  • No CI run is recorded on this head.

The PR also gives no evidence that the title imports these functions. Showing which of them the title actually calls (import names only, no game data) and trimming the rest, and running the working-directory test without spawning a process, would change the verdict.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 13:31 UTC · [original](https://github.com/Marvisak/VIctory/pull/2247#issuecomment-7163902003) <!-- victory-triage v1 head=6d8c4f6834f58a2a1f6e34fa757dd481ee3b17a0 verdict=needs-work at=2026-11-25T13:42:00Z --> Automated triage for the maintainers. This adds about 25 path wrappers in `victory-hle/src/modules/files.rs` (narrow Win32 twins such as `CreateDirectoryA` and `MoveFileA`, `SetCurrentDirectoryW`, `MoveFileW` / `CopyFileW`, and UCRT functions such as `_stat64`, `rename`, `_mkdir` and `_access`), registered with `hle_export!`, plus a `narrow_pair` helper for mixed virtual/host path pairs. The wrappers follow the existing pattern. Two things keep it from being a merge candidate: - The new `SetCurrentDirectory*` test re-runs the test binary as a child process (`std::process::Command::new(std::env::current_exe())`), so it needs the maintainer's decision. - No CI run is recorded on this head. The PR also gives no evidence that the title imports these functions. Showing which of them the title actually calls (import names only, no game data) and trimming the rest, and running the working-directory test without spawning a process, would change the verdict. --- _Generated by [Claude Code](https://claude.ai/code)_
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2247/head:github-bot/gh-2247'
git switch 'github-bot/gh-2247'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2247'
git switch 'github-bot/gh-2247'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2247'
git switch 'github-bot/gh-2247'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2247'
git switch 'main'
git merge --squash 'github-bot/gh-2247'
git switch 'main'
git merge --ff-only 'github-bot/gh-2247'
git switch 'main'
git merge 'github-bot/gh-2247'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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!2247
No description provided.