FSCTL_QUERY_ALLOCATED_RANGES (Windows CE 5.0)

Send Feedback

This IOCTL scans a file or alternate stream looking for ranges that may contain nonzero data. Only compressed or sparse files can have zeroed ranges 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 retrieve 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, DeviceIoControl returns a nonzero value.

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

Requirements

OS Versions: Windows CE 5.0 and later.
Header: Fsioctl.h

See Also

FSD IOCTLs | CreateFile | FILE_ALLOCATED_RANGE_BUFFER | DeviceIoControl | GetLastError

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.