Files
LibretroAdmin 4206fe8f52 streams, zip, vfs: reads at offsets through intfstream and the zip reader; Windows second handle from ntdll
intfstream_read_at reads at an offset and leaves the stream's position
where it was: files and memory streams without touching the stream, so
from several threads at once, CHD tracks by seeking there and back. The
buffered stream reads from the file and keeps its window, and its own
refills and wide reads go to the file at the offset. memstream_read_at
backs memory streams. The CUE/ISO serial detectors read their probes
this way.

The zip reader takes its end records, directory, local headers and
member chunks with one read at the offset each, where the file has
them; the reads the stream lends from stay as they are.

The Windows second handle is opened relative to the stream's own with
an empty name through ntdll's NtCreateFile on every NT. From Vista on
that is what ReOpenFile does; before it the handle is kept only when
its volume and file index match the stream's, else the path reopen
follows.

Lanes: intfstream_read_at_test (file, buffered, memory; four threads),
vfs_positional_ntverify_test (the check, on any version); archive_zip64
counts reads at offsets as reads through the stream.
2026-11-12 18:40:38 +01:00
..