Share via


FSCTL_QUERY_ALLOCATED_RANGES

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

This I/O control scans a file or alternate stream looking for ranges that contain nonzero data. Only compressed or sparse files can have ranges set to zero known to the OS. For other files, the output buffer contains only a single entry that contains the starting point and the length requested.

Parameters

  • hDevice
    [in] Handle to the file or alternate stream to be queried for allocated ranges. To obtain a handle, call the CreateFile function.
  • dwIoControlCode
    [in] Set to FSCTL_QUERY_ALLOCATED_RANGES.
  • lpInBuf
    [in] Pointer to a FILE_ALLOCATED_RANGE_BUFFER structure that indicates the portion of the file to search for allocated ranges. The FileOffset member indicates the offset, in bytes, to the first byte of the range to search, and the Length member indicates its size, in bytes.
  • nInBufSize
    [in] Size of the input buffer, in bytes.
  • lpOutBuf
    [out] Pointer to a buffer that receives an array of FILE_ALLOCATED_RANGE_BUFFER structures. Each structure in the array provides information about an allocated range within the file. The FileOffset member of each structure indicates the beginning of a range, and the Length member indicates its size, in bytes.
  • nOutBufSize
    [in] Size of the output buffer, in bytes.
  • lpBytesReturned
    [out] Pointer to a variable that receives the size of the data stored in the output buffer, in bytes.
  • lpOverlapped
    Not used.

Return Values

If the operation succeeds, the DeviceIoControl** function returns a nonzero value.**

If the operation fails, DeviceIoControl returns zero. For extended error information, call GetLastError.

Requirements

Header fsioctl.h
Windows Embedded CE Windows CE 5.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also

Reference

FS I/O Controls
CreateFile
FILE_ALLOCATED_RANGE_BUFFER

Other Resources

DeviceIoControl