Check previously-ignored injection / capture / rumble return values

- injector bitness gate: IsWow64Process2 failure was treated as "native", which
  would send the x64 DLL into a 32-bit target. Fall back to the legacy
  IsWow64Process before giving up to permissive.
- injector helper exit: GetExitCodeProcess's BOOL was ignored; on a failed query
  surface GetLastError instead of a misleading exit code.
- window_capture: CreateShaderResourceView's HRESULT was ignored, and width_/
  height_ were committed even on failure, so the (latest_ == nullptr) recreate
  guard never retried -- a silently black mirror until the next resize. Only
  commit the dims on success; otherwise drop latest_ so the next frame retries.
- xinput rumble: make the best-effort XInputSetState ignore explicit (a
  disconnected pad re-syncs on the next refresh; the result isn't actionable).

The GetClientRect/ClientToScreen reads in mkb_forward are left as-is: a failure
there is a single self-correcting frame (the mapping is rejected and reused next
frame), so checking them adds no actionable behavior.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-24 01:43:55 +02:00
parent 12c4fb8a07
commit 1a93fcf196
4 changed files with 28 additions and 14 deletions

View File

@@ -113,12 +113,6 @@ default** and covers anything the hooked path doesn't.
From an in-depth review pass. Each item is fixed test-first (a failing test, then the fix) and lands
as its own commit; "verify" items are confirmed real before any change, and dropped if not.
Robustness (verify, then fix if real):
- **Permissive injector bitness gate** — `IsWow64Process2` failure is treated as 64-bit; fall back to
`IsWow64Process` instead of mis-injecting.
- **Ignored HRESULT/BOOL returns** — `CreateShaderResourceView`, `GetClientRect`/`ClientToScreen`,
`XInputSetState`, `GetExitCodeProcess`: check and surface/handle.
Cross-process / ABI:
- **Tie `kProtocolVersion` to the layout** — `static_assert` `sizeof(SharedBlock)` + the full offset
set, and make `hook_selftest`'s `dump_layout` assert instead of only printing.