3.2.4.4.3.5 IVolumeClient3::CreatePartitionAssignAndFormatEx (Opnum 7)

The CreatePartitionAssignAndFormatEx method creates a partition, formats it as a file system, and assigns it a drive letter and a mount point.

 HRESULT CreatePartitionAssignAndFormatEx(
   [in] REGION_SPEC partitionSpec,
   [in] wchar_t letter,
   [in] hyper letterLastKnownState,
   [in] int cchAccessPath,
   [in, size_is(cchAccessPath)] wchar_t* AccessPath,
   [in] FILE_SYSTEM_INFO fsSpec,
   [in] boolean quickFormat,
   [in] DWORD dwFlags,
   [out] TASK_INFO* tinfo
 );

partitionSpec: A REGION_SPEC structure that defines the type and length of the partition to create.

letter: Drive letter to assign to the new volume.

letterLastKnownState: Drive letter's last known modification sequence number.

cchAccessPath: Length of the AccessPath parameter, in Unicode characters, including the terminating null character.

AccessPath: Null-terminated Unicode string that specifies the path in which the new file system is being mounted. This parameter is used to supply a mounted folder path for the case where the new partition will be mounted to a directory on another volume.

fsSpec: A FILE_SYSTEM_INFO structure that defines the file system to create. This parameter is returned from a call to EnumLocalFileSystems().

quickFormat: Value that indicates whether the server will fully format or quickly format the file system.

Value

Meaning

FALSE

0

File system will be fully formatted. Full format requires verifying the accessibility of all sectors on the volume.

TRUE

1

File system will be quickly formatted.

dwFlags: Bitmap of partition creation flags.

Value

Meaning

CREATE_ASSIGN_ACCESS_PATH

0x00000001

Assign the mount point AccessPath to the new partition.

tinfo: Pointer to a TASK_INFO structure that the client can use to track the request's progress.

Return Values: The method MUST return 0 or a nonerror HRESULT on success, or an implementation-specific nonzero error code on failure (as specified in [MS-ERREF]; see also section 2.2.1 for HRESULT values predefined by the Disk Management Remote Protocol).

When the server receives an IVolumeClient3::CreatePartitionAssignAndFormatEx message, it MUST process that message, as specified in IVolumeClient::CreatePartitionAssignAndFormatEx (section 3.2.4.4.1.5).