3.1.4.10 IsPathShadowCopied (Opnum 9)

The IsPathShadowCopied method is invoked by the client to query if any shadow copy for a share already exists.

 DWORD IsPathShadowCopied(
         [in] handle_t hBinding,
         [in] [string] LPWSTR ShareName,
         [out] BOOL* ShadowCopyPresent,
         [out] long* ShadowCopyCompatibility);
  

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

ShareName: The full path of the share in UNC format.

ShadowCopyPresent: This value is set to TRUE if the ShareName specified has a shadow copy; otherwise set to FALSE.

ShadowCopyCompatibility: This value indicates whether certain I/O operations on the file store containing the shadow copy are disabled. This MUST be zero or a combination of the values as specified in section 2.2.2.3.

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

0x00000000

ZERO

The operation completed successfully.

0x80070005

E_ACCESSDENIED

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

0x80070057

E_INVALIDARG

One or more arguments are invalid.

The server MUST verify that the share identified by ShareName exists on the server by invoking the event as specified in [MS-SMB2] section 3.3.4.16 or [MS-CIFS] section 3.3.4.12. If the share does not exist, the server MUST fail the call with FSRVP_E_OBJECT_NOT_FOUND.

The server MUST identify the file store on which the ShareName share is hosted, in an implementation-defined manner.

For each ShadowCopySet in the GlobalShadowCopySetTable, where ShadowCopySet.Status is "Committed", "Exposed", or "Recovered", the server MUST iterate over all the ShadowCopy objects in ShadowCopySet.ShadowCopyList and verify if any ShadowCopy exists where ShadowCopy.VolumeName matches the file store on which ShareName is hosted. If no entry is found, the server MUST set ShadowCopyPresent to FALSE. If an entry is found, the server MUST do the following:

  • Set ShadowCopyPresent to TRUE.

  • Query the properties of the file store in an implementation-defined manner.

  • If the shadow copy provider does not support defragmentation operations on the file store, set the DISABLE_DEFRAG bit of ShadowCopyCompatibility.

  • If the shadow copy provider does not support indexing (see the definition in section 1.1) on the file store, the server MUST set the DISABLE_CONTENTINDEX bit of ShadowCopyCompatibility.

The server MUST return ZERO to the caller.