2.1.5.9.17 FSCTL_GET_RETRIEVAL_POINTER_COUNT
The server provides:
Open: An Open of a DataStream or DirectoryStream.
StartingVcnBuffer: An array of bytes containing a STARTING_VCN_INPUT_BUFFER as described in [MS-FSCC] section 2.3.29.
OutputBufferSize: The maximum number of bytes to return in OutputBuffer.
On completion, the object store MUST return:
OutputBuffer: An array of bytes that will return a RETRIEVAL_POINTER_COUNT as defined in [MS-FSCC] section 2.3.30.
BytesReturned: The number of bytes returned to the caller.
Status: An NTSTATUS code that specifies the result.
Pseudocode for the operation is as follows:
Phase 1 -- Verify Parameters
If the size of StartingVcnBuffer is less than sizeof(STARTING_VCN_INPUT_BUFFER), the operation MUST be failed with STATUS_INVALID_PARAMETER.
If OutputBufferSize is smaller than sizeof(RETRIEVAL_POINTER_COUNT), the operation MUST be failed with STATUS_BUFFER_TOO_SMALL.
If StartingVcnBuffer.StartingVcn is negative, the operation MUST be failed with STATUS_INVALID_PARAMETER.
If StartingVcnBuffer.StartingVcn is greater than or equal to Open.Stream.AllocationSize divided by Open.File.Volume.ClusterSize, the operation MUST be failed with STATUS_END_OF_FILE.
Phase 2 -- Locate and count the extents.
Find the first Extent in Open.Stream.ExtentList where Extent.NextVcn is greater than StartingVcnBuffer.StartingVcn.
Increment OutputBuffer.ExtentCount by 1. If the element is the first one in Open.Stream.ExtentList, set OutputBuffer.ExtentCount to 1 instead.
Repeat till the end of Open.Stream.ExtentList.
Upon successful completion of the operation, the object store MUST return:
BytesReturned set to sizeof(RETRIEVAL_POINTER_COUNT).
Status set to STATUS_SUCCESS.