#ifndef _NTIOAPI_H
/**
* The NtReadFileScatter routine reads data from a file and scatters it into a set of buffers.
*
* \param[in] FileHandle Handle to the file.
* \param[in, optional] Event Handle to an event.
* \param[in, optional] ApcRoutine Pointer to an APC routine.
* \param[in, optional] ApcContext Pointer to an APC context.
* \param[out] IoStatusBlock Pointer to an IO_STATUS_BLOCK structure.
* \param[in] SegmentArray Pointer to an array of FILE_SEGMENT_ELEMENT structures that specify the buffers.
* \param[in] Length The number of bytes to be read from the file.
* \param[in, optional] ByteOffset Pointer to a variable that specifies the starting byte offset in the file.
* \param[in, optional] Key Device and intermediate drivers should set this pointer to NULL.
* \return NTSTATUS Successful or errant status.
* \sa https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-readfilescatter
*/
NTSYSCALLAPI
NTSTATUS
NTAPI
NtReadFileScatter(
_In_ HANDLE FileHandle,
_In_opt_ HANDLE Event,
_In_opt_ PIO_APC_ROUTINE ApcRoutine,
_In_opt_ PVOID ApcContext,
_Out_ PIO_STATUS_BLOCK IoStatusBlock,
_In_ PFILE_SEGMENT_ELEMENT SegmentArray,
_In_ ULONG Length,
_In_opt_ PLARGE_INTEGER ByteOffset,
_In_opt_ PULONG Key
);
View code on GitHub#ifndef _NTZWAPI_H
NTSYSCALLAPI
NTSTATUS
NTAPI
ZwReadFileScatter(
_In_ HANDLE FileHandle,
_In_opt_ HANDLE Event,
_In_opt_ PIO_APC_ROUTINE ApcRoutine,
_In_opt_ PVOID ApcContext,
_Out_ PIO_STATUS_BLOCK IoStatusBlock,
_In_ PFILE_SEGMENT_ELEMENT SegmentArray,
_In_ ULONG Length,
_In_opt_ PLARGE_INTEGER ByteOffset,
_In_opt_ PULONG Key
);
View code on GitHubNo description available.
Function NtReadFileScatter reads specified block from file into multiple buffers. Each buffer must have one page length (0x1000 bytes on x86).
HANDLE to File Object opened with FILE_READ_DATA access and with FILE_NO_INTERMEDIATE_BUFFERING open option.
HANDLE to Event Object signaled when reading is complete. This parameter is optional, but caller should use one of notification way, because function always use asynchronous reading method.
Optional pointer to user's APC Routine.
User's parameter for ApcRoutine.
IO result of call.
Array of FILE_SEGMENT_ELEMENT unions. Any element point to allocated memory page address. Last element of array must be NULL.
Number of bytes to read.
Pointer to LARGE_INTEGER value indicates reading start position.
Optional pointer to user's key, used when file is locked (see NtLockFile).
See also ReadFileScatter description in Microsoft SDK.