Loader: match title DLL filenames ignoring ASCII case #1433
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1434"
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 fuzeofficlal on 2026-11-24T17:58:12Z.
Fixes #762.
Summary
dirs.0case-insensitively (eq_ignore_ascii_case+path.is_file(), skipping colliding subdirectories) when the exact path is not a file so mixed-case title DLLs load properly on case-sensitive folders and broken images report their real on-disk filename in error context.Verification
directory_scan_matches_files_ignoring_ascii_case_and_skips_foldersandmaps_mixed_case_title_dlls_in_case_sensitive_folders(using per-directory NTFS case sensitivity with colliding uppercase directory names and malformed DLL error checks).cargo test -p victory-loader,cargo clippy --workspace --all-targets --all-features, andcargo xtask policy: passed.Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T19:25:07Z.
Review: COMMENTED
Static review only:
crates/victory-loader/src/windows.rsis#[cfg(windows)], so neither the unit test nor theload_probe.rsintegration test can run on macOS. The logic is sound: exact-case match first, then a directory scan witheq_ignore_ascii_casethat skips directories, dedup still keyed on the lowercase name, and the wanted-check happens before any file I/O. The integration test is thorough (case-sensitive folders viafsutil, four spellings, startup imports, and the invalid-PE error path keeping the real filename). Please make sure it runs in the Windows CI leg before merge.Imported from Marvisak/VIctory. Originally posted by acetonahard-code on 2026-11-24T21:15:11Z.
Tested on Windows 11 with the repo toolchain, merged into current
main(ffe310e):cargo test -p victory-loadermainmain+ this PRmain,--all-featuresmain+ this PR,--all-featurescargo clippy --all-targets -- -D warnings, with and without--all-features: clean.I didn't test with game data.
Tested locally with an AI-assisted script (Claude Code); I checked the results before posting.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T03:27:36Z.
Automated triage for the maintainers.
Merge candidate (update after your reply).
map_dllincrates/victory-loader/src/windows.rsnow tries the import name as written first. If that misses, it falls back to a case-insensitive directory scan (find_dll_file→scan_dll_file→select_dll_entry) and keeps the lowercased name as theseen/loadedkey. Thanks for removing thefsutilcall. The new tests are a pure unit test onselect_dll_entry, atempfilescan test, and a load test that copiesversion.dllthe way existingload_probe.rstests do. None of them spawn a process or change filesystem attributes, so the maintainer-decision point no longer applies.Your reply points to a real defect in
main.map_dlllowercases the name beforedirs.0.join, so in a case-sensitive directory even an exact-case match is skipped silently. Folders created from WSL on NTFS are a real way to get such a directory. The Wine/Proton case is weaker, since Wine already does its own case-insensitive lookup.CI: passing (
check).Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-25T04:39:32Z.
Rebased onto
940d32f(4339556a) and removed thefsutilprocess call and filesystem-attribute mutation, replacing it with an in-memory unit test onselect_dll_entry.On where this is reached in practice:
map_dllpreviously lowercasednamebefore joining the path (let name = name.to_ascii_lowercase(); let path = dirs.0.join(&name);), so in any case-sensitive directory even an exact-case match between the PE import descriptor and a mixed-case DLL filename on disk (FooBar.dll->dirs.0.join("foobar.dll").is_file()) silently returnedOk(())without loading the DLL, leaving its imports onmissingstubs. That hits Linux + Wine/Proton runs backed byext4/btrfs/xfsmounts without kernelcasefold(as reported in #762) as well as directories created from WSL on NTFS (which inheritFILE_CS_FLAG_CASE_SENSITIVE_DIR) or accessed over\\wsl.localhost\....upstream-sync referenced this pull request2026-11-25 10:07:37 +00:00
Imported from Marvisak/VIctory. Originally posted by cloph-dsp on 2026-11-27T03:49:33Z.
Independent CPU-only verification on Windows (Rust 1.100.0/MSVC, per-worktree
CARGO_TARGET_DIR=target-1434-watch,CARGO_BUILD_JOBS=2, no game data).4339556a, base/merge base940d32f; 2 files, +135/-4.cargo test --locked -p victory-loader --lib -- windows::tests::select_dll_entry_matches_ignoring_ascii_case_and_skips_colliding_folders --exact --test-threads=1 --quiet-> 1 passed, 35 filtered.cargo test --locked -p victory-loader --lib -- windows::tests::directory_scan_matches_files_ignoring_ascii_case_and_skips_folders --exact --test-threads=1 --quiet-> 1 passed, 35 filtered.cargo test --locked -p victory-loader --test load_probe -- maps_mixed_case_title_dlls_and_reports_matched_filename --exact --test-threads=1 --quiet-> 1 passed, 2 filtered.git diff --check 940d32f HEAD-> clean.940d32f(git grep -c -F ... 940d32f -- crates/victory-loader-> no output / exit 1).Note: only the three named synthetic tests were replayed; the full crate suite and real title DLL loading were not exercised. GPU/driver: N/A (CPU-only loader tests). AI-assisted (Hy4 flash). No game data, assets, extracted shaders or DRM involved.
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.