<div class="content"><p> </p><p>The WriteSignature method writes a <span><a href="3c91641b-e5cd-409e-a445-2e4d61ae33c6#gt_0e4c21af-021e-4059-ae9a-7821ec3c2e39" data-linktype="relative-path">disk signature</a></span> to a
specified <span><a href="3c91641b-e5cd-409e-a445-2e4d61ae33c6#gt_c4133b2a-a990-4042-ba44-7fda3090f118" data-linktype="relative-path">disk</a></span>. This is a
synchronous task.</p><dl>
<dd>
<div><pre> HRESULT WriteSignature(
   [in] LdmObjectId diskId,
   [in] hyper diskLastKnownState,
   [out] TASK_INFO* tinfo
 );
</pre></div>
</dd></dl><p><b>diskId: </b>Specifies the object identifier of the
target disk for the signature.</p><p><b>diskLastKnownState: </b>Disk&#39;s 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>.</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>
section <span><a href="../ms-erref/0642cb2f-2075-4469-918c-4441e69c548a" data-linktype="relative-path">2.1</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
disk specified by <i>diskId</i> is in the list of storage objects, and check if
<i>diskLastKnownState</i> matches the <b>LastKnownState</b> field 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>Write an <span><a href="3c91641b-e5cd-409e-a445-2e4d61ae33c6#gt_b251c771-5ccf-40f2-b98d-0119db210b4b" data-linktype="relative-path">MBR</a></span>
signature, and initialize the <span><a href="3c91641b-e5cd-409e-a445-2e4d61ae33c6#gt_cee39671-0b98-4ca3-904d-018780e7042f" data-linktype="relative-path">partition table</a></span> of
the disk.</p>
</li><li><p><span>    </span>Wait for the
signature writing to either 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_36"></a><a aria-label="Product behavior note 36" href="5f5043a3-9e6d-40cc-a05b-1a4a3617df32#Appendix_A_36" data-linktype="relative-path">&lt;36&gt;</a></p>
  </td>
 </tr><tr>
  <td>
  <p>TASK_INFO::clientID</p>
  </td>
  <td>
  <p>Not required.<a id="Appendix_A_Target_37"></a><a aria-label="Product behavior note 37" href="5f5043a3-9e6d-40cc-a05b-1a4a3617df32#Appendix_A_37" data-linktype="relative-path">&lt;37&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_38"></a><a aria-label="Product behavior note 38" href="5f5043a3-9e6d-40cc-a05b-1a4a3617df32#Appendix_A_38" data-linktype="relative-path">&lt;38&gt;</a></p>
  </td>
 </tr></tbody></table>
</li><li><p><span>    </span>Return a
response to the client that contains <i>tinfo</i> and the status of the
operation.</p>
</li></ol><p>If the operation is successful, the server MUST make the
following change to the list of storage objects before returning the response:</p><ul><li><p><span><span> 
</span></span>Modify the disk object to account for the change of status.</p>
</li></ul></div>