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

Closed
CwWwWwW wants to merge 1 commit from upstream-pr/1329 into main
CwWwWwW commented 2026-11-26 15:37:00 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by CwWwWwW on 2026-11-26T15:37:00Z.


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

<!-- greyfinch-sync:fxceless/victory-fork:issue:6630064028 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1329). Originally posted by [CwWwWwW](https://github.com/CwWwWwW) on 2026-11-26T15:37:00Z. --- ## 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.)
upstream-sync closed this pull request 2026-11-26 16:06:35 +00:00

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
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.

Reference
fxceless/victory-fork!1326
No description provided.