Files
CoopAllTheThings/common/include
BlackMark 5e9b1cde4c Pin the whole SharedBlock layout with static_asserts (ABI tripwire)
The cross-process block's layout is a wire protocol shared by the x64 host and the
x86 hook, but only three front offsets were asserted, and hook_selftest's
dump_layout merely printed the rest. A field reordered/resized inside HookStatus
(which precedes control/video/mkb) would silently shift everything with no
compile-time tripwire and, if the developer forgot to bump kProtocolVersion, ship
a silent host<->DLL mismatch.

- protocol.hpp now static_asserts sizeof(SharedBlock) and every sub-channel offset
  (status/control/video/mkb) plus each sub-struct size (HookStatus/HookControl/
  VideoShare/AudioStreamInfo/HookEntry/MkbRing). protocol.hpp is compiled for both
  arches, so a cross-bitness divergence fails to compile on the one that disagrees.
- hook_selftest's dump_layout now ASSERTS the same numbers instead of only
  printing, so hook_selftest_x86 confirms the x86 layout at runtime too.

Verified: x64 and x86 builds both compile (identical layout) and both selftests
pass; sizeof(SharedBlock)=3936 on both.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-24 01:47:19 +02:00
..