Determining Writer Status

A requester needs to have a well-defined understanding about the status of the writer that participates with it during shadow copy creation, and during backup and restore operations. To do so, it is recommended:

IVssBackupComponents::PrepareForBackup

IVssBackupComponents::DoSnapshotSet

IVssBackupComponents::BackupComplete

During restore operations, a requester should query a writer after completion of these methods:

IVssBackupComponents::PreRestore

IVssBackupComponents::PostRestore

  • Calls to IVssBackupComponents::GatherWriterStatus that are not part of a well-defined backup or restore sequence do not provide a reliable picture of writer status, because they might reflect conditions that do not indicate failure in the current operation, such as:
    • A failure of a previous shadow copy creation
    • An error in an early backup or restore operation
    • An unresponsive writer currently processing an event

Therefore, developers should not rely on writer status returned by processes other than the requester or attempt to monitor the progress of one instance of the IVssBackupComponents interface with another (possibly in a separate thread).

Note that for backup operations, where it is necessary to examine writers' Writer Metadata Documents, there is no need for a requester call to IVssBackupComponents::GatherWriterStatus and IVssBackupComponents::GetWriterStatus following the generation and handling of the Identify event caused by IVssBackupComponents::GatherWriterMetdata.

IVssBackupComponents::GetWriterStatus reports only the status of those writers whose metadata was provided to VSS by writers' Identify event handlers, CVssWriter::OnIdentify (and returned to the requester by IVssBackupComponents::GetWriterMetadataCount and IVssBackupComponents::GetWriterMetadata).

If a writer's implementation of CVssWriter::OnIdentify fails, that writer's metadata will not be part of the list of Writer Metadata Documents provided to VSS, no status information will be available, and the call would be redundant.

For restore operations, where the requester does not need to examine Writer Metadata Documents of executing writers, calling IVssBackupComponents::GatherWriterStatus and IVssBackupComponents::GetWriterStatus may be a more efficient way to determine which writers are executing.