Hi, I found a possible issue in LcRead() when the requested range is fully contained in the first 4KiB page.
Reproduction:
- page-aligned pa
- LcRead(hLC, pa, 1, buffer) returns FALSE
- a valid 4KiB-aligned LcReadScatter() request for the same page succeeds
In LcRead(), for pa aligned and cb = 1:
fFirst = TRUE
fLast = FALSE
cbData = cb - (0x1000 - (pa & 0xfff))
= 1 - 0x1000
= 0xfffff001
LcAllocScatter3() then rejects cbData, so LcRead() fails before issuing the backend read.
Was the intended calculation to subtract the actual first-page bytes, e.g.:
cbFirst = min(cb, 0x1000 - (pa & 0xfff));
cbData = cb - cbFirst - cbLast;
Is LcRead() intended to support sub-page contiguous reads such as 1B, 64B, and 4095B? The public API appears to imply that it should, while MEM_SCATTER entries remain page/DWORD constrained.
Hi, I found a possible issue in LcRead() when the requested range is fully contained in the first 4KiB page.
Reproduction:
In LcRead(), for pa aligned and cb = 1:
LcAllocScatter3() then rejects cbData, so LcRead() fails before issuing the backend read.
Was the intended calculation to subtract the actual first-page bytes, e.g.:
Is LcRead() intended to support sub-page contiguous reads such as 1B, 64B, and 4095B? The public API appears to imply that it should, while MEM_SCATTER entries remain page/DWORD constrained.