kernelx: implement GetModuleFileNameEx and GetModuleBaseName for mapped images #1183
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!1183
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1183"
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?
@Ivankiosan on GitHub · 2026-11-24 12:56 UTC · original
Ivankiosan:kernelx-module-filename-and-basename→main· +228 −1 · 2 files · 1 commits · openImplements
GetModuleFileNameExW,GetModuleFileNameExA,K32GetModuleFileNameExW,K32GetModuleFileNameExA,GetModuleBaseNameW,GetModuleBaseNameA,K32GetModuleBaseNameW, andK32GetModuleBaseNameAinkernelxso titles, crash reporters, profilers, and diagnostics querying XCL-mapped executables and DLLs get their real file paths and base names rather than failing withERROR_INVALID_HANDLEfrom Windows' native PEB module list.What is in it
GetModuleFileNameExW,GetModuleFileNameExA,K32GetModuleFileNameExW,K32GetModuleFileNameExA,GetModuleBaseNameW,GetModuleBaseNameA,K32GetModuleBaseNameW, andK32GetModuleBaseNameAincrates/xcl/src/hle/kernelx.rsfor XCL's manually-mapped images (the title executable and console/runtime DLLs).psapi.dllthroughkernelxwith fallback to nativepsapi.dllincrates/xcl/src/hle/mod.rs.process == GetCurrentProcess()orGetProcessId(process) == GetCurrentProcessId()):hModule == 0(orm.base) to the title executable or mapped image path/basename instead of failing under Windows' native PEB loader list.ERROR_INVALID_PARAMETERand returns0.kernel32.dllorntdll.dll) and cross-process queries to the nativepsapi/kernel32APIs.hle::kernelx::tests::get_module_file_name_ex_and_base_name_answer_for_mapped_imagescovering wide and ANSI variants, current process pseudo-handle and real OpenProcess handle, null/zero-capacity validation, and native module fallback.Tested
rustc 1.99.1 (58cf8f9c3 2026-10-13)/ MSVC 14.51.cargo test --workspace -- --test-threads=4: all 699 unit tests passed, all integration tests passed, 0 failures across the workspace.cargo test -p xcl --lib get_module_file_name_ex_and_base_name_answer_for_mapped_images: 1 passed, 0 failed.target/release/xcl.exe(cargo build --release -p xcl).Regression run
main:
text xcl-smoke v1 commit: 47efa2ecea0a12934719ae69b81930cf02a4b1c3 gpu: AMD Radeon RX 7600 title: 419239bf seconds: 10 exit: 0x0 frames shown: 26 (PresentX 26) presents per 2 s (last 3): 0 0 23 device removals: 0 crashes: 0 peak commit: 8172 MBPR head:
text xcl-smoke v1 commit: a72a430471aecaae37bdb710d08986f701756d78 gpu: AMD Radeon RX 7600 title: 419239bf seconds: 10 exit: 0x0 frames shown: 26 (PresentX 26) presents per 2 s (last 3): 0 0 23 device removals: 0 crashes: 0 peak commit: 8366 MBNot tested
AI use
kernelx.rsandmod.rs, implemented theGetModuleFileNameExandGetModuleBaseNamefunctions and unit tests, verified workspace tests and executed the local GPU smoke regression.@DavidM1911 on GitHub · 2026-11-24 13:13 UTC · original
Independent verification on current
main384f7f7(branch already contains it — clean).Machine: Windows 11, Ryzen 9 7900X; Rust stable MSVC, debug.
cargo test -p xcl --lib module_file: 1 passed, 0 failed —get_module_file_name_ex_and_base_name_answer_for_mapped_imagescovers the new GetModuleFileNameEx/GetModuleBaseName implementation;cargo test -p xcl --lib module: 6 passed overall.AI use: test runs by Devin (Cognition, SWE-2); no code changes.
@JoaoPauluu on GitHub · 2026-11-24 14:34 UTC · original
A run on Linux under Wine.
Tested
x86_64-pc-windows-gnu.a72a430as it is (based on47efa2e), no uncommitted changes. The lib test binary runs under Wine, one test per process (--exact).GetModuleFileNameEx/GetModuleBaseNamefor host modules come from Wine here.hle::kernelx::tests::get_module_file_name_ex_and_base_name_answer_for_mapped_images: ok, no SKIPPED.Not tested
AI use
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.