HLE: a module name with a trailing dot gets no .dll appended #2902
No reviewers
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!2902
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@pawrenity on GitHub · 2026-11-25 23:31 UTC · original
pawrenity:hle/module-name-trailing-dot→main· +22 −2 · 1 files · 2 commits · openfind_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
@Marvisak on GitHub · 2026-11-26 02:16 UTC · original · edited 2026-11-26 05:24 UTC
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
@pawrenity on GitHub · 2026-11-26 04:30 UTC · original
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).
@kotekompotek on GitHub · 2026-11-25 23:34 UTC · original · reviewed
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.
@fuzeofficlal on GitHub · 2026-11-25 23:39 UTC · original · reviewed
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.
@cloph-dsp on GitHub · 2026-11-26 12:29 UTC · original
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).@Dukestar69 on GitHub · 2026-11-26 13:31 UTC · original · approved these changes
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).
@futurepro62 on GitHub · 2026-11-26 18:15 UTC · original
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.