IVssCreateWriterMetadataEx::AddExcludeFilesFromSnapshot method

Reports any file sets that will be explicitly excluded by the writer when a shadow copy is created.

Calling this method does not cause the files to be excluded. The writer is responsible for deleting the files from the shadow copy in its CVssWriter::OnPostSnapshot method.

Syntax

HRESULT AddExcludeFilesFromSnapshot(
  LPCWSTR wszPath,
  LPCWSTR wszFilespec,
  bool    bRecursive
);

Parameters

wszPath

A pointer to a null-terminated wide character string containing the root directory under which files are to be excluded.

The directory can be a local directory on the VSS machine, or it can be a file share directory on a remote file server.

UNC paths are supported.

The path can contain environment variables (for example, %SystemRoot%) but cannot contain wildcard characters.

There is no requirement that the path end with a backslash (""). It is up to applications that retrieve this information to check whether the path ends with a backslash.

wszFilespec

A pointer to a null-terminated wide character string containing the file specification of the files to be excluded.

A file specification cannot contain directory specifications (for example, no backslashes) but can contain the ? and * wildcard characters.

bRecursive

A Boolean value specifying whether the path specified by the wszPath parameter identifies only a single directory or if it indicates a hierarchy of directories to be traversed recursively. This parameter should be set to true if the path is treated as a hierarchy of directories to be recursed through, or false otherwise.

For information on traversing over mounted folders, see Working with Mounted Folders and Reparse Points.

Return Value

The following are the valid return codes for this method.

Value Meaning
S_OK
0x00000000L
The operation was successful.
E_INVALIDARG
0x80070057L
One of the parameter values is not valid.
E_OUTOFMEMORY
0x8007000EL
The caller is out of memory or other system resources.
VSS_E_INVALID_XML_DOCUMENT
0x80042311L
The XML document is not valid. Check the event log for details. For more information, see Event and Error Handling Under VSS.
VSS_E_NOT_SUPPORTED
0x8004232FL
This method is not supported for express writers.
VSS_E_UNEXPECTED
Unexpected error. The error code is logged in the error log file. For more information, see Event and Error Handling Under VSS.

Windows Server 2008, Windows Vista, Windows Server 2003 and Windows XP:  This value is not supported until Windows Server 2008 R2 and Windows 7. E_UNEXPECTED is used instead.

Remarks

Windows 7, Windows Server 2008 R2, Windows Vista, Windows Server 2008, Windows XP and Windows Server 2003:  Remote file shares are not supported until Windows 8 and Windows Server 2012.

The use of the AddExcludeFilesFromSnapshot method is optional. Writers should use this method only for large files that change significantly between shadow copy operations.

This method is not a substitute for the IVssCreateWriterMetadata::AddExcludeFiles method. Writers should continue to use the AddExcludeFiles method to report which file sets are excluded from backup.

The caller is responsible for calling the IUnknown::Release method to release the resources of the returned IVssWMFiledesc object.

Requirements

   
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header vswriter.h (include Vss.h, VsWriter.h)
Library VssApi.lib

See Also

IVssCreateWriterMetadata::AddExcludeFiles

IVssCreateWriterMetadataEx

IVssExamineWriterMetadataEx2::GetExcludeFromSnapshotCount

IVssExamineWriterMetadataEx2::GetExcludeFromSnapshotFile