CVssWriter::GetContext method

The GetContext information returns the current context for any ongoing or possible shadow copies.

GetContext is a protected method implemented by the CVssWriter base class.

Syntax


LONG GetContext();

Parameters

This method has no parameters.

Return value

This method returns the context for any shadow copies involving the writer as a bit mask (or bitwise OR) of _VSS_SNAPSHOT_CONTEXT and _VSS_VOLUME_SNAPSHOT_ATTRIBUTES values.

Remarks

The default context for a shadow copy is VSS_CTX_BACKUP.

A requester can set the context for a shadow copy by calling IVssBackupComponents::SetContext at any time prior to creating a shadow copy with IVssBackupComponents::DoSnapshotSet.

IVssBackupComponents::DoSnapshotSet generates a number of events (PrepareForSnapshot, Freeze, Thaw, PostSnapshot), the first of which is PrepareForSnapshot.

Therefore, if a writer is participating in a shadow copy operation, a definitive value of that shadow copy's context cannot be found when GetContext is called prior to CVssWriter::OnPrepareSnapshot.

Requirements

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

VsWriter.h (include Vss.h or VsWriter.h)

Library

VssApi.lib

See also

_VSS_SNAPSHOT_CONTEXT
_VSS_VOLUME_SNAPSHOT_ATTRIBUTES
CVssWriter
CVssWriter::OnPrepareSnapshot
IVssBackupComponents::SetContext
IVssBackupComponents::DoSnapshotSet

 

 

Show: