3.4.5.2.24.5 IVdsAdvancedDisk::ChangeAttributes (Opnum 7)

The ChangeAttributes method changes the attributes of the partition at byte offset ullOffset on the disk.

 HRESULT ChangeAttributes(
   [in] ULONGLONG ullOffset,
   [in] CHANGE_ATTRIBUTES_PARAMETERS* para
 );

ullOffset: The byte offset of the partition, from the beginning of the disk. This offset MUST be the offset of the start of a partition.

para: A pointer to a CHANGE_ATTRIBUTES_PARAMETERS structure that describes the attributes to change.

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 This method is not valid on CD/DVD or super floppy devices. These devices do not support partition tables.

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

  • Verify that para is not NULL.

  • Verify that the partition format in input parameter para matches the current partition format of the disk.

The server MUST perform the following:

  • Change the attributes of the partition following the parameters specified to the method. If the disk partitioning format is MBR, the only value that can be changed is the bootIndicator. If the disk partitioning format is GPT, the only value that can be changed is the GPT attributes. The disk partitioning format cannot be changed using this method. For information on changing partition attributes, see section 2.2.2.11.1.1.

  • If attributes on the partition were successfully changed, for each callback object that is registered in the list of callback objects, call the callback object's IVdsAdviseSink::OnNotify (Opnum 3) method by using a VDS_NOTIFICATION structure that has the following attributes:

    • objectType member is VDS_NTT_PARTITION.

    • Partition member is a VDS_PARTITION_NOTIFICATION that has the following attributes:

      • ulEvent is VDS_NF_PARTITION_MODIFY.

      • diskId is the VDS_OBJECT_ID of the disk object corresponding to the disk on which the partition attribute was modified.

      • ullOffset is the byte offset where the partition started on the disk.<96>

  • If attributes on the partition were successfully changed, and a volume exists on the partition, for each callback object registered in the list of callback objects, call the callback object's IVdsAdviseSink::OnNotify (Opnum 3) method by using a VDS_NOTIFICATION structure that has the following attributes:

    • objectType member is VDS_NTT_VOLUME.

    • Volume member is a VDS_VOLUME_NOTIFICATION that has the following attributes:

      • ulEvent is VDS_NF_VOLUME_MODIFY.

      • volumeId is the VDS_OBJECT_ID of this volume object.

      • plexId is NULL GUID, but it is not relevant when ulEvent is VDS_NF_VOLUME_MODIFY.

      • ulPercentCompleted range is 0-100 and is implementation specific; however, it is not relevant when ulEvent is VDS_NF_VOLUME_MODIFY.

  • Return an HRESULT indicating failure or success.