[PR #349] [MERGED] d3d12_xs: device slot 26 takes the console's struct-return form, again (RT-SLOT26) #401

Closed
opened 2026-11-26 20:17:46 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/349
Author: @Mumogg
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/24/2026
Merged by: @ubiquitarianism

Base: main ← Head: slot26-struct-return


📝 Commits (1)

  • c495458 d3d12_xs: device slot 26 takes the console's struct-return form

📊 Changes

5 files changed (+133 additions, -5 deletions)

View changed files

📝 docs/d3d12_vulkan.md (+6 -0)
📝 runtime/shims/d3d12_xs_device.cpp (+27 -3)
📝 runtime/shims/d3d12_xs_device.h (+7 -1)
📝 runtime/test/device_proxy_test.cpp (+36 -0)
📝 runtime/test/xs_proxy_mock_test.cpp (+57 -1)

📄 Description

Claimed in #14 as RT-SLOT26. Clears the stop after #127 and #131.

What and why

The retail executable calls GetCustomHeapProperties (device slot 26) with the buffer for the returned struct in RCX and the device in RDX. main's generic forwarder takes RCX for the proxy, reads a vtable out of the title's stack buffer and faults: the host access violation right after D3D12XboxCreateDevice that I measured under Wine and that was confirmed on native Windows in #131.

This is commit 86b8e04e4 by Senne Cools (-x, authorship kept). It is an ancestor of main whose content is not in the tree. The cherry-pick conflicted with what main has gained around it since; I kept both sides everywhere:

  • d3d12_xs_device.cpp: the slot 26 thunk next to slot 133's, and 26 added to device_slot_overridden with the Xbox route slots.
  • xs_proxy_mock_test.cpp: the slot 26 case next to check_xbox_slots and check_console_command_list.
  • docs/d3d12_vulkan.md: main's UMA paragraph, followed by the commit's sentences about the call shape.

Measured

Linux (Nobara 44, kernel 7.3), Wine 11.21 staging, RTX 5070 Ti (driver 615.78.08), clang-cl 22.1.8 + xwin SDK 10.0.26100, own 1.0.2.1 copy, network off, on main ece4ba5b3.

main this branch
D3D12 calls under --run 1 5
Ends with host AV at device slot 26 the title's own int3 after CreateCommandQueue is refused

The next stop is device slot 48: it is routed to CreateCommandQueueX, and the layer refuses the queue (type, priority, flags or node mask, type 2). That is stop 8 of docs/retail_boot_chain.md, and I will look at it next.

  • xs_proxy_mock_test under Wine: passes, including the new case (buffer in RCX and device in RDX reaches the PC method and writes only the struct; the PC form is forwarded unchanged).
  • device_proxy_test gets a case too, but that test stops at D3D12XboxCreateDevice returns a device under Wine here, on main as well, so I could not run it.

Not built with MSVC and not run on Windows.

AI-assisted (Claude Code); built and run on the machine above.

🤖 Generated with Claude Code

https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/349 **Author:** [@Mumogg](https://github.com/Mumogg) **Created:** 11/24/2026 **Status:** ✅ Merged **Merged:** 11/24/2026 **Merged by:** [@ubiquitarianism](https://github.com/ubiquitarianism) **Base:** `main` ← **Head:** `slot26-struct-return` --- ### 📝 Commits (1) - [`c495458`](https://github.com/ubiquitarianism/leonida/commit/c4954581ae27e9db5baabaea091302ed54eb96ea) d3d12_xs: device slot 26 takes the console's struct-return form ### 📊 Changes **5 files changed** (+133 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `docs/d3d12_vulkan.md` (+6 -0) 📝 `runtime/shims/d3d12_xs_device.cpp` (+27 -3) 📝 `runtime/shims/d3d12_xs_device.h` (+7 -1) 📝 `runtime/test/device_proxy_test.cpp` (+36 -0) 📝 `runtime/test/xs_proxy_mock_test.cpp` (+57 -1) </details> ### 📄 Description Claimed in #14 as `RT-SLOT26`. Clears the stop after #127 and #131. ### What and why The retail executable calls `GetCustomHeapProperties` (device slot 26) with the buffer for the returned struct in RCX and the device in RDX. `main`'s generic forwarder takes RCX for the proxy, reads a vtable out of the title's stack buffer and faults: the host access violation right after `D3D12XboxCreateDevice` that I measured under Wine and that was confirmed on native Windows in #131. This is commit `86b8e04e4` by Senne Cools (`-x`, authorship kept). It is an ancestor of `main` whose content is not in the tree. The cherry-pick conflicted with what `main` has gained around it since; I kept both sides everywhere: - `d3d12_xs_device.cpp`: the slot 26 thunk next to slot 133's, and 26 added to `device_slot_overridden` with the Xbox route slots. - `xs_proxy_mock_test.cpp`: the slot 26 case next to `check_xbox_slots` and `check_console_command_list`. - `docs/d3d12_vulkan.md`: `main`'s UMA paragraph, followed by the commit's sentences about the call shape. ### Measured Linux (Nobara 44, kernel 7.3), Wine 11.21 staging, RTX 5070 Ti (driver 615.78.08), clang-cl 22.1.8 + xwin SDK 10.0.26100, own 1.0.2.1 copy, network off, on `main` `ece4ba5b3`. | | `main` | this branch | |---|---|---| | D3D12 calls under `--run` | 1 | 5 | | Ends with | host AV at device slot 26 | the title's own `int3` after `CreateCommandQueue` is refused | The next stop is device slot 48: it is routed to `CreateCommandQueueX`, and the layer refuses the queue (`type, priority, flags or node mask`, type 2). That is stop 8 of `docs/retail_boot_chain.md`, and I will look at it next. - `xs_proxy_mock_test` under Wine: passes, including the new case (buffer in RCX and device in RDX reaches the PC method and writes only the struct; the PC form is forwarded unchanged). - `device_proxy_test` gets a case too, but that test stops at `D3D12XboxCreateDevice returns a device` under Wine here, on `main` as well, so I could not run it. Not built with MSVC and not run on Windows. AI-assisted (Claude Code); built and run on the machine above. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:17:46 +01:00
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
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.

Dependencies

No dependencies set

Reference
starred/leonida#401
No description provided.