State Transitions in Shadow Copy Providers

The state transition model in a shadow copy provider is simplified by the serialization of shadow copy creation from the time that IVssBackupComponents::StartSnapshotSet is called until the call to IVssBackupComponents::DoSnapshotSet returns. If another requester tries to create a shadow copy during this time, the call to StartSnapshotSet will fail with error VSS_E_SNAPSHOT_SET_IN_PROGRESS, indicating that the second requester should wait and try again.

VSS will only call IVssProviderCreateSnapshotSet::AbortSnapshots after the requester has called DoSnapshotSet, even if the shadow copy fails or is aborted before this point. This means that a provider will not receive a call to AbortSnapshots until after IVssProviderCreateSnapshotSet::EndPrepareSnapshots has been called. If a shadow copy is aborted or fails before this point, the provider is not given any indication until a new shadow copy is started. For this reason, the provider must be prepared to handle an out-of-sequence call to IVssHardwareSnapshotProvider::BeginPrepareSnapshot at any point. This out-of-sequence call represents the start of a new shadow copy sequence and will have a new shadow copy set ID.