3.2.4.4.3.7 IVolumeClient3::InitializeDiskStyle (Opnum 9)

The InitializeDiskStyle method sets the partition style and writes a signature to a disk. This is a synchronous task.

 HRESULT InitializeDiskStyle(
   [in] LdmObjectId diskId,
   [in] PARTITIONSTYLE style,
   [in] hyper diskLastKnownState,
   [out] TASK_INFO* tinfo
 );

diskId: Specifies the OID of the target disk for the signature.

style: Value from the PARTITIONSTYLE enumeration that indicates the partition style to use.

diskLastKnownState: Last known modification sequence number of the disk.

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).

Upon receiving this message, the server MUST validate parameters:

  1. Verify that the disk specified by diskId is in the list of storage objects, and check whether diskLastKnownState matches the LastKnownState field of the object.

  2. Verify that tinfo is not NULL.

If parameter validation fails, the server MUST fail the operation immediately, returning an appropriate error as its response to the client.

Otherwise, the server MUST process the message as follows:

  1. Initialize the disk specified by diskId with an empty partition table and write a signature to it.

    • If style is PARTITIONSTYLE_MBR, the disk is initialized with an MBR partition table and signature.

    • If style is PARTITIONSTYLE_GPT, the disk is initialized with a GPT partition table and signature.

  2. Wait for the initialization to either succeed or fail.

  3. Fill in the tinfo output parameter.

    TASK_INFO member

    Required for this operation

    TASK_INFO::id

    Required.

    TASK_INFO::storageId

    Not required.

    TASK_INFO::createTime

    Not required.<191>

    TASK_INFO::clientID

    Not required.<192>

    TASK_INFO::percentComplete

    Required for any task that returns REQ_IN_PROGRESS.

    TASK_INFO::status

    Required.

    TASK_INFO::type

    Required if PercentageComplete is being used.

    TASK_INFO::error

    Required.

    TASK_INFO::tflag

    Not required.<193>

  4. Return a response to the client containing tinfo and the status of the operation.

If the operation is successful, the server MUST make the following change to the list of storage objects before returning the response:

  • Modify the disk object to account for the change of status.