Click or drag to resize

IVssBackupComponentsSetContext Method (VssSnapshotContext)

Sets the context for subsequent shadow copy-related operations.

Namespace:  Alphaleonis.Win32.Vss
Assembly:  AlphaVSS.Common (in AlphaVSS.Common.dll) Version: 1.4.0.0 (1.4.0.0)
Syntax
void SetContext(
	VssSnapshotContext context
)

Parameters

context
Type: Alphaleonis.Win32.VssVssSnapshotContext
The context to be set. The context must be one of the supported values of VssSnapshotContext or a supported bit mask (or bitwise OR) of VssVolumeSnapshotAttributes with a valid VssSnapshotContext.
Exceptions
ExceptionCondition
ArgumentExceptionOne of the parameter values is not valid.
OutOfMemoryExceptionOut of memory or other system resources.
SystemExceptionUnexpected VSS system error. The error code is logged in the event log.
VssBadStateExceptionThe backup components object is not initialized, this method has been called during a restore operation, or this method has not been called within the correct sequence.
Remarks

The default context for VSS shadow copies is Backup.

Windows XP: The only supported context is the default context, Backup. Therefore, calling this method under Windows XP throws a NotImplementedException.

SetContext(VssSnapshotContext) can be called only once, and it must be called prior to calling most VSS functions.

For details on how the context set by this method affects how a shadow copy is created and managed, see Implementation Details for Creating Shadow Copies.

For a complete discussion of the permitted shadow copy contexts, see VssSnapshotContext and VssVolumeSnapshotAttributes.

See Also