Skip to content

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

Closed
CwWwWwW wants to merge 1 commit into
fxceless:mainfrom
CwWwWwW:port/fixture-windows-root
Closed

CwWwWwW wants to merge 1 commit into
fxceless:mainfrom
CwWwWwW:port/fixture-windows-root

Conversation

@CwWwWwW

@CwWwWwW CwWwWwW commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

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.)

…#1950)

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.
@CwWwWwW CwWwWwW closed this Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant