Loader: find a title DLL whatever its name's case, even beside a folder spelled like it #162

Open
Peppacodes wants to merge 2 commits from upstream-pr/162 into main
Peppacodes commented 2026-11-24 22:03:28 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by Peppacodes on 2026-11-24T22:03:28Z.


On a case-sensitive folder, a title DLL whose file name's case differs from the name it is loaded by is silently skipped. Its imports then go to stubs, and the title's own LoadLibrary sees "not a title image".

Case-sensitive folders are common:

  • Wine/Proton: the game folder on ext4.
  • WSL: it creates folders that way, and new subfolders inherit the flag.

1. Find a title DLL whatever its name's case. map_dll lowercased the DLL's name and joined that to the title folder. On a case-sensitive folder, GameLib.dll is not gamelib.dll. is_file() was false and the DLL was skipped without an error.

  • The lowercased name stays the key (seen, wanted, the returned list).
  • The file is the name as written or, failing that, the folder's entry that matches it ignoring ASCII case. The Windows loader ignores case too.

2. A folder spelled like a title DLL does not hide it. The case-ignoring fallback took the folder's first entry that matched the name, and only then checked it was a file. A folder listed before the file made the DLL not found (NTFS lists LATE.DLL before late.dll). It now takes the first matching entry that is a file. MichaelSmithAI found this in Wine on ext4; the same happens on a case-sensitive NTFS folder.

Tested on this branch's base (2119b0e) plus these two commits, on Windows 11:

  • New loader tests use a case-sensitive temp folder (fsutil setCaseSensitiveInfo, no admin needed) holding Late.dll. They load it as Late.dll, LATE.DLL and late.dll, also with a folder named like the DLL listed before it. They're skipped where Windows cannot make such a folder.
  • cargo clippy --workspace --all-targets --locked -- -D warnings, with and without --all-features: clean.
  • cargo test -p victory-shader -p victory-hle -p victory-loader --locked: 337 passed, 0 failed, 2 ignored. This was with the two other PRs from this account applied as well.

AI-assisted (Claude Code).

<!-- greyfinch-sync:fxceless/victory-fork:issue:6592307465 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/162). Originally posted by [Peppacodes](https://github.com/Peppacodes) on 2026-11-24T22:03:28Z. --- On a case-sensitive folder, a title DLL whose file name's case differs from the name it is loaded by is silently skipped. Its imports then go to stubs, and the title's own `LoadLibrary` sees "not a title image". Case-sensitive folders are common: - **Wine/Proton:** the game folder on ext4. - **WSL:** it creates folders that way, and new subfolders inherit the flag. **1. Find a title DLL whatever its name's case.** `map_dll` lowercased the DLL's name and joined that to the title folder. On a case-sensitive folder, `GameLib.dll` is not `gamelib.dll`. `is_file()` was false and the DLL was skipped without an error. - The lowercased name stays the key (seen, wanted, the returned list). - The file is the name as written or, failing that, the folder's entry that matches it ignoring ASCII case. The Windows loader ignores case too. **2. A folder spelled like a title DLL does not hide it.** The case-ignoring fallback took the folder's first entry that matched the name, and only then checked it was a file. A folder listed before the file made the DLL not found (NTFS lists `LATE.DLL` before `late.dll`). It now takes the first matching entry that is a file. MichaelSmithAI found this in Wine on ext4; the same happens on a case-sensitive NTFS folder. **Tested** on this branch's base (`2119b0e`) plus these two commits, on Windows 11: - New loader tests use a case-sensitive temp folder (`fsutil setCaseSensitiveInfo`, no admin needed) holding `Late.dll`. They load it as `Late.dll`, `LATE.DLL` and `late.dll`, also with a folder named like the DLL listed before it. They're skipped where Windows cannot make such a folder. - `cargo clippy --workspace --all-targets --locked -- -D warnings`, with and without `--all-features`: clean. - `cargo test -p victory-shader -p victory-hle -p victory-loader --locked`: 337 passed, 0 failed, 2 ignored. This was with the two other PRs from this account applied as well. AI-assisted (Claude Code).
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/162:upstream-pr/162'
git switch 'upstream-pr/162'

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.

git switch 'main'
git merge --no-ff 'upstream-pr/162'
git switch 'upstream-pr/162'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/162'
git switch 'upstream-pr/162'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/162'
git switch 'main'
git merge --squash 'upstream-pr/162'
git switch 'main'
git merge --ff-only 'upstream-pr/162'
git switch 'main'
git merge 'upstream-pr/162'
git push origin 'main'
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!162
No description provided.