Loader: a title DLL in a case-sensitive folder is skipped without an error (fix on a fork) #762
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory#762
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@Peppacodes on GitHub · 2026-11-24 09:47 UTC · original
What's wrong
map_dll(crates/victory-loader/src/windows.rs:149-151) lowercases a title DLL's name and joins that to the title folder:In an ordinary NTFS folder that works, because lookups ignore case. In a case-sensitive folder,
GameLib.dllandgamelib.dllare different names, sois_file()is false and the DLL is skipped withOk(()). Both callers go through it:load_title_dlls, for the exe's imports at start-up.load_title_dll, for a title's ownLoadLibrary, which then reports "not a title image".WSL creates folders on Windows drives as case-sensitive, and new subfolders inherit the flag. So a dump extracted with Linux tools under WSL gets it.
What a user sees: the DLL is never mapped and its imports go to stubs. With the default
--unimplemented trap, the run stops at the first call into it, and nothing says the DLL wasn't found.Repro
Late.dll(a copy ofversion.dll) is in a case-sensitive temp folder.load_title_dllreturns no DLLs forLate.dll,LATE.DLLandlate.dll, including the exact spelling.Fix
1e24f34, rebased onmain(ffe310e), 0 commits behind it. It changeswindows.rsand its test.What changed:
seen,wantedand the returned list, so callers get the same names as before.file_inlooks the file up by the name as written. If that fails, it takes the folder's entry that matches ignoring ASCII case, the way the Windows loader ignores case.Test
a_title_dll_in_a_case_sensitive_folder_is_found_by_any_spelling, incrates/victory-loader/tests/title_dlls.rs:fsutil file setCaseSensitiveInfo(no admin needed). It then loadsLate.dllasLate.dll,LATE.DLLandlate.dll.main(left: []) and passes with the fix.Results on Windows 11 with Rust 1.98.1, using the CI's own commands:
cargo test --workspace --locked: 343 passed, 0 failed.cargo clippy --workspace --all-targets --locked -- -D warnings, with and without--all-features: clean.rustfmt --edition 2024 --checkon the two changed files: clean.cargo xtask policy: 154 files ok.Not checked: a folder WSL created itself, since the test sets the same flag directly; and case-sensitive network shares.
PR creation is limited to collaborators right now, so this is an issue with the branch. I can open a PR when it reopens.
No game files used. AI use: Claude Code (Claude Opus 5.5) found this in an audit of the loader, wrote the fix and the test, and ran everything above.
@MichaelSmithAI on GitHub · 2026-11-24 10:27 UTC · original
I tested the lookup from
1e24f34in Wine 11.22 on an ext4 directory using a source-built DLL. The directory contained a folder namedLATE.DLLand a file namedlate.dll. A request forLATE.dllfell back to directory enumeration, which returned the folder first. Bothload_title_dllandload_title_dllsreturned an empty list.The fallback can skip the folder by changing the first
.find(|e| …)to.filter(|e| …)and the trailing.filter(|p| p.is_file())to.find(|p| p.is_file()). With just those two changes, both entry points returned["late.dll"]in the same fixture. The exact-name lookup and lowercase key stay as in your patch.@Peppacodes on GitHub · 2026-11-24 10:38 UTC · original
Thanks, confirmed on Windows too. In a case-sensitive NTFS folder, the
LATE.DLLfolder is listed beforelate.dll, andload_title_dll("LATE.dll")returned[]on1e24f34.Your
filter/findchange is now on the branch as22c3d00. A new test,a_folder_spelled_like_a_title_dll_does_not_hide_it, fails on1e24f34and passes with it. Workspace tests (344), both clippy runs, rustfmt andcargo xtask policyall pass.@MamaLeVrai on GitHub · 2026-11-24 19:42 UTC · original
@Peppacodes your fix for this issue is now in a pull request, #1603, together with the three others of yours (#762, #764, #765, #832): the branches are merged as they are, with your commits and your name unchanged, onto
mainffe310e. Clippy (both runs) andcargo test --workspacepass on the result. If you would rather open your own pull request for this one, say so and I will take it out of #1603. AI-assisted (Claude Code); no game data.@Marvisak on GitHub · 2026-11-25 03:50 UTC · original
Automated triage for the maintainers.
Confirmed on
main:map_dllincrates/victory-loader/src/windows.rslowercases the DLL name and joins it to the title folder, then returnsOk(())whenpath.is_file()is false. In a case-sensitive folder a DLL whose real name has capitals is skipped without an error, both at start-up (load_title_dlls) and for a title'sLoadLibrary(load_title_dll).Open pull request #1434 already matches title DLL names ignoring ASCII case; please compare your branch (including the folder-before-file fix from the comments,
22c3d00) with it and comment there, or open your own pull request if yours handles more. The bundle #1603 mentioned above is not open.Generated by Claude Code