3.1.4.11 GetShareMapping (Opnum 10)

The GetShareMapping method is invoked by the client to get the shadow copy information on a given file share on the server after the shadow copy of the share has been exposed.

 DWORD GetShareMapping(
         [in] handle_t hBinding,
         [in] GUID ShadowCopyId,
         [in] GUID ShadowCopySetId,
         [in] [string] LPWSTR ShareName,
         [in] DWORD Level,
         [out] [switch_is(Level)] PFSSAGENT_SHARE_MAPPING ShareMapping);
  

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

ShadowCopyId: The GUID of the shadow copy associated with the share.

ShadowCopySetId: The GUID of the shadow copy set.

ShareName: The name of the share in UNC format.

Level: The information level of the share mapping data. This parameter MUST be one of the following values.

Value

Meaning

1

FSSAGENT_SHARE_MAPPING_1

ShareMapping: A pointer to an FSSAGENT_SHARE_MAPPING structure, as specified in section 2.2.3.1.

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:

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.

0x80042501

FSRVP_E_SHADOWCOPYSET_ID_MISMATCH

The provided ShadowCopySetId does not exist.

If the value of Level is invalid, the server MUST fail the call with E_INVALIDARG.

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 "Exposed", the server SHOULD<10> 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 look up the ShadowCopy in ShadowCopySet.ShadowCopyList where ShadowCopy.ShadowCopyId matches ShadowCopyId. If no entry is found, the server MUST fail the call with E_INVALIDARG.

The server MUST look up the MappedShare in ShadowCopy.ShareMappingList where MappedShare.ShareName matches ShareName. If no entry is found, the server MUST fail the call with E_INVALIDARG.

If the value of Level is 1, the server MUST update the ShareMapping1 structure of the ShareMapping parameter as follows:

  • ShareMapping1.ShadowCopySetId is set to ShadowCopySet.ShadowCopySetId.

  • ShareMapping1.ShadowCopyId is set to ShadowCopy.ShadowCopyId.

  • ShareMapping1.ShareNameUNC is set to MappedShare.ShareName.

  • If MappedShare.IsExposed is TRUE, ShareMapping1.ShadowCopyShareName is set to MappedShare.ShadowCopyShareName. Otherwise, ShareMapping1.ShadowCopyShareName is set to NULL.

  • ShareMapping1.CreationTimeStamp is set to ShadowCopy.CreationTimeStamp.

The server MUST start the Message Sequence Timer as specified in section 3.1.2 with a timeout value of 1800 seconds, and return ZERO to the caller.