CVssWriter class (vswriter.h)
The CVssWriter class is an abstract base class that defines the interface by which a writer synchronizes its state with VSS and other writers.
Every writer must instantiate an object derived from CVssWriter.
Objects derived from CVssWriter must supply implementations for all of the CVssWriter's pure virtual methods.
A writer can override one or all of CVssWriter's virtual methods.
To participate in VSS, a writer must first call CVssWriter::Initialize and then call CVssWriter::Subscribe.
A writer terminates its participation by calling CVssWriter::Unsubscribe.
The CVssWriter base class is responsible for the life cycle of interfaces passed to event handlers. This includes the following:
- The instance of the IVssWriterComponents interface passed to: CVssWriter::OnPrepareBackup
- The instance of the IVssCreateWriterMetadata interface passed to CVssWriter::OnIdentify.
The CVssWriter class has these methods.
~CVssWriter is the destructor of the CVssWriter class object.
The AreComponentsSelected method indicates whether a requester is running under component mode and supports selecting individual components to be backed up or backs up entire volumes.
CVssWriter is the constructor of the CVssWriter class object.
The GetBackupType method indicates the type of backup to be performed.
The GetContext information returns the current context for any ongoing or possible shadow copies.
The GetCurrentLevel method returns the current application level.
The GetCurrentSnapshotSetId method returns the unique identifier of the shadow copy set.
The GetCurrentVolumeArray method returns the names of the original volumes and the UNC paths of the original remote file shares that belong to the shadow copy set as an array of null-terminated wide character strings.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 GetCurrentVolumeCount method returns the number of volumes in the shadow copy set.
The GetRestoreType method returns the type of restore a writer is participating in.
The GetSnapshotDeviceName method returns the name of the device that hosts the shadow copy of the specified volume or file share.
Initializes a CVssWriter object and allows a writer application to interact with VSS.
Not supported. (CVssWriter.InstallAlternateWriter)
The IsBootableSystemStateBackedUp method indicates whether the bootable state will be backed up.
The IsPartialFileSupportEnabled method determines whether partial file support is enabled or disabled.
The IsPathAffected method determines whether the specified directory or file is included in the current shadow copy set. The path for the directory or file can be a local path or a UNC path of a remote file share.
The OnAbort method is called by a writer following an Abort event issued by VSS indicating that a shadow copy operation has terminated prematurely. The writer uses this method to clean up from its attempt to participate in that operation.
Not supported. (CVssWriter.OnBackOffIOOnVolume)
The OnBackupComplete method is called by a writer following a BackupComplete event. It is used to perform operations considered necessary following a backup. These operations cannot, however, modify the Backup Components Document.
The OnBackupShutdown method is called by a writer following a BackupShutdown event. It is used to perform operations considered necessary when a backup application shuts down, particularly in the case of a crash of the backup application.
Not supported. (CVssWriter.OnContinueIOOnVolume)
The OnFreeze method is called by a writer on receipt of a Freeze event at the start of a shadow copy freeze. A writer uses this method to perform operations needed to participate in the freeze or to veto the freeze.
The OnIdentify method is called by a writer following receipt of an Identify event.
The OnPostRestore method is called by a writer following a PostRestore event. It is used to perform operations considered necessary after files are restored to disk by a requester. These operations cannot, however, modify the Backup Components Document.
The OnPostSnapshot method is called by a writer following a PostSnapshot event.
The OnPrepareBackup method is called by a writer following a PrepareForBackup event. This method is used to configure a writer's state and its components in preparation for a backup operation.
The OnPrepareSnapshot method is called by a writer to handle a PrepareForSnapshot event. It is used to perform operations needed to prepare a writer to participate in the shadow copy or to veto a shadow copy.
The OnPreRestore method is called by a writer following a PreRestore event.
The OnThaw method is called by a writer following a Thaw event.
Not supported. (CVssWriter.OnVSSApplicationStartup)
Not supported. (CVssWriter.OnVssShutdown)
The SetWriterFailure method indicates that this writer has encountered an error condition and sets an error condition.
The Subscribe method subscribes the writer with VSS.
The Unsubscribe method unsubscribes the writer with VSS.
|Minimum supported client||Windows XP [desktop apps only]|
|Minimum supported server||Windows Server 2003 [desktop apps only]|
|Header||vswriter.h (include Vss.h, VsWriter.h)|