diag(windows-nui): introspect game hid::Natal display manager (gamekdm.dll+0x3cf1b4) - display mask, per-stream enable bytes, buffered frame ptrs, NuiThread status
ci / Linux C++ core (cmake + ctest) (push) Canceled after 0s
ci / Python root tests (pytest, no tracker deps) (push) Canceled after 0s
ci / Python tracker (pytest, tracker/.venv) (push) Canceled after 0s

This commit is contained in:
kinect-bot committed 2026-11-25 17:38:29 -05:00
1 parent ba0061a562
commit 2857c2df3b
3 files changed
+735204

No files matched your search

+735132
View File
File diff suppressed because it is too large. Load diff
+17
View File
@@ -0,0 +1,17 @@
[16:22:35.854] DllMain PROCESS_ATTACH (Kinect10 shim loaded)
[16:22:39.259] NuiSetDeviceStatusCallback cb=5395ebb0 -> invoking with S_OK
[16:22:39.259] NuiGetSensorCount -> 1
[16:22:39.259] NuiCreateSensorByIndex(0) -> sensor
[16:22:39.259] NuiInitialize flags=0x0000000B shm='kinect_virtual_frames' local-open=1
[16:22:39.260] NuiSetFrameEndEvent event=00001508 flag=0x00000000
[16:22:39.260] ImageStreamOpen type=0 res=1 -> 320x240 bpp=2 ring=3 event=0000150c
[16:22:39.260] ImageStreamOpen type=1 res=2 -> 640x480 bpp=4 ring=3 event=00001504
[16:22:39.261] COM NuiStatus -> 0x00000000
[16:22:39.264] COM NuiStatus -> 0x00000000
[16:22:39.264] SkeletonTrackingEnable flags=0x00000002 event=0000151c
[16:22:39.265] COM NuiStatus -> 0x00000000
[16:22:39.265] COM NuiStatus -> 0x00000000
[16:22:39.266] COM NuiStatus -> 0x00000000
[16:22:39.266] COM NuiStatus -> 0x00000000
[16:23:09.263] NuiShutdown called
[16:23:09.264] producer loop EXIT at tick=812 (stop_event signalled)
+55
View File
@@ -19,6 +19,60 @@ VirtualKinectSensor* g_sensor = nullptr;
CRITICAL_SECTION g_sensor_lock; CRITICAL_SECTION g_sensor_lock;
INIT_ONCE g_sensor_lock_once = INIT_ONCE_STATIC_INIT; INIT_ONCE g_sensor_lock_once = INIT_ONCE_STATIC_INIT;
// --- Diagnostic: read the game's own display-manager state directly. ---
// The shim is loaded in gamekdm.dll's process, so it can inspect the game's
// hid::Natal display manager to see why the camera panels never populate.
// Decompile facts (image base 0x10000000):
// *(gamekdm+0x3cf1b4) = manager (hid::Natal) pointer
// manager[0x00] = NuiThread object pointer
// manager[0x0c] = committed display-stream mask
// manager[0x10] = desired display-stream mask (bit 0x4=depth, 0x2=color)
// manager[0x14] = per-stream skip flags
// manager[0x16c0]= depth display-enable byte (set when armed -> LockRect runs)
// manager[0x1740]= color display-enable byte
// NuiThread[0x28] = status (3=no sensor, 7=ready)
// NuiThread[0x1598] = buffered depth frame ptr, +0x159c = color frame ptr
bool SafeReadU32(uintptr_t addr, uint32_t* out) {
if (addr == 0 || IsBadReadPtr(reinterpret_cast<const void*>(addr), 4)) {
return false;
}
*out = *reinterpret_cast<const volatile uint32_t*>(addr);
return true;
}
void DumpGameDisplayState() {
HMODULE mod = GetModuleHandleA("gamekdm.dll");
if (mod == nullptr) {
ShimLog("game-introspect: gamekdm.dll not loaded");
return;
}
const uintptr_t base = reinterpret_cast<uintptr_t>(mod);
uint32_t mgr = 0;
if (!SafeReadU32(base + 0x3cf1b4u, &mgr) || mgr == 0) {
ShimLog("game-introspect: mgr ptr null/unreadable (base=0x%08X raw=0x%08X)",
static_cast<uint32_t>(base), mgr);
return;
}
uint32_t nui = 0, committed = 0, mask = 0, flags = 0;
uint32_t en_depth = 0, en_color = 0, fp0 = 0, fp1 = 0, nui_status = 0;
SafeReadU32(mgr + 0x00u, &nui);
SafeReadU32(mgr + 0x0cu, &committed);
SafeReadU32(mgr + 0x10u, &mask);
SafeReadU32(mgr + 0x14u, &flags);
SafeReadU32(mgr + 0x16c0u, &en_depth);
SafeReadU32(mgr + 0x1740u, &en_color);
if (nui != 0) {
SafeReadU32(nui + 0x1598u, &fp0);
SafeReadU32(nui + 0x159cu, &fp1);
SafeReadU32(nui + 0x28u, &nui_status);
}
ShimLog("game-introspect: mgr=0x%08X nui=0x%08X mask(+10)=0x%X committed(+c)=0x%X "
"flags(+14)=0x%X enDepth(+16c0)=0x%02X enColor(+1740)=0x%02X "
"fp0(+1598)=0x%08X fp1=0x%08X nuiStatus(+28)=%u",
mgr, nui, mask, committed, flags, en_depth & 0xFFu, en_color & 0xFFu,
fp0, fp1, nui_status);
}
BOOL CALLBACK InitSensorLock(PINIT_ONCE, PVOID, PVOID*) { BOOL CALLBACK InitSensorLock(PINIT_ONCE, PVOID, PVOID*) {
InitializeCriticalSection(&g_sensor_lock); InitializeCriticalSection(&g_sensor_lock);
return TRUE; return TRUE;
@@ -599,6 +653,7 @@ void VirtualKinectSensor::ProducerLoop() {
? 1 ? 1
: 0, : 0,
skeleton_enabled_ ? 1 : 0); skeleton_enabled_ ? 1 : 0);
DumpGameDisplayState();
} }
if (!got) { if (!got) {
src = SourceFrame{}; src = SourceFrame{};