<div class="content"><p> </p><p>The DeletePartitionsForVolume method deletes the partitions
underneath a dynamic <span><a href="3c91641b-e5cd-409e-a445-2e4d61ae33c6#gt_c4133b2a-a990-4042-ba44-7fda3090f118" data-linktype="relative-path">disk</a></span> <span><a href="3c91641b-e5cd-409e-a445-2e4d61ae33c6#gt_9a876829-33a1-4f0b-8b81-8552b7e5561c" data-linktype="relative-path">volume</a></span>.
This is a synchronous task.</p><dl>
<dd>
<div><pre> HRESULT DeletePartitionsForVolume(
   [in] LdmObjectId volumeId,
   [in] hyper volumeLastKnownState,
   [out] TASK_INFO* tinfo
 );
</pre></div>
</dd></dl><p><b>volumeId: </b>Specifies the OID of the volume
under which to delete partitions.</p><p><b>volumeLastKnownState: </b>Last known <span><a href="3c91641b-e5cd-409e-a445-2e4d61ae33c6#gt_5a574d80-6bdb-4fb0-a0dd-b0601d16b4cd" data-linktype="relative-path">modification
sequence number</a></span> of the volume.</p><p><b>tinfo: </b>Pointer to a <span><a href="d55c167e-c6ad-445f-951c-9ac2d0de7a11" data-linktype="relative-path">TASK_INFO</a></span> structure
that the client can use to track the request&#39;s progress.</p><p><b>Return Values: </b>The method MUST return 0 or a
nonerror <a href="../ms-dtyp/a9046ed2-bfb2-4d56-a719-2824afce59ac" data-linktype="relative-path"><span>HRESULT</span></a> on success, or
an implementation-specific nonzero error code on failure (as specified in <span><a href="../ms-erref/1bc92ddf-b79e-413c-bbaa-99a5281a6c90" data-linktype="relative-path">[MS-ERREF]</a></span>;
see also section <span><a href="31eea9e6-25b0-4309-8f4a-50c74fbedc9b" data-linktype="relative-path">2.2.1</a></span> for HRESULT
values predefined by the Disk Management Remote Protocol).</p><p>Upon receiving this message, the server MUST validate
parameters:</p><ol><li><p><span>    </span>Verify that the <span><a href="3c91641b-e5cd-409e-a445-2e4d61ae33c6#gt_80affbd0-04b4-489e-be50-ddf9383e5d28" data-linktype="relative-path">dynamic
volume</a></span> specified by <i>volumeId</i> is in the list of storage objects,
and check whether the field <b>volumeSpec.lastKnownState</b> matches the field <b>LastKnownState</b>
of the object.</p>
</li><li><p><span>    </span>Verify that <i>tinfo</i>
is not NULL.</p>
</li></ol><p>If parameter validation fails, the server MUST fail the
operation immediately, returning an appropriate error as its response to the
client.</p><p>Otherwise, the server MUST process the message as follows:</p><ol><li><p><span>    </span>Enumerate all <span><a href="3c91641b-e5cd-409e-a445-2e4d61ae33c6#gt_753cb2b4-3f5c-48f3-97ef-61612c40499e" data-linktype="relative-path">disk
regions</a></span> that correspond to the dynamic volume specified by <i>volumeId</i>
from the list of storage objects.</p>
</li><li><p><span>    </span>For each disk
region, delete the entry in the <span><a href="3c91641b-e5cd-409e-a445-2e4d61ae33c6#gt_cee39671-0b98-4ca3-904d-018780e7042f" data-linktype="relative-path">partition table</a></span> of
its disk that has the same offset and length as the disk region. </p>
</li><li><p><span>    </span>Wait for the
partition deletions to succeed or fail. </p>
</li><li><p><span>    </span>Fill in the <i>tinfo</i>
output parameter.</p>
<table><thead>
  <tr>
   <th>
   <p>TASK_INFO member</p>
   </th>
   <th>
   <p>Required for this operation</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>
  <p>TASK_INFO::id</p>
  </td>
  <td>
  <p>Required.</p>
  </td>
 </tr><tr>
  <td>
  <p>TASK_INFO::storageId</p>
  </td>
  <td>
  <p>Not required.</p>
  </td>
 </tr><tr>
  <td>
  <p>TASK_INFO::createTime</p>
  </td>
  <td>
  <p>Not required.<a id="Appendix_A_Target_207"></a><a aria-label="Product behavior note 207" href="5f5043a3-9e6d-40cc-a05b-1a4a3617df32#Appendix_A_207" data-linktype="relative-path">&lt;207&gt;</a></p>
  </td>
 </tr><tr>
  <td>
  <p>TASK_INFO::clientID</p>
  </td>
  <td>
  <p>Not required.<a id="Appendix_A_Target_208"></a><a aria-label="Product behavior note 208" href="5f5043a3-9e6d-40cc-a05b-1a4a3617df32#Appendix_A_208" data-linktype="relative-path">&lt;208&gt;</a></p>
  </td>
 </tr><tr>
  <td>
  <p>TASK_INFO::percentComplete</p>
  </td>
  <td>
  <p>Required for any task that returns REQ_IN_PROGRESS.</p>
  </td>
 </tr><tr>
  <td>
  <p>TASK_INFO::status</p>
  </td>
  <td>
  <p>Required.</p>
  </td>
 </tr><tr>
  <td>
  <p>TASK_INFO::type</p>
  </td>
  <td>
  <p>Required if PercentageComplete is being used.</p>
  </td>
 </tr><tr>
  <td>
  <p>TASK_INFO::error</p>
  </td>
  <td>
  <p>Required.</p>
  </td>
 </tr><tr>
  <td>
  <p>TASK_INFO::tflag</p>
  </td>
  <td>
  <p>Not required.<a id="Appendix_A_Target_209"></a><a aria-label="Product behavior note 209" href="5f5043a3-9e6d-40cc-a05b-1a4a3617df32#Appendix_A_209" data-linktype="relative-path">&lt;209&gt;</a></p>
  </td>
 </tr></tbody></table>
</li><li><p><span>    </span>Return a
response to the client containing <i>volumeId</i> and the status of the
operation. </p>
</li><li><p><span>    </span>Send the task
completion notification.<a id="Appendix_A_Target_210"></a><a aria-label="Product behavior note 210" href="5f5043a3-9e6d-40cc-a05b-1a4a3617df32#Appendix_A_210" data-linktype="relative-path">&lt;210&gt;</a></p>
</li></ol><p>If the operation is successful, the server MUST make the following
changes to the list of storage objects before returning the response:</p><ul><li><p><span><span> 
</span></span>Modify the dynamic volume object to account for the change of
status.</p>
</li><li><p><span><span> 
</span></span>Modify the disk objects where the partitions were deleted to
account for the change in region allocation.</p>
</li></ul></div>