3.1.4.6 ExposeShadowCopySet (Opnum 5)

The ExposeShadowCopySet method exposes all the shadow copies in a shadow copy set as file shares on the file server.

 DWORD ExposeShadowCopySet(
         [in] handle_t hBinding,
         [in] GUID ShadowCopySetId,
         [in] unsigned long TimeOutInMilliseconds);
  

hBinding:  An RPC binding handle (as defined in [C706]).

ShadowCopySetId: The GUID of the shadow copy set.

TimeOutInMilliseconds:  The maximum time, in milliseconds, for which the server MUST wait for completion of the expose operation.

Return Values: The method returns one of the values specified in section 2.2.4. The most common error codes are listed in the following table.

Return value/code

Description

0x80070005

E_ACCESSDENIED

The caller does not have the permissions to perform the operation.

0x80070057

E_INVALIDARG

One or more arguments are invalid.

0x80042301

FSRVP_E_BAD_STATE

The method call is invalid because of the server's state.

0x80042501

FSRVP_E_SHADOWCOPYSET_ID_MISMATCH

The provided ShadowCopySetId does not exist.

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 "Committed", the server MUST fail the call with FSRVP_E_BAD_STATE.

The server MUST stop the Message Sequence Timer specified in section 3.1.2.

The server MUST initiate the shadow copy expose process for the ShadowCopySet, which includes the following steps:

  • For each ShadowCopy in ShadowCopySet.ShadowCopyList:

  • For each MappedShare in ShadowCopy.ShareMappingList:

  • Expose the shadow copy of the share as a new share with a UNC name of the form \\hostname\sharename@{ShadowCopy.ShadowCopyId}. The hostname portion of the path can be different from the hostname portion of MappedShare.ShareName. The sharename portion (prior to the @ suffix) of the exposed share name MUST match the sharename portion of MappedShare.ShareName.<9>

  • Set the access permissions for the exposed shadow copy share to be same as that of MappedShare.ShareName

  • If the ATTR_AUTO_RECOVERY bit is set in ShadowCopySet.Context, enable read-write mode for the exposed shadow copy share until a RecoveryCompleteShadowCopySet message is received.

  • Set MappedShare.ShadowCopyShareName to the share name of the shadow copy exposed as above, and set ShareMapping.IsExposed to TRUE.

The server MUST wait for the completion of the expose process for the entire ShadowCopySet.

If the wait for the expose process fails, the server MUST start the Message Sequence Timer as specified in section 3.1.2 with a timeout value of 180 seconds, and fail the call with FSRVP_E_WAIT_FAILED.

If the expose operation does not complete within TimeOutInMilliseconds, the server MUST start the Message Sequence Timer as specified in section 3.1.2 with a timeout value of 180 seconds, and fail the call with FSRVP_E_WAIT_TIMEOUT.

If the expose operation returns success within TimeOutInMilliseconds, the server MUST update ShadowCopySet.Status to "Exposed", start the Message Sequence Timer as specified in section 3.1.2 with a timeout value of 180 seconds, and return ZERO to the caller.

If the expose operation returns an error within TimeOutInMilliseconds, the server MUST start the Message Sequence Timer as specified in section 3.1.2 with a timeout value of 180 seconds, and fail the call with the same error code.