IVssBackupComponents::SetBackupSucceeded method

The SetBackupSucceeded method indicates whether the backup of the specified component of a specific writer was successful.

Syntax

HRESULT SetBackupSucceeded(
  VSS_ID             instanceId,
  VSS_ID             writerId,
  VSS_COMPONENT_TYPE ct,
  LPCWSTR            wszLogicalPath,
  LPCWSTR            wszComponentName,
  bool               bSucceded
);

Parameters

instanceId

Globally unique identifier (GUID) of the writer instance.

writerId

Globally unique identifier (GUID) of the writer class.

ct

Type of the component. See VSS_COMPONENT_TYPE for the possible values.

wszLogicalPath

Null-terminated wide character string containing the logical path of the component.

For more information, see Logical Pathing of Components.

The value of the string containing the logical path used here should be the same as was used when the component was added to the backup set using IVssBackupComponents::AddComponent.

The logical path can be NULL.

There are no restrictions on the characters that can appear in a non-NULL logical path.

wszComponentName

Null-terminated wide character string containing the name of the component.

The string cannot be NULL and should contain the same component name as was used when the component was added to the backup set using IVssBackupComponents::AddComponent.

bSucceded

Set this parameter to true if the component was successfully backed up, or false otherwise.

Return Value

The following are the valid return codes for this method.

Value Meaning
S_OK
Successfully set the backup succeeded state.
E_INVALIDARG
One of the parameter values is not valid.
E_OUTOFMEMORY
The caller is out of memory or other system resources.
VSS_E_BAD_STATE
The backup components object is not initialized, this method has been called during a restore operation, or this method has not been called within the correct sequence.
VSS_E_OBJECT_NOT_FOUND
The backup component does not exist.
VSS_E_INVALID_XML_DOCUMENT
The XML document is not valid. Check the event log for details. For more information, see Event and Error Handling Under VSS.
VSS_E_UNEXPECTED
Unexpected error. The error code is logged in the error log file. For more information, see Event and Error Handling Under VSS.

Windows Server 2008, Windows Vista, Windows Server 2003 and Windows XP:  This value is not supported until Windows Server 2008 R2 and Windows 7. E_UNEXPECTED is used instead.

Remarks

When working in component mode (when IVssBackupComponents::SetBackupState is called with its select components argument set to true), writers check the state of each components backup using IVssComponent::GetBackupSucceeded. Therefore, a well-behaved backup application (requester) must call SetBackupSucceeded after each component has been processed and prior to calling IVssBackupComponents::BackupComplete.

Do not call this method if the call to IVssBackupComponents::DoSnapshotSet failed. For more information about how requesters use DoSnapshotSet, SetBackupSucceeded, and BackupComplete in a backup operation, see Overview of Pre-Backup Tasks and Overview of Actual Backup Of Files.

Requirements

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

See Also

IVssBackupComponents

IVssBackupComponents::BackupComplete

IVssBackupComponents::SetBackupState

VSS_COMPONENT_TYPE