fix(windows-nui): pin export ordinals to real Kinect10.dll (fixes ordinal 22 import), add 5 missing exports, MSVC-buildable
This commit is contained in:
1 parent
dafd249165
commit
ec169053c3
4 files changed
+94
-45
No files matched your search
@@ -31,14 +31,17 @@ target_include_directories(kinect10 PRIVATE
|
||||
"${CORE_DIR}"
|
||||
)
|
||||
|
||||
target_compile_options(kinect10 PRIVATE -O2 -Wall -Wextra)
|
||||
|
||||
target_link_options(kinect10 PRIVATE
|
||||
-static
|
||||
-static-libgcc
|
||||
-static-libstdc++
|
||||
-Wl,--enable-stdcall-fixup
|
||||
-Wl,--kill-at
|
||||
)
|
||||
if(MSVC)
|
||||
target_compile_options(kinect10 PRIVATE /O2 /W3)
|
||||
else()
|
||||
target_compile_options(kinect10 PRIVATE -O2 -Wall -Wextra)
|
||||
target_link_options(kinect10 PRIVATE
|
||||
-static
|
||||
-static-libgcc
|
||||
-static-libstdc++
|
||||
-Wl,--enable-stdcall-fixup
|
||||
-Wl,--kill-at
|
||||
)
|
||||
endif()
|
||||
|
||||
target_link_libraries(kinect10 PRIVATE ole32 oleaut32 uuid)
|
||||
@@ -1,23 +1,28 @@
|
||||
LIBRARY Kinect10
|
||||
EXPORTS
|
||||
NuiGetSensorCount
|
||||
NuiCreateSensorByIndex
|
||||
NuiCreateSensorById
|
||||
NuiInitialize
|
||||
NuiShutdown
|
||||
NuiSetDeviceStatusCallback
|
||||
NuiSkeletonTrackingEnable
|
||||
NuiSkeletonTrackingDisable
|
||||
NuiSkeletonGetNextFrame
|
||||
NuiSkeletonSetTrackedSkeletons
|
||||
NuiTransformSmooth
|
||||
NuiTransformDepthImageToSkeleton
|
||||
NuiImageStreamOpen
|
||||
NuiImageStreamGetNextFrame
|
||||
NuiImageStreamReleaseFrame
|
||||
NuiImageStreamSetImageFrameFlags
|
||||
NuiImageStreamGetImageFrameFlags
|
||||
NuiImageGetColorPixelCoordinatesFromDepthPixel
|
||||
NuiCameraElevationSetAngle
|
||||
NuiCameraElevationGetAngle
|
||||
NuiSetFrameEndEvent
|
||||
KinectShimReserved1 @1 NONAME
|
||||
NuiGetSensorCount @5
|
||||
NuiCreateSensorByIndex @6
|
||||
NuiCameraElevationGetAngle @7
|
||||
NuiCameraElevationSetAngle @8
|
||||
NuiImageGetColorPixelCoordinatesFromDepthPixel @9
|
||||
NuiImageGetColorPixelCoordinatesFromDepthPixelAtResolution @10
|
||||
NuiImageStreamGetNextFrame @11
|
||||
NuiImageStreamOpen @12
|
||||
NuiImageStreamReleaseFrame @13
|
||||
NuiInitialize @14
|
||||
NuiSetFrameEndEvent @15
|
||||
NuiShutdown @16
|
||||
NuiSkeletonGetNextFrame @17
|
||||
NuiSkeletonTrackingDisable @18
|
||||
NuiSkeletonTrackingEnable @19
|
||||
NuiTransformSmooth @20
|
||||
NuiCreateSensorById @21
|
||||
NuiSetDeviceStatusCallback @22
|
||||
NuiImageStreamSetImageFrameFlags @23
|
||||
NuiImageStreamGetImageFrameFlags @24
|
||||
NuiGetAudioSource @25
|
||||
NuiSkeletonSetTrackedSkeletons @26
|
||||
NuiSkeletonCalculateBoneOrientations @27
|
||||
NuiCreateCoordinateMapperFromParameters @28
|
||||
NuiCreateDepthFilter @29
|
||||
@@ -69,23 +69,24 @@ publishes a no-player frame (`dwTrackingID = 0`, zeroed depth/color), so the hos
|
||||
app never blocks and `NuiSkeletonGetNextFrame` reports no tracked skeleton rather
|
||||
than hanging.
|
||||
|
||||
## Exported NUI surface (21 functions, undecorated)
|
||||
## Exported NUI surface (25 named + 1 NONAME, pinned ordinals)
|
||||
|
||||
`NuiGetSensorCount`, `NuiCreateSensorByIndex`, `NuiCreateSensorById`,
|
||||
`NuiInitialize`, `NuiShutdown`, `NuiSetDeviceStatusCallback`,
|
||||
`NuiSkeletonTrackingEnable`, `NuiSkeletonTrackingDisable`,
|
||||
`NuiSkeletonGetNextFrame`, `NuiSkeletonSetTrackedSkeletons`, `NuiTransformSmooth`,
|
||||
`NuiTransformDepthImageToSkeleton`, `NuiImageStreamOpen`,
|
||||
`NuiImageStreamGetNextFrame`, `NuiImageStreamReleaseFrame`,
|
||||
`NuiImageStreamSetImageFrameFlags`, `NuiImageStreamGetImageFrameFlags`,
|
||||
`NuiImageGetColorPixelCoordinatesFromDepthPixel`, `NuiCameraElevationSetAngle`,
|
||||
`NuiCameraElevationGetAngle`, `NuiSetFrameEndEvent`.
|
||||
The export ordinals match the real Kinect for Windows 1.8 `Kinect10.dll`
|
||||
(v1.8.0.595) **exactly**, confirmed against a `dumpbin /exports` of the genuine
|
||||
DLL: ordinal base 1, a NONAME function at ordinal 1, then ordinals 5-29 (2/3/4
|
||||
unused), e.g. `NuiInitialize @14`, `NuiSetDeviceStatusCallback @22`. This matters
|
||||
because DEA imports by ordinal, not by name (the loader error "the ordinal 22
|
||||
could not be located" is a by-ordinal import of `NuiSetDeviceStatusCallback`); an
|
||||
ordinal mismatch fails the import even when the name is present. The authoritative
|
||||
map lives in `Kinect10.def`.
|
||||
|
||||
This is a **superset** of the minimum DEA imports named in the plan; the exact DEA
|
||||
import list comes from spike todo 4 (`dumpbin /imports gamekdm.dll`), which is
|
||||
Windows-gated. Over-exporting is safe (a drop-in must export *no fewer* than the
|
||||
game imports); if the spike reveals an additional symbol, add it to `Kinect10.def`
|
||||
and a stub in `src/exports.cpp`.
|
||||
Functions whose synthesis is out of scope are present only so a by-ordinal import
|
||||
resolves at load: `NuiGetAudioSource` (no audio) reports no source,
|
||||
`NuiSkeletonCalculateBoneOrientations` returns S_OK (the game derives pose from
|
||||
joint positions), and the undocumented `NuiCreateCoordinateMapperFromParameters` /
|
||||
`NuiCreateDepthFilter` return E_NOTIMPL. This is a **superset** of the minimum DEA
|
||||
imports; if a future `dumpbin /imports gamekdm.dll` reveals an additional symbol,
|
||||
add it to `Kinect10.def` at its real ordinal and a stub in `src/exports.cpp`.
|
||||
|
||||
### Decoration
|
||||
|
||||
|
||||
@@ -152,6 +152,46 @@ Vector4 WINAPI NuiTransformDepthImageToSkeleton(LONG lDepthX,
|
||||
|
||||
HRESULT WINAPI NuiSetFrameEndEvent(HANDLE, DWORD) { return S_OK; }
|
||||
|
||||
HRESULT WINAPI NuiImageGetColorPixelCoordinatesFromDepthPixelAtResolution(
|
||||
NUI_IMAGE_RESOLUTION eColorResolution,
|
||||
NUI_IMAGE_RESOLUTION,
|
||||
const NUI_IMAGE_VIEW_AREA*,
|
||||
LONG lDepthX,
|
||||
LONG lDepthY,
|
||||
USHORT,
|
||||
LONG* plColorX,
|
||||
LONG* plColorY) {
|
||||
return ColorCoordinatesFromDepthPixel(eColorResolution, lDepthX, lDepthY,
|
||||
plColorX, plColorY);
|
||||
}
|
||||
|
||||
// Audio is not synthesized; report no audio source so the game skips it rather
|
||||
// than dereferencing a bogus INuiAudioBeam. ppDmo is INuiAudioBeam**.
|
||||
HRESULT WINAPI NuiGetAudioSource(void** ppDmo) {
|
||||
if (ppDmo != nullptr) {
|
||||
*ppDmo = nullptr;
|
||||
}
|
||||
return E_NUI_DEVICE_NOT_CONNECTED;
|
||||
}
|
||||
|
||||
// Bone orientations are derived by the game from joint positions when needed;
|
||||
// the real export exists so a by-ordinal import (ordinal 27) resolves.
|
||||
HRESULT WINAPI NuiSkeletonCalculateBoneOrientations(const NUI_SKELETON_DATA*,
|
||||
void*) {
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
// Undocumented 1.8 exports (ordinals 28/29): present so a by-ordinal import
|
||||
// resolves at load; DEA does not drive these. Signatures match arg counts only.
|
||||
HRESULT WINAPI NuiCreateCoordinateMapperFromParameters(ULONG, void*, void**) {
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
HRESULT WINAPI NuiCreateDepthFilter(void**) { return E_NOTIMPL; }
|
||||
|
||||
// Ordinal 1 in the real DLL is NONAME; stubbed so the slot exists.
|
||||
void* WINAPI KinectShimReserved1(void) { return nullptr; }
|
||||
|
||||
}
|
||||
|
||||
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD reason, LPVOID) {
|
||||
|
||||
Reference in new issue
Block a user