3.4.5.2.21.4 IVdsDisk::QueryExtents (Opnum 6)

The QueryExtents method enumerates a disk's extents.

 HRESULT QueryExtents(
   [out, size_is(,*plNumberOfExtents)] 
     VDS_DISK_EXTENT** ppExtentArray,
   [out] long* plNumberOfExtents
 );

ppExtentArray: A pointer to an array of VDS_DISK_EXTENT structures that, if the operation is successfully completed, receives the array of disk extent properties.

plNumberOfExtents: A pointer to a variable that, if the operation is successfully completed, receives the total number of elements in ppExtentArray.

Return Values: The method MUST return zero or a non-error HRESULT (as specified in [MS-ERREF]) to indicate success, or return an implementation-specific nonzero error code to indicate failure. For the HRESULT values predefined by the Virtual Disk Service Remote Protocol, see section 2.2.3.

Note Free extents are not returned for CD/DVD or super floppy devices.

When the server receives this message, it MUST validate the following parameters:

  • Verify that ppExtentArray is not NULL.

  • Verify that plNumberOfExtents is not NULL.

The server MUST point ppExtentArray to an array of VDS_DISK_EXTENT structures containing information about each disk extent on the disk, point plNumberOfExtents to the number of elements in the array, and return an HRESULT indicating failure or success.

For removable media drives, the server MUST set the value of volumeId and plexId in the VDS_DISK_EXTENT structure to the VDS_OBJECT_ID of the volume and volume plex object associated with the drive.

For removable media drives with no media, the server MUST return a single extent of type VDS_DET_UNKNOWN with the values of ullOffset and ullSize set to 0.