// ntifs.h
// CTL_CODE(0x0009, 0x0a1, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_QUERY_FILE_REGIONS 0x00090284
View the official Windows Driver Kit DDI referenceNo description available.
FSCTL_QUERY_FILE_REGIONS queries a list of file regions, based on a specified usage parameter, for the file associated with the handle on which this FSCTL was invoked. This message contains an optional FILE_REGION_INPUT data element. If no FILE_REGION_INPUT parameter is specified, information for the entire size of the file is returned.
FSCTL_QUERY_FILE_REGIONS
Pointer to a FILE_REGION_INPUT structure that indicates the file region(s) to query.
Size of the FILE_REGION_INPUT structure that InputBuffer points to, in bytes.
Pointer to a FILE_REGION_OUTPUT structure in which the results of the query are returned.
Size of the buffer that OutputBuffer points to, in bytes.
n/a
n/a
Reserved for system use.
To perform this operation, call FltFsControlFile or ZwFsControlFile with the following parameters.
| Parameter | Description |
|---|---|
| Instance | [in] For FltFsControlFile only. An opaque instance pointer for the caller. This parameter is required and cannot be NULL. |
| FileObject | [in] For FltFsControlFile only. A file object pointer for the file or directory that is the target of this request. This parameter is required and cannot be NULL. |
| FileHandle | [in] For ZwFsControlFile only. File handle of the file or directory that is the target of this request. This parameter is required and cannot be NULL. |
| IoStatusBlock | [out] For ZwFsControlFile only. Pointer to an IO_STATUS_BLOCK structure in which the final status of the request is returned. |
| FsControlCode | [in] Set to FSCTL_QUERY_FILE_REGIONS. |
| InputBuffer | [in/optional] Pointer to a FILE_REGION_INPUT structure that indicates the file region(s) to query. |
| InputBufferLength | [in] Size of the buffer that InputBuffer points to, in bytes. |
| OutputBuffer | [out] Pointer to a FILE_REGION_OUTPUT structure in which the results of the query are returned. |
| OutputBufferLength | [out] Size of the buffer that OutputBuffer points to, in bytes. |
| LengthReturned | [out] Pointer to a caller-allocated variable that receives the size in bytes of the information returned in the buffer at OutputBuffer. |
FSCTL_QUERY_FILE_REGIONS returns STATUS_SUCCESS upon successful completion; otherwise it returns an error code. On successful completion, the caller should first verify that IoStatus.Information is greater than or equal to LengthReturned before accessing the information returned in OutputBuffer.