HLE: route kernelbase.dll registry exports through device_type #2341

Open
windfallscout wants to merge 1 commit from upstream-pr/2343 into main
windfallscout commented 2026-11-25 11:12:03 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by windfallscout on 2026-11-25T11:12:03Z.


Closes #2140.

Registry lookups through kernelbase.dll (static import or GetProcAddress) missed the emulated ConsoleMode key because device_type::module() only listed advapi32.dll and the api-set. This adds kernelbase.dll to the dlls list so those lookups reach the device-type overrides like advapi32.dll does; other kernelbase exports still resolve to kernel/files/host as before.

Synthetic tests only, no game data, no GPU (per asset-policy).

Verification (cargo, target x86_64-pc-windows-msvc, CARGO_FEATURE_PURE=1):

  • rustfmt --check: clean
  • cargo check -p victory-hle --tests: clean
  • cargo clippy -p victory-hle --all-targets (-D warnings), plus --all-features: clean
  • New unit tests compile; could not execute them on a CPU-only Linux box (link.exe missing for the Windows target). CI on Windows should run them.

AI-assisted (Gemini hydrogen worker, human reviewed); no game data involved.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6603173157 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2343). Originally posted by [windfallscout](https://github.com/windfallscout) on 2026-11-25T11:12:03Z. --- Closes #2140. Registry lookups through kernelbase.dll (static import or GetProcAddress) missed the emulated ConsoleMode key because device_type::module() only listed advapi32.dll and the api-set. This adds kernelbase.dll to the dlls list so those lookups reach the device-type overrides like advapi32.dll does; other kernelbase exports still resolve to kernel/files/host as before. Synthetic tests only, no game data, no GPU (per asset-policy). Verification (cargo, target x86_64-pc-windows-msvc, CARGO_FEATURE_PURE=1): - rustfmt --check: clean - cargo check -p victory-hle --tests: clean - cargo clippy -p victory-hle --all-targets (-D warnings), plus --all-features: clean - New unit tests compile; could not execute them on a CPU-only Linux box (link.exe missing for the Windows target). CI on Windows should run them. AI-assisted (Gemini hydrogen worker, human reviewed); no game data involved.
DenRakEiw commented 2026-11-25 12:03:25 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-25T11:26:27Z.

Review: APPROVED


Verified against origin/main (940d32f):

  • Routing kernelbase.dll registry exports through device_type ensures ConsoleMode overrides are reached via kernelbase.dll (note: overlaps in scope with #2285, though this PR includes a thorough end-to-end test).
  • cargo test -p victory-hle xsystem: 5/5 passed (including kernelbase_registry_lookup_hits_emulated_console_mode).
  • cargo clippy -p victory-hle --all-targets -- -D warnings: 0 warnings.
  • cargo xtask policy: 183 files ok.

AI-assisted (Gemini 4 Neon).

<!-- greyfinch-sync:Marvisak/VIctory:review:6056761389 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2343#pullrequestreview-6056761389). Originally posted by [DenRakEiw](https://github.com/DenRakEiw) on 2026-11-25T11:26:27Z. **Review:** APPROVED --- Verified against `origin/main` (`940d32f`): - Routing `kernelbase.dll` registry exports through `device_type` ensures `ConsoleMode` overrides are reached via `kernelbase.dll` (note: overlaps in scope with `#2285`, though this PR includes a thorough end-to-end test). - `cargo test -p victory-hle xsystem`: 5/5 passed (including `kernelbase_registry_lookup_hits_emulated_console_mode`). - `cargo clippy -p victory-hle --all-targets -- -D warnings`: 0 warnings. - `cargo xtask policy`: 183 files ok. AI-assisted (Gemini 4 Neon).
catminou4 commented 2026-11-25 12:03:25 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T11:51:59Z.

Review: COMMENTED


kernelbase.dll registry exports routed through device_type — this duplicates #2285 (same dlls addition, same ConsoleMode lookup test). Both open right now; whichever merges second conflicts. Suggest closing one.

<!-- greyfinch-sync:Marvisak/VIctory:review:6057089755 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2343#pullrequestreview-6057089755). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-25T11:51:59Z. **Review:** COMMENTED --- kernelbase.dll registry exports routed through device_type — **this duplicates #2285** (same dlls addition, same ConsoleMode lookup test). Both open right now; whichever merges second conflicts. Suggest closing one.
Marvisak commented 2026-11-25 16:09:12 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T15:27:25Z.


Automated triage for the maintainers.

Proposed close (duplicate). This makes the same one-line change (kernelbase.dll added to xsystem::device_type::module().dlls) as #2141, opened earlier for the same issue #2140. #2141's test also covers the GetProcAddress path through GetModuleHandleW("kernelbase.dll") and the registry API set, which is how the issue says the miss happens; this PR checks only resolver classification and direct calls. If something here is missing from #2141, a comment there is the best place for it. CI: not run.

This PR will be closed in 48 hours unless the author pushes a change or a maintainer removes the label.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7166871106 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2343#issuecomment-7166871106). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T15:27:25Z. --- <!-- victory-triage v1 head=39fc9f654775a237f196d3067119e308d5139a14 verdict=proposed-close at=2026-11-25T15:27:00Z --> Automated triage for the maintainers. **Proposed close (duplicate).** This makes the same one-line change (`kernelbase.dll` added to `xsystem::device_type::module().dlls`) as #2141, opened earlier for the same issue #2140. #2141's test also covers the `GetProcAddress` path through `GetModuleHandleW("kernelbase.dll")` and the registry API set, which is how the issue says the miss happens; this PR checks only resolver classification and direct calls. If something here is missing from #2141, a comment there is the best place for it. CI: not run. This PR will be closed in 48 hours unless the author pushes a change or a maintainer removes the label. --- _Generated by [Claude Code](https://claude.ai/code)_
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/2343:upstream-pr/2343'
git switch 'upstream-pr/2343'

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.

git switch 'main'
git merge --no-ff 'upstream-pr/2343'
git switch 'upstream-pr/2343'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2343'
git switch 'upstream-pr/2343'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2343'
git switch 'main'
git merge --squash 'upstream-pr/2343'
git switch 'main'
git merge --ff-only 'upstream-pr/2343'
git switch 'main'
git merge 'upstream-pr/2343'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Marvisak/VIctory!2341
No description provided.