18.104.22.168 DeleteShareMapping (Opnum 11)
The DeleteShareMapping method deletes the mapping of a share’s shadow copy from a shadow copy set.
DWORD DeleteShareMapping( [in] handle_t hBinding, [in] GUID ShadowCopySetId, [in] GUID ShadowCopyId, [in] [string] LPWSTR ShareName);
hBinding: An RPC binding handle (as defined in [C706]).
ShadowCopySetId: The GUID of the shadow copy set.
ShadowCopyId: The GUID of the shadow copy.
ShareName: The name of the share for which the share mapping is to be deleted.
Return Values: The method returns one of the values as specified in section 2.2.4. The most common error codes are listed in the following table:
The caller does not have the permissions to perform the operation.
One or more arguments are invalid.
The specified object does not exist.
The provided ShadowCopySetId does not exist.
The server MUST fail the call with E_INVALIDARG if ShadowCopySetId, ShadowCopyId, or ShareName is set to NULL.
The server MUST look up the ShadowCopySet from GlobalShadowCopysetTable using the index ShadowCopySetId. If no shadow copy set is found, the server MUST fail the call with FSRVP_E_SHADOWCOPYSET_ID_MISMATCH.
If ShadowCopySet.Status is not "Recovered", the server MUST fail the call with FSRVP_E_BAD_STATE.
The server MUST look up the ShadowCopy in ShadowCopySet.ShadowCopyList where ShadowCopy.ShadowCopyId matches "ShadowCopyId". If no entry is found, the server MUST fail the call with FSRVP_E_OBJECT_NOT_FOUND.
The server MUST look up the ShareMapping in ShadowCopy.ShareMappingList where ShareMapping.ShareName matches "ShareName". If no entry is found, the server MUST fail the call with FSRVP_E_OBJECT_NOT_FOUND.
The server MUST delete the file share identified by MappedShare. ShadowCopyShareName.
The server MUST delete the MappedShare from ShadowCopy.ShareMappingTable and free the MappedShare object.
If ShadowCopy.ShareMappingTable is now empty, the server SHOULD remove the shadow copy for the file store identified by ShadowCopy.VolumeName and MUST delete ShadowCopy from ShadowCopySet.ShadowCopyList and free the ShadowCopy object.
If the ShadowCopyList.ShadowCopyList is now empty, the server MUST remove the ShadowCopySet from GlobalShadowCopySetTable and free the ShadowCopySet object.
The server MUST return ZERO to the caller.