Loader: a title DLL that fails to prepare is named in the error
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.
This commit is contained in:
1 parent
d2a4bae1f4
commit
5f29f3ae5a
2 files changed
+18
-2
No files matched your search
@@ -0,0 +1,16 @@
|
||||
//! A title DLL that cannot be loaded is named in the error.
|
||||
#![cfg(windows)]
|
||||
|
||||
#[test]
|
||||
fn a_title_dll_that_does_not_prepare_is_named() {
|
||||
let title = tempfile::tempdir().unwrap();
|
||||
let cache = tempfile::tempdir().unwrap();
|
||||
std::fs::write(title.path().join("broken.dll"), b"MZ not a PE").unwrap();
|
||||
let wanted = |_: &str| true;
|
||||
let loaded = victory_loader::load_title_dll("broken.dll", title.path(), cache.path(), &wanted);
|
||||
let Err(error) = loaded else {
|
||||
panic!("a DLL that is not a PE loaded");
|
||||
};
|
||||
let text = format!("{error:#}");
|
||||
assert!(text.contains("broken.dll"), "{text}");
|
||||
}
|
||||
Reference in new issue
Block a user