IVdsAdvancedDisk2::ChangePartitionType method (vds.h)
[Beginning with Windows 8 and Windows Server 2012, the Virtual Disk Service COM interface is superseded by the Windows Storage Management API.]
Changes the partition type on the disk at a specified byte offset.
Syntax
HRESULT ChangePartitionType(
[in] ULONGLONG ullOffset,
[in] BOOL bForce,
[in] CHANGE_PARTITION_TYPE_PARAMETERS *para
);
Parameters
[in] ullOffset
Byte offset of the partition from the beginning of the disk. This offset must be the offset of the start of a partition.
[in] bForce
Boolean value that indicates whether change will be forced.
[in] para
Pointer to a CHANGE_PARTITION_TYPE_PARAMETERS structure that contains the partition type that the partition at the location specified by the ullOffset parameter will be changed to.
Return value
This method can return standard HRESULT values, such as E_INVALIDARG or E_OUTOFMEMORY, and VDS-specific return values. It can also return converted system error codes using the HRESULT_FROM_WIN32 macro. Errors can originate from VDS itself or from the underlying VDS provider that is being used. Possible return values include the following.
Return code/value | Description |
---|---|
|
The partition type was changed successfully. |
|
The partition is in use. |
|
An internal error occurred. Check the event log for more details. |
|
The specified partition type is not valid for this operation. |
|
The changing of the partition type on dynamic disks is not supported. |
|
The partition does not exist. |
|
This operation is not supported on LDM partitions. |
|
This operation is not supported on MSR partitions. |
|
The specified partition style does not match that of the disk. |
Remarks
If an OEM partition is formatted as FAT or FAT32, the partition type does not change. If it is formatted with NTFS, the partition type changes to PARTITION_IFS (0x07). For information about partition types, see CREATE_PARTITION_PARAMETERS.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows Vista [desktop apps only] |
Minimum supported server | Windows Server 2008 [desktop apps only] |
Target Platform | Windows |
Header | vds.h |
Library | Uuid.lib |