CVssWriter::GetCurrentSnapshotSetId method (vswriter.h)

The GetCurrentSnapshotSetId method returns the unique identifier of the shadow copy set.

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

Syntax

VSS_ID GetCurrentSnapshotSetId();

Return value

This method returns the VSS_ID value of the current shadow copy set.

The shadow copy set ID returned by GetCurrentSnapshotSetId is the shadow copy set ID of the backup operation a writer is currently participating in.

Note that a writer could be involved in more than one backup operation at a given time. Therefore, if this method is not called as part of a backup sequence—that is, not called from an event handler—which shadow copy set ID is returned is unpredictable.

If GetCurrentSnapshotSetId is called as part of a backup sequence—for example, from within CVssWriter::OnFreeze, CVssWriter::OnThaw, or CVssWriter::OnPostSnapshot—the VSS infrastructure guarantees that the VSS_ID value returned is that of the shadow copy supporting the current backup operation.

However, this cannot be said for calls to GetCurrentSnapshotSetId from within the BackupShutdown event handler CVssWriter::OnBackupShutdown. If a BackupShutdown event is called because of an abrupt shutdown of a requester, the VSS_ID returned could be that of another backup operation the writer was participating in.

GetCurrentSnapshotSetId cannot be called after CVssWriter::OnPostSnapshot returns.

Requirements

Requirement Value
Minimum supported client Windows XP [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header vswriter.h (include Vss.h, VsWriter.h)
Library VssApi.lib

See also

CVssWriter

CVssWriter::OnFreeze

CVssWriter::OnPrepareSnapshot

CVssWriter::OnThaw

VSS_ID