xmem maps the title's physical pages as views of a reserve-only section and commits each page in a vectored handler
when user-mode code first faults on it. A kernel write raises no such fault: ReadFile into a page nobody touched yet
fails with ERROR_NOACCESS (998). The retail title's file reader treats any error but 6, 0x26 and 0x57 as transient
and calls Sleep(1) and ReadFile again forever, so the boot never leaves its first frame loop; DirectStorage reads
into the same memory came back as E_DSTORAGE_ACCESS_VIOLATION and the title stopped on an int3.
The ReadFile import of the file shims, and DirectStorage's read_file_range, now read one byte of every page of the
destination from user mode on ERROR_NOACCESS (the handler commits them) and read again once. file_system_test checks
it on a reserve-only section with a first-touch handler: the host ReadFile fails with ERROR_NOACCESS, the shimmed one
reads every byte.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The merge that brought the mirrored pull requests into main (6dece9231) left the DirectStorage shim out, noting
that it "needs the typed-error zlib inflate". The shim's commits (f87d05fdd, ac1843da2, 00551ba00, by
mariuslozo-boop and Kelebek) are ancestors of main, but its files are not in the tree, so the retail
executable's XCRDAPI.dll!DStorageGetFactory import is unimplemented (issue #47, stop 5 of
docs/retail_boot_chain.md).
- shims/dstorage.cpp, shims/dstorage_xs_abi.h, test/dstorage_test.cpp and docs/directstorage.md are back as
those commits left them.
- leonida::zlib_inflate reports why it failed through an optional ZlibError* (header, data, checksum, limit),
which the shim turns into its E_DSTORAGE_ZLIB_* codes. This is the same interface the shim was written
against, added to main's current table-driven inflater; callers that pass no pointer behave as before.
- registry.cpp classes xcrdapi.dll!DStorageGetFactory as an HRESULT import, the retail spelling #47 found
missing.
- CMake and scripts/build_runtime.ps1 build the shim into gta6rt, and CMake builds and registers dstorage_test.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt