kernelx: GetModuleInformation answers for the images XCL mapped #883

Open
github-bot wants to merge 1 commit from github-bot/gh-883 into main AGit
Owner

@⁠mastrr9 on GitHub · 2026-11-24 07:24 UTC · original
mastrr9:feat/kernelx-get-module-information → main · +78 −0 · 1 files · 1 commits · open

Implements K32GetModuleInformation / GetModuleInformation in crates/xcl/src/hle/kernelx.rs so titles, crash handlers, and stack walkers querying XCL-mapped executables and DLLs get valid MODULEINFO instead of Windows failing on modules it did not load:

  • Answers for XCL-mapped modules of the current process (NULL resolves to the title executable), returns ERROR_INSUFFICIENT_BUFFER if cb is too small, and forwards all other modules/processes to Windows.
  • Exported as both K32GetModuleInformation and GetModuleInformation.
  • Adds unit test hle::kernelx::tests::get_module_information_answers_for_mapped_images.

Tested

  • Hardware/OS: NVIDIA RTX 5080 (driver 617.42 / 32.0.16.1742), Windows 11 Pro 25H2 (26200.9974), rustc 1.100.0 (0ef1bc386 2026-11-09) MSVC debug, DXC Windows SDK 10.0.26100.0, d3d12SDKLayers.dll installed
  • Commit tested: 16cd6c162eca7028ff824e00434512d9e9177271
  • cargo build --workspace: clean (no new warnings; only pre-existing fetch_update deprecation warning)
  • cargo test --workspace -- --test-threads=4: 714 passed, 0 failed, 41 ignored (hle::kernelx::tests::get_module_information_answers_for_mapped_images ok)
  • SKIPPED GPU tests: gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask: no wave64, gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware: no wave64

Regression run
Smoke run by @⁠Toons29 in comment below: #883
Contributed by a community tester; the PR author did not run it. Both blocks are pasted as posted.

main:

xcl-smoke v1
commit: 4178e888c0b5be50a2887eda45cdb832763b68a4
gpu: AMD Radeon RX 9070
title: game.exe
seconds: 60
exit: 0x0
frames shown: 1618 (PresentX 1618)
presents per 2 s (last 3): 61 60 60
device removals: 0
crashes: 0
peak commit: 14831 MB

PR:

xcl-smoke v1
commit: 806b69f17b7ac9509b23b171f69047e564287fc0
gpu: AMD Radeon RX 9070
title: game.exe
seconds: 60
exit: 0x0
frames shown: 1630 (PresentX 1630)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14814 MB

Tester's setup and limits: AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, cargo build --release -p xcl, 60 s, XCL_NETWORK=0. This is a regression check only: it does not show whether the run reaches the code this PR changes.

Tester's AI use: Claude Code (Claude Opus 5.5) built both trees and ran scripts/smoke.ps1; the tester checked the blocks before posting.

Not tested

  • No retail title was available to the author; whether the community regression run above reaches the code this PR changes is not known.

AI use

  • Authored with Claude Code (Claude Opus 5.5); reviewed, audited, and verified on native Windows/RTX 5080 hardware with Antigravity (Gemini 4 Neon + Claude Sonnet 5.5).
  • Claude Code (Claude Sonnet 5.5) added the community regression run to this description and updated the lines that it made out of date or that the PR check requires.
**@⁠mastrr9** on GitHub · 2026-11-24 07:24 UTC · [original](https://github.com/xcl-dev/xcl/pull/883) `mastrr9:feat/kernelx-get-module-information` → `main` · +78 −0 · 1 files · 1 commits · open Implements `K32GetModuleInformation` / `GetModuleInformation` in `crates/xcl/src/hle/kernelx.rs` so titles, crash handlers, and stack walkers querying XCL-mapped executables and DLLs get valid `MODULEINFO` instead of Windows failing on modules it did not load: - Answers for XCL-mapped modules of the current process (`NULL` resolves to the title executable), returns `ERROR_INSUFFICIENT_BUFFER` if `cb` is too small, and forwards all other modules/processes to Windows. - Exported as both `K32GetModuleInformation` and `GetModuleInformation`. - Adds unit test `hle::kernelx::tests::get_module_information_answers_for_mapped_images`. **Tested** - Hardware/OS: NVIDIA RTX 5080 (driver `617.42` / `32.0.16.1742`), Windows 11 Pro 25H2 (`26200.9974`), `rustc 1.100.0 (0ef1bc386 2026-11-09)` MSVC debug, DXC Windows SDK `10.0.26100.0`, `d3d12SDKLayers.dll` installed - Commit tested: `16cd6c162eca7028ff824e00434512d9e9177271` - `cargo build --workspace`: clean (no new warnings; only pre-existing `fetch_update` deprecation warning) - `cargo test --workspace -- --test-threads=4`: **714 passed, 0 failed, 41 ignored** (`hle::kernelx::tests::get_module_information_answers_for_mapped_images` ok) - `SKIPPED` GPU tests: `gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask: no wave64`, `gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware: no wave64` **Regression run** Smoke run by @⁠Toons29 in comment below: https://git.gtahub.st/github/xcl-dev--xcl/pulls/883 Contributed by a community tester; the PR author did not run it. Both blocks are pasted as posted. main: ``` xcl-smoke v1 commit: 4178e888c0b5be50a2887eda45cdb832763b68a4 gpu: AMD Radeon RX 9070 title: game.exe seconds: 60 exit: 0x0 frames shown: 1618 (PresentX 1618) presents per 2 s (last 3): 61 60 60 device removals: 0 crashes: 0 peak commit: 14831 MB ``` PR: ``` xcl-smoke v1 commit: 806b69f17b7ac9509b23b171f69047e564287fc0 gpu: AMD Radeon RX 9070 title: game.exe seconds: 60 exit: 0x0 frames shown: 1630 (PresentX 1630) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14814 MB ``` Tester's setup and limits: AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, `cargo build --release -p xcl`, 60 s, `XCL_NETWORK=0`. This is a regression check only: it does not show whether the run reaches the code this PR changes. Tester's AI use: Claude Code (Claude Opus 5.5) built both trees and ran `scripts/smoke.ps1`; the tester checked the blocks before posting. **Not tested** - No retail title was available to the author; whether the community regression run above reaches the code this PR changes is not known. **AI use** - Authored with Claude Code (Claude Opus 5.5); reviewed, audited, and verified on native Windows/RTX 5080 hardware with Antigravity (Gemini 4 Neon + Claude Sonnet 5.5). - Claude Code (Claude Sonnet 5.5) added the community regression run to this description and updated the lines that it made out of date or that the PR check requires.
K32GetModuleInformation (and psapi's GetModuleInformation) went to
Windows, whose kernelbase looks the module up in the PEB's loader list.
The title's executable and the DLLs XCL maps are not in that list, so a
title asking for its own image's base, size or entry point got FALSE
with ERROR_INVALID_HANDLE and an untouched MODULEINFO. A NULL module is
read from PEB.ImageBaseAddress, which XCL points at the title, so it
failed the same way.

For the current process and a module XCL mapped (NULL: the title's
executable), the answer now comes from the mapping: base, SizeOfImage
and the entry point. Too small a buffer gives ERROR_INSUFFICIENT_BUFFER
as on Windows. Other modules and processes still go to Windows.

Test: get_module_information_answers_for_mapped_images registers a
mapped module and checks the answer through the pseudo handle and a
real handle to the process, the buffer-size error, and that a module
Windows loaded (kernel32) still gets Windows' answer. Type-checked for
Windows; not run on Windows.

Assisted-by: Claude Code (Claude Opus 5.5)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:35:36 +00:00
Author
Owner

@⁠SlopTart on GitHub · 2026-11-24 09:34 UTC · original

Linux / AMD RDNA3 datapoint.

Merged state: head fc60938 onto main 077ce40, clean merge.

Full suite, cargo test --workspace --release --no-fail-fast --target x86_64-pc-windows-gnu -- --test-threads=4: 710 passed, 7 failed, 41 ignored; failures are the known Wine-lane set from my #42 rows. GetModuleInformation tests green.

Not tested: retail titles (none here), Windows, RDNA4.
Counts only, no game data.

Machine: RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, Rust cross x86_64-pc-windows-gnu, XCL_NETWORK=0, release profile, --test-threads=4. My Linux rows: #42 / #718.

AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting.

**@⁠SlopTart** on GitHub · 2026-11-24 09:34 UTC · [original](https://github.com/xcl-dev/xcl/pull/883#issuecomment-7127591583) Linux / AMD RDNA3 datapoint. **Merged state:** head `fc60938` onto main `077ce40`, clean merge. **Full suite, `cargo test --workspace --release --no-fail-fast --target x86_64-pc-windows-gnu -- --test-threads=4`:** **710 passed, 7 failed, 41 ignored**; failures are the known Wine-lane set from my #42 rows. GetModuleInformation tests green. **Not tested:** retail titles (none here), Windows, RDNA4. Counts only, no game data. **Machine:** RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, Rust cross `x86_64-pc-windows-gnu`, `XCL_NETWORK=0`, release profile, `--test-threads=4`. My Linux rows: #42 / #718. AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting.
Author
Owner

@⁠Toons29 on GitHub · 2026-11-25 03:05 UTC · original

Regression run of 806b69f1 on the retail title, for this PR's Regression run section. Both blocks are from scripts/smoke.ps1 as printed, not edited: main on 4178e888, this PR on its head commit with no uncommitted changes, same title and time.

xcl-smoke v1
commit: 4178e888c0b5be50a2887eda45cdb832763b68a4
gpu: AMD Radeon RX 9070
title: game.exe
seconds: 60
exit: 0x0
frames shown: 1618 (PresentX 1618)
presents per 2 s (last 3): 61 60 60
device removals: 0
crashes: 0
peak commit: 14831 MB
xcl-smoke v1
commit: 806b69f17b7ac9509b23b171f69047e564287fc0
gpu: AMD Radeon RX 9070
title: game.exe
seconds: 60
exit: 0x0
frames shown: 1630 (PresentX 1630)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14814 MB

Against the limits in CONTRIBUTING.md: 101 % of main's frames, 100 % of its peak commit, no crash, no device removal.

AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, cargo build --release -p xcl, 60 s, XCL_NETWORK=0. This is a regression check only: it does not show whether the run reaches the code this PR changes.

AI use: Claude Code (Claude Opus 5.5) built both trees and ran scripts/smoke.ps1; I checked the blocks before posting.

**@⁠Toons29** on GitHub · 2026-11-25 03:05 UTC · [original](https://github.com/xcl-dev/xcl/pull/883#issuecomment-7151587505) Regression run of `806b69f1` on the retail title, for this PR's **Regression run** section. Both blocks are from `scripts/smoke.ps1` as printed, not edited: `main` on `4178e888`, this PR on its head commit with no uncommitted changes, same title and time. ``` xcl-smoke v1 commit: 4178e888c0b5be50a2887eda45cdb832763b68a4 gpu: AMD Radeon RX 9070 title: game.exe seconds: 60 exit: 0x0 frames shown: 1618 (PresentX 1618) presents per 2 s (last 3): 61 60 60 device removals: 0 crashes: 0 peak commit: 14831 MB ``` ``` xcl-smoke v1 commit: 806b69f17b7ac9509b23b171f69047e564287fc0 gpu: AMD Radeon RX 9070 title: game.exe seconds: 60 exit: 0x0 frames shown: 1630 (PresentX 1630) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14814 MB ``` Against the limits in CONTRIBUTING.md: 101 % of `main`'s frames, 100 % of its peak commit, no crash, no device removal. AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, `cargo build --release -p xcl`, 60 s, `XCL_NETWORK=0`. This is a regression check only: it does not show whether the run reaches the code this PR changes. AI use: Claude Code (Claude Opus 5.5) built both trees and ran `scripts/smoke.ps1`; I checked the blocks before posting.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 09:53 UTC · original

Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: 1038 passed, 1 failed in one parallel run; the failing test passes on a single-threaded rerun (1039/0). Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-25 09:53 UTC · [original](https://github.com/xcl-dev/xcl/pull/883#issuecomment-7158943288) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: 1038 passed, 1 failed in one parallel run; the failing test passes on a single-threaded rerun (1039/0). Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun. Thanks!
Author
Owner

@⁠upipibi on GitHub · 2026-11-25 20:49 UTC · original

NVIDIA test report for 806b69f (head as is, base 85e3826), for #1607's "one more test report" list. RTX 3070 8 GB (Ampere, 32-lane waves), driver 616.56, Windows 11, debug, after cargo build --workspace:

  • cargo test --workspace --no-fail-fast -- --test-threads=4 --skip hle::xaudio2: 867 passed, 0 failed, 42 ignored. The end-to-end title tests pass.
  • Skipped hle::xaudio2, because its tests fail or hang on this machine on main too. The PR doesn't touch it.
  • SKIPPED lines: 4: 2 no wave64 on this card, 1 no heap windows, 1 PSO measurement that needs Developer Mode.

AI-assisted (Claude Code, Claude Opus 5.5). Synthetic tests only; no title run.

**@⁠upipibi** on GitHub · 2026-11-25 20:49 UTC · [original](https://github.com/xcl-dev/xcl/pull/883#issuecomment-7174238131) NVIDIA test report for `806b69f` (head as is, base `85e3826`), for #1607's "one more test report" list. RTX 3070 8 GB (Ampere, 32-lane waves), driver 616.56, Windows 11, debug, after `cargo build --workspace`: - `cargo test --workspace --no-fail-fast -- --test-threads=4 --skip hle::xaudio2`: **867 passed, 0 failed, 42 ignored**. The end-to-end title tests pass. - Skipped `hle::xaudio2`, because its tests fail or hang on this machine on `main` too. The PR doesn't touch it. - SKIPPED lines: 4: 2 `no wave64` on this card, 1 no heap windows, 1 PSO measurement that needs Developer Mode. AI-assisted (Claude Code, Claude Opus 5.5). Synthetic tests only; no title run.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/883/head:github-bot/gh-883'
git switch 'github-bot/gh-883'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-883'
git switch 'github-bot/gh-883'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-883'
git switch 'github-bot/gh-883'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-883'
git switch 'main'
git merge --squash 'github-bot/gh-883'
git switch 'main'
git merge --ff-only 'github-bot/gh-883'
git switch 'main'
git merge 'github-bot/gh-883'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.