Repository navigation
Loader: a title DLL that fails to prepare is named in the error - #285
Conversation
Reading and loading a title DLL report its path when they fail; preparing it, in between, did not. A DLL the PE parser refuses ended the run with just "malformed image: ..." (or the like), without saying which of the title's DLLs it was. The prepare step now adds "preparing <path>" like its neighbours.
…the error Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Tested PR #285 at head
Behavior covered: Checks a title DLL preparation failure reports the offending DLL name through the loader integration test. |
mercuryVM
left a comment
There was a problem hiding this comment.
Tested 5f29f3a on Windows 11, RTX 5070, MSVC: cargo test --workspace --no-fail-fast passes (265 passed, 0 failed), including the new tests/title_dlls.rs.
The three steps of map_dll (read, prepare, load) now all name the DLL, so a PE parse or patch failure says which file. The integration test feeds a non-PE broken.dll through the public load_title_dll and checks the file name in the {:#} chain.
No issues found.
AI-assisted (Claude Code).
…pare is named in the error Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-prepare Loader: a title DLL that fails to prepare is named in the error
…fails-to-prepare Loader: a title DLL that fails to prepare is named in the error
What's wrong
map_dllinwindows.rsbrings each of the title's DLLs in three steps:Reading and loading add the DLL's path to their errors. Preparing doesn't. When the PE parser or the patcher refuses a DLL, the run ends with an error that doesn't say which file it was, for example:
A title has several DLLs besides the exe (Grand Theft Auto VI has four), and through
LateDllsthe failure is reported under whichever DLL the title asked for, which may not be the dependency that actually failed. A reporter can't tell which file is the problem.What the fix does
The prepare step gets the same context as its neighbours:
preparing <path>.How it behaves after the fix
Nothing changes for DLLs that load.
Tests
The new integration test
tests/title_dlls.rswrites a file namedbroken.dllthat isn't a PE (MZ not a PE) into a temporary title folder. It then checks thatload_title_dllfails with an error namingbroken.dll.I ran
cargo test --workspaceon GitHub'swindows-latestwith Rust 1.98.1 fromrust-toolchain.toml:main: it fails because the error is onlymalformed image: Could not read file magic, with no file name.--test-threads=1. With 4 threads, the shader crate's GPU tests sometimes crash on that runner (Tests: victory-shader tests crash (0xC0000005) when several tests use WARP devices in parallel #181, Shaders: share and serialize WARP host operations across threads #244).Not tested: a real title DLL that fails to prepare.