IVdsDiskPartitionMF2::FormatPartitionEx2 method (vds.h)
Formats an existing OEM, ESP, or unknown partition. This method is identical to the IVdsDiskPartitionMF::FormatPartition method, except that formatting options are specified by using the Options parameter.
HRESULT FormatPartitionEx2( ULONGLONG ullOffset, LPWSTR pwszFileSystemTypeName, USHORT usFileSystemRevision, ULONG ulDesiredUnitAllocationSize, LPWSTR pwszLabel, DWORD Options, IVdsAsync **ppAsync );
The byte offset of the partition from the beginning of the disk. This offset must be the offset of the start of a partition.
A NULL-terminated Unicode string containing the name of the file system with which to format the partition. Must be NULL or one of the following: "NTFS", "FAT","FAT32", "UDF", or "EXFAT". If this parameter is NULL, a default value is used. For more information, see VDS_FILE_SYSTEM_FORMAT_SUPPORT_FLAG.
The revision of the file system, if any. This member is expressed as a 16-bit binary-coded decimal number, where a decimal point is implied between the second and third digits. For example, a value of 0x0250 indicates revision 2.50.
The size of the allocation unit for the file system, in bytes. The value must be a power of 2. If the value is 0, a default allocation unit determined by the file system type will be used. The allocation unit range is file system dependent.
A NULL-terminated Unicode string containing the label to assign to the new file system for the partition. The maximum label size is file system dependent.
A bitmask of VDS_FORMAT_OPTION_FLAGS enumeration values that specify formatting options.
A pointer to an IVdsAsync interface that upon successful completion receives the IVdsAsync interface to monitor and control this operation. Callers must release the interface received when they are done with it.
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.
||The volume was partitioned successfully.|
||A provider returned bad data.|
||The operation is not supported on removable media.|
||The default file system could not be determined.|
||The disk is missing.|
||The partition does not exist.|
||The operation is not supported on non-OEM partitions.|
In addition, the IVdsAsync interface can return the following related warnings and error codes.
||The file system is formatted but not compressed.|
||Access is denied.|
||The label is not valid.|
||The volume cannot be quick-formatted.|
||The number of clusters is too large to be represented as a 32-bit integer.|
||The cluster size is too large to allow formatting.|
||The cluster size is too small to allow formatting.|
||The file system is incompatible.|
||The media is incompatible.|
||An I/O error occurred during format.|
||The media is write-protected.|
||The volume size is too large to format.|
||The volume size is too small to format.|
|Minimum supported client||Windows 7 [desktop apps only]|
|Minimum supported server||Windows Server 2008 R2 [desktop apps only]|