3.1.4.15 NetrShareDelCommit (Opnum 38)

The NetrShareDelCommit method performs the final phase of a two-phase share delete.

 NET_API_STATUS NetrShareDelCommit(
   [in, out] PSHARE_DEL_HANDLE ContextHandle
 );

ContextHandle: A handle returned by the first phase of a two-phase share delete.

Return Values: 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 [MS-ERREF] section 2.2.

The NetrShareDelCommit message is the continuation of the NetrShareDelStart message and MUST cause the share to be actually deleted, which disconnects all connections to the share, or MUST return an error code.

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.

This two-phase deletion MUST be used to delete IPC$, which is the share that is used for named pipes. Deleting IPC$ results in the closing of the pipe on which the RPC is being executed. Thus, the client 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.

ContextHandle MUST reference the share to be deleted in the NetrShareDelStart method. If a share is not found, the server MUST fail the call with an ERROR_INVALID_PARAMETER error code.

If a share is found, but the IsMarkedForDeletion member of the Share is not set, the server MUST fail the call with an ERROR_INVALID_PARAMETER error code.

Otherwise, the server MUST delete the share by invoking the underlying server event, as specified in [MS-CIFS] section 3.3.4.11and [MS-SMB2] section 3.3.4.15, providing tuple <ServerName, NetName> as input parameters.

The server does not enforce any security measures when processing this call.