Loader tests: take the Windows folder from the environment (port of upstream #1950) #1329

Closed
github-bot wants to merge 1 commit from github-bot/gh-1329 into main AGit
Owner

@⁠CwWwWwW on GitHub · 2026-11-26 15:37 UTC · original
CwWwWwW:port/fixture-windows-root → main · +15 −13 · 3 files · 1 commits · closed without merging

Problem

The kernel lookup test, the no-DLL-planting test and the loader fixture tests copy a real DLL from a hardcoded C:\Windows\System32 path. On a host whose Windows folder is not on C: (another drive, a custom install) the tests fail for a reason unrelated to the code under test, and the Windows runner is only one example of a host where C:\Windows is not guaranteed.

Upstream VIctory fixed this in commit e308f08 (pull request #1950, by prism); this is that fix ported to the fork.

Change

  • The Windows folder comes from %SystemRoot% (std::env::var_os) instead of the hardcoded path.
  • load_probe gets one host_dll helper used by both copies; the kernel test builds its urlmon path the same way.
  • Test-only; no product code changed.

Tests

  • cargo check -p victory-hle --all-targets --locked: clean; cargo check -p victory-loader --all-targets --locked: clean.
  • cargo test -p victory-hle --test no_dll_planting: 1 passed.
  • cargo test -p victory-hle --lib kernel: 4 passed.
  • cargo clippy -p victory-hle --all-targets --locked -- -D warnings and -p victory-loader --all-targets --locked -- -D warnings: clean.
  • The loader load_probe integration test cannot run in this environment (no MSVC toolchain; the test builds its fixture with a nested cargo, which fails to link here); it compiles, and CI windows-latest runs it.

(CI note: the check job on main is currently red on the asset-policy violation; #1322 fixes that, after which this can be rebased.)

**@⁠CwWwWwW** on GitHub · 2026-11-26 15:37 UTC · [original](https://github.com/fxceless/victory-fork/pull/1329) `CwWwWwW:port/fixture-windows-root` → `main` · +15 −13 · 3 files · 1 commits · closed without merging ## Problem The kernel lookup test, the no-DLL-planting test and the loader fixture tests copy a real DLL from a hardcoded C:\Windows\System32 path. On a host whose Windows folder is not on C: (another drive, a custom install) the tests fail for a reason unrelated to the code under test, and the Windows runner is only one example of a host where C:\Windows is not guaranteed. Upstream VIctory fixed this in commit e308f08 (pull request #1950, by prism); this is that fix ported to the fork. ## Change - The Windows folder comes from %SystemRoot% (std::env::var_os) instead of the hardcoded path. - load_probe gets one host_dll helper used by both copies; the kernel test builds its urlmon path the same way. - Test-only; no product code changed. ## Tests - cargo check -p victory-hle --all-targets --locked: clean; cargo check -p victory-loader --all-targets --locked: clean. - cargo test -p victory-hle --test no_dll_planting: 1 passed. - cargo test -p victory-hle --lib kernel: 4 passed. - cargo clippy -p victory-hle --all-targets --locked -- -D warnings and -p victory-loader --all-targets --locked -- -D warnings: clean. - The loader load_probe integration test cannot run in this environment (no MSVC toolchain; the test builds its fixture with a nested cargo, which fails to link here); it compiles, and CI windows-latest runs it. (CI note: the check job on main is currently red on the asset-policy violation; #1322 fixes that, after which this can be rebased.)
Ported from upstream VIctory commit e308f08 (pull request #1950, prism):
the kernel, no-DLL-planting and load-probe tests copied
version.dll/urlmon by a hardcoded C:\Windows path, so they failed on a
host whose Windows folder is elsewhere (another drive, an install not on
C:). They now use %SystemRoot% (one host_dll helper in load_probe).

Test-only; no product code changed.

cargo check -p victory-hle/--all-targets and -p victory-loader
--all-targets: clean; cargo test -p victory-hle --test no_dll_planting:
1 passed; cargo test -p victory-hle --lib kernel: 4 passed; clippy on
both crates --all-targets -- -D warnings: clean.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 15:40:42 +00:00
github-bot closed this pull request 2026-11-26 15:52:05 +00:00

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.