<div class="content" name="NetrShareDelCommit" uuid="04ebf798-ba19-45c6-8ca4-876671e17bc7"><p>The NetrShareDelCommit method performs the final phase of a
two-phase share delete.</p><dl>
<dd>
<div><pre> NET_API_STATUS NetrShareDelCommit(
   [in, out] PSHARE_DEL_HANDLE ContextHandle
 );
</pre></div>
</dd></dl><p><b>ContextHandle: </b>A handle returned by the first
phase of a two-phase share delete.</p><p><b>Return Values: </b>The method returns 0x00000000
(NERR_Success) to indicate success. Otherwise, the method returns a nonzero
error code unless the share being deleted is IPC$. If the share being deleted
is IPC$, the return value is not meaningful. The method can take any specific
error code value, as specified in <a href="../ms-erref/1bc92ddf-b79e-413c-bbaa-99a5281a6c90" data-linktype="relative-path">[MS-ERREF]</a>
section <a href="../ms-erref/18d8fbe8-a967-4f1c-ae50-99ca8e491d2d" data-linktype="relative-path">2.2</a>.</p><p>The NetrShareDelCommit message is the continuation of the <a href="34819f8d-08c6-4635-a8ce-af527d945dc9" data-linktype="relative-path">NetrShareDelStart</a> message
and MUST cause the share to be actually deleted, which disconnects all <a href="1709f6a7-efb8-4ded-b7ae-5cee9ee36320#gt_866b0055-ceba-4acf-a692-98452943b981" data-linktype="relative-path">connections</a> to the share,
or MUST return an error code.</p><p>This method can be used to delete the IPC$ share as well as
other shares. When the share is not IPC$, only a return value of 0 indicates
success.</p><p>This two-phase deletion MUST be used to delete IPC$, which
is the share that is used for <a href="1709f6a7-efb8-4ded-b7ae-5cee9ee36320#gt_34f1dfa8-b1df-4d77-aa6e-d777422f9dca" data-linktype="relative-path">named
pipes</a>. Deleting IPC$ results in the closing of the pipe on which the <a href="1709f6a7-efb8-4ded-b7ae-5cee9ee36320#gt_8a7f6700-8311-45bc-af10-82e10accd331" data-linktype="relative-path">RPC</a> is being executed.
Thus, the <a href="1709f6a7-efb8-4ded-b7ae-5cee9ee36320#gt_60e0e1fa-66fe-41e1-b5e3-ceab97e53506" data-linktype="relative-path">client</a> never
receives the response to the RPC. The two-phase delete offers a positive
response in phase 1 and then an expected error in phase 2.</p><p><i>ContextHandle</i> MUST reference the share to be deleted
in the <b>NetrShareDelStart</b> method. If a share is not found, the <a href="1709f6a7-efb8-4ded-b7ae-5cee9ee36320#gt_434b0234-e970-4e8c-bdfa-e16a30d96703" data-linktype="relative-path">server</a> MUST fail the call
with an ERROR_INVALID_PARAMETER error code.</p><p>If a share is found, but the <b>IsMarkedForDeletion</b>
member of the <b>Share</b> is not set, the server MUST fail the call with an
ERROR_INVALID_PARAMETER error code.</p><p>Otherwise, the server MUST delete the share by invoking the
underlying server event, as specified in <a href="../ms-cifs/d416ff7c-c536-406e-a951-4f04b2fd1d2b" data-linktype="relative-path">[MS-CIFS]</a>
section <a href="../ms-cifs/7c96c13d-e5de-4326-a9c7-aae97250a66a" data-linktype="relative-path">3.3.4.11</a>and
<a href="../ms-smb2/5606ad47-5ee0-437a-817e-70c366052962" data-linktype="relative-path">[MS-SMB2]</a>
section <a href="../ms-smb2/9b634aad-c492-4c27-9918-4ef2e7aef76d" data-linktype="relative-path">3.3.4.15</a>,
providing tuple &lt;<i>ServerName</i>, <i>NetName</i>&gt; as input parameters.</p><p>The server does not enforce any security measures when
processing this call.</p></div>