fix(windows-nui): fill NUI_IMAGE_FRAME by value in ImageStreamGetNextFrame
DEA's HidNatalNuiThread uses a by-value frame ABI, not the standard runtime-returns-a-pointer one. Verified from gamekdm.dll disasm: updateStream (FUN_1000f400) passes the address of a 40-byte frame buffer (this+0xad8, sizeof NUI_IMAGE_FRAME) as ppcImageFrame and stores that same address as its outstanding marker; updateFrame (FUN_1000f0a0) copies 0x28 bytes straight from that buffer (single deref) into the display slot, and the renderer reads pFrameTexture/dwFrameNumber from it. The shim was only writing a 4-byte pointer, leaving dwFrameNumber=0/pFrameTexture=NULL, so the game never locked a texture -> Ready + player detected but no picture. Copy the frame struct into the caller's buffer instead.
This commit is contained in:
1 parent
e93105b31c
commit
00f64ab129
1 file changed
+13
-1
@@ -476,7 +476,19 @@ HRESULT VirtualKinectSensor::ImageStreamGetNextFrame(
|
||||
if (is_new) {
|
||||
stream->last_delivered_frame_number = frame_no;
|
||||
stream->outstanding = true;
|
||||
*ppcImageFrame = &stream->frames[stream->latest_index];
|
||||
// DEA's HidNatalNuiThread uses a by-VALUE NUI_IMAGE_FRAME ABI, not the
|
||||
// standard "runtime returns a pointer" one. Verified from gamekdm.dll
|
||||
// disasm: NuiThread::updateStream (FUN_1000f400) passes the address of a
|
||||
// 40-byte (sizeof NUI_IMAGE_FRAME) buffer at this+0xad8 as ppcImageFrame
|
||||
// and stores that same address as its outstanding-frame marker;
|
||||
// NuiThread::updateFrame (FUN_1000f0a0) then copies 0x28 bytes straight
|
||||
// from that buffer (single deref) into the display slot and the renderer
|
||||
// reads pFrameTexture/dwFrameNumber from it. Writing only a 4-byte pointer
|
||||
// here left dwFrameNumber/pFrameTexture zero, so the game never locked a
|
||||
// texture (no picture). Copy the frame struct into the caller's buffer.
|
||||
std::memcpy(reinterpret_cast<void*>(ppcImageFrame),
|
||||
&stream->frames[stream->latest_index],
|
||||
sizeof(NUI_IMAGE_FRAME));
|
||||
}
|
||||
LeaveCriticalSection(&lock_);
|
||||
|
||||
|
||||
Reference in new issue
Block a user