Skip to content

Fix GameChat world-load deadlock; make Kinect runtime optional - #2

Draft
thegl0w wants to merge 4 commits into
mainfrom
fix/kinect-runtime-optional
Draft

thegl0w wants to merge 4 commits into
mainfrom
fix/kinect-runtime-optional

Conversation

@thegl0w

@thegl0w thegl0w commented Nov 21, 2026

Copy link
Copy Markdown
Owner

AI-generated: this PR was written by Claude (Claude Code) and opened with the account owner's approval. It exists in this fork only, to get a CI build.

Stacked on #1 (TPACK fix). Adds:

  • Keep the view thread servicing COM calls while a title blocks it (WinDurango.KernelX/src/EraStaWait.cpp). This patches the title's msvcp140 _Cnd_wait import. On an application STA, the wait runs in 10 ms slices, and incoming COM calls are dispatched between slices. Minecraft: Xbox One Edition 1.61 deadlocked while loading a new world: the view thread waited on a GameChat operation that needed a delegate call marshaled back to it.
  • Report no Kinect sensor when the Kinect runtime is missing. Kinect20.dll is delay-loaded, and the sensor methods handle a missing runtime.

Status: the wait patch passes a local harness (18 checks, 2 mutants caught). Not yet tested in the game.

🤖 Generated with Claude Code

thegl0w and others added 4 commits November 21, 2026 12:31
Minecraft: Xbox One Edition 1.61 opens DLC pack data through TPACK:, a
root name kept from the Xbox 360 content-mount API. After listing and
opening Mount\DLC\<pack>\<file>.pck it asks for TPACK: and
TPACK:\<file>.pck. FixRelativePath treated these as relative, producing
Mount\TPACK:\..., which Windows rejects as an invalid name. The title then
crashes while freeing the half-loaded pack, so Play Game closed the game
whenever more than one DLC pack was present.

Remember the last DLC pack folder (Mount\DLC\<pack> or Mount\CU\DLC\<pack>)
seen by FixRelativePath or CreateFileW, and resolve TPACK:[\rest] against
it. With all 77 packs present, redirecting these paths to the current
pack folder let Play Game reach the Load/Create/Join screen; 232 TPACK:
lookups resolved and no pack failed to load.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On the console a title can block its CoreApplication view thread in
task::wait(). The console's app C++ runtime refuses that wait on a
Windows Runtime STA, so the thread does not act as an STA there. On PC
the real CoreApplication makes it an application STA and desktop
msvcp140 lets the wait block, so work that needs a COM call into the
thread deadlocks.

Minecraft: Xbox One Edition 1.61 freezes this way while loading a new
world: the view thread waits on a Microsoft.Xbox.GameChat operation,
and GameChat's worker waits on a delegate call marshaled back to the
view thread.

Patch the title executable's msvcp140 _Cnd_wait import. On an
application STA, wait in 10 ms slices and let incoming COM calls run in
between (COWAIT_DISPATCH_CALLS) with the mutex released. Returning
without a notify is a spurious wakeup, which _Cnd_wait callers already
handle. Other threads and apartment types are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
windows.kinect.dll imports GetDefaultKinectSensor from Kinect20.dll,
which only the Kinect for Windows Runtime 2.0 installs. Without it the
DLL fails to load, Windows.Kinect.KinectSensor fails to activate with
ClassNotRegistered, and Minecraft: Xbox One Edition 1.61 exits when a
new world is created.

Delay-load Kinect20.dll and only call GetDefaultKinectSensor when it
can be loaded. Otherwise the sensor reports not open, not available
and no capabilities, Open and Close do nothing, and the frame source
and coordinate mapper getters return null. Readers and frames below
those getters are unchanged, so a title that uses them without
checking IsAvailable still needs the runtime.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The default winDurango.json gave the D-pad the values 25 to 28, the
hexadecimal virtual-key codes of the arrow keys written as decimal.
Decimal 27 is VK_ESCAPE, so D-pad Right fired Escape (which is also
the View key) and the other three directions were unused codes. Use
VK_LEFT, VK_UP, VK_RIGHT and VK_DOWN (37 to 40), like the decimal codes
of the other keys. Existing config files keep their values.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant