3.2.4.4.1.5 IVolumeClient::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, specified as a single case-insensitive Unicode character.

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

cchAccessPath: Length of the AccessPath parameter, in 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.

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

Value

Meaning

FALSE

0

File system will be quickly formatted.

TRUE

1

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

dwFlags: Bitmap of partition creation flags. The value of this field is generated by combining zero or more of the following applicable flags with a logical OR operation.

Value

Meaning

CREATE_ASSIGN_ACCESS_PATH

0x00000001

Assign the mount point AccessPath to the new partition.

tinfo: Pointer to a TASK_INFO structure 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] section 2.1; see also section 2.2.1 for HRESULT values predefined by the Disk Management Remote Protocol).

The behavior of the server is identical to that described for IVolumeClient::CreatePartitionAssignAndFormat, with the following difference: Before returning the response to the client, the server MUST create a mount point for the volume under AccessPath if instructed by the client to do so. This step MUST be taken after the drive letter assignment succeeds and before the format operation is attempted.