HLE: a module name with a trailing dot gets no .dll appended #2900
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2902"
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 pawrenity on 2026-11-25T23:31:30Z.
find_module(behindGetModuleHandleA/WandLoadLibrary[Ex]A/W) added.dllonly to names without a dot, and otherwise kept the name as given. A name with a trailing dot, such as"foo.", therefore kept its dot and matched nothing: not the title image namedfoo, not the registry, notHostPolicy::allows. The call returned NULL withERROR_MOD_NOT_FOUND.The Win32 contract (LoadLibraryW / GetModuleHandleW):
Now:
"foo"foo.dll(unchanged)"foo.dll","foo.exe""foo.","sub\FOO."foo, neverfoo.dllTest:
modules::kernel::tests::a_module_name_with_a_trailing_dot_gets_no_dll_appendedregisters two synthetic title images,C:\title\plainandC:\title\plain.dll, and checks all four lookups. Before the fix it fails at the first assertion:"plain."returns NULL.Verification: Windows 11, MSVC.
cargo test -p victory-hle --locked: all 153 lib tests pass, plus the other test targets.cargo clippy -p victory-hle --all-targets --locked -- -D warnings: clean.rustfmt --checkon the changed file: clean.No game files used. Claimed in #1633.
🤖 Generated with Claude Code
Imported from Marvisak/VIctory. Originally posted by kotekompotek on 2026-11-25T23:34:10Z.
Review: COMMENTED
Matches the Windows loader: a trailing dot declares 'no extension' so no .dll is appended and the name resolves bare — distinct from a dot-free name which gets .dll. Test covers all four spellings. LGTM.
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-25T23:39:20Z.
Review: COMMENTED
Verified head
4a3d3db1cleanly merged ontoorigin/main(63bcca43) on Windows 11 x64.Code & Win32 Behavior Review
kernel32!GetModuleHandleW:GetModuleHandleW("kernel32.")->NULL(err=126, no.dllappended), matching this PR'sstrip_suffix('.')->"kernel32"path.GetModuleHandleW("kernel32.dll.")-> returns thekernel32.dllhandle, matching this PR'sstrip_suffix('.')->"kernel32.dll"->HostPolicypass-through.GetModuleHandleW("kernel32.dll..")actually strips all trailing dots (equivalent totrim_end_matches('.')whenfile.ends_with('.')), whereasstrip_suffix('.')strips only one trailing dot (andstrip_suffix('.')on a bare"."yields""). For the standard Win32 single-trailing-dot no-extension convention ("foo."),strip_suffix('.')behaves cleanly.Local Verification
cargo test --locked -p victory-hle --lib modules::kernel::tests: 6/6 passed (includinga_module_name_with_a_trailing_dot_gets_no_dll_appended).cargo clippy --locked -p victory-hle --all-targets -- -D warnings: clean.cargo xtask policy:191 files ok.Looks clean and ready to merge.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-26T02:16:47Z.
Automated triage for the maintainers.
Merge candidate (recommending a look, not approving). The new head answers the reviewer note that Windows drops every trailing dot, not just one:
find_moduleincrates/victory-hle/src/modules/kernel.rsnow usestrim_end_matches('.')when the name ends in., soplain..resolves toplainandplain.dll..toplain.dll, while names with or without an extension behave as onmain. The test adds both of those spellings to the earlier four, with synthetic image paths. CIcheckpasses on3d514a0.Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by pawrenity on 2026-11-26T04:30:29Z.
Thanks for checking against
kernel32directly. I've pushed3d514a0, which drops every trailing dot (trim_end_matches('.')when the name ends in.), so"kernel32.dll.."resolves like Windows does. The test now also covers"plain.."(the extensionless image) and"plain.dll.."(plain.dll).cargo test -p victory-hle --lockedpasses 153/153, clippy-D warningsis clean, andrustfmt --checkis clean.AI-assisted (Claude Code).
Imported from Marvisak/VIctory. Originally posted by cloph-dsp on 2026-11-26T12:29:34Z.
Independent local verification of head
3d514a0on Windows 11, Rust 1.100.0/MSVC:cargo test --locked -p victory-hle --lib -- modules::kernel::tests::a_module_name_with_a_trailing_dot_gets_no_dll_appended --exact— 1 passed, 0 failed.git diff --check origin/main HEAD— clean.Used a worktree-local
CARGO_TARGET_DIR. Synthetic module-name inputs only; no game assets, extracted data or DRM material used. AI-assisted (Hy4 flash). GPU/driver: N/A (CPU-only).Imported from Marvisak/VIctory. Originally posted by Dukestar69 on 2026-11-26T13:31:10Z.
Review: APPROVED
Verified against
origin/main(63bcca4):cargo test -p victory-hle --lib modules::kernel:: -- --test-threads=1: 6/6 passed (includinga_module_name_with_a_trailing_dot_gets_no_dll_appended).cargo clippy -p victory-hle --all-targets -- -D warnings: clean.cargo xtask policy: 191 files ok.Matches Windows module-lookup semantics by not appending
.dllwhen a module name ends with a trailing dot.Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
Imported from Marvisak/VIctory. Originally posted by futurepro62 on 2026-11-26T18:15:56Z.
NVIDIA full-suite run, to go with the reports above by Dukestar69, cloph-dsp, fuzeofficlal, since none of them names a GPU run. Tested exact head
3d514a0(on its base842b0cb).Tested
dxil.dllfrom Windows SDK 10.0.26100 (the loader's default), debug.cargo build --workspace --locked, thencargo test --workspace --locked --no-fail-fast -- --test-threads=4 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index --skip descriptor::host::tests::dynamic_slots_are_held_until_released --skip memory::tests::lists_share_a_table_and_copies_keep_their_views --skip emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride --skip emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros --skip emit::synthetic_tests::gathers_at_a_level_match_the_hardware: 867 passed, 0 failed, 10 ignored.a_module_name_with_a_trailing_dot_gets_no_dll_appended.--skipleaves out tests that fail on main63bcca4on this card too, not because of this PR:heap_direct_texture_reads_mark_their_heap_indexends thevictory-shadertest process with0xc0000005(#2571), so without the skip the rest of that crate never reports;dynamic_slots_are_held_until_released,lists_share_a_table_and_copies_keep_their_viewsand the twostride_testshit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317);gathers_at_a_level_match_the_hardwarefails on lane 0 (#1744).Not tested
AI use
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.