Files
mandy/runtime/test
Jan Trencansky 6edfe235b2 xmem: the title's VirtualProtect never reports or restores one of our guards as its protection (RT-TITLE-TEXTURE-WRITE-TRACKED)
Run 62 died on a write to a title page left read-only with no guard to answer for it ("stray read-only title
page ... no guard owns it"). TitleVirtualProtect passed the title's call straight through: over a page one of
our guards (a slot-133 shadow's, or a geometry-watch cell, which the title texture watch now arms over all
watched texture memory) had made read-only, the call returned that read-only protection in `old`, and its
Event::replaced made the cell forget the page. A title that saves `old` and sets it back later then made the
page read-only for good, with no owner, and its next write faulted.

The call now runs under a kernel-write pin over the range (kernel_writes::begin_write, as ReadFile does): our
guards come off first and no refresh puts one back until it returns, so `old` is the title's own protection.

Test: d3d12_xmem_placed's "title VirtualProtect over a guard" (an armed cell, the title's VirtualProtect to
read-write and back to what it reported, then a write); it fails without this (`old` is PAGE_READONLY).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 04:07:38 -05:00
..