IVssBackupComponents::DeleteSnapshots method
The DeleteSnapshots method deletes one or more shadow copies or a shadow copy set.
Syntax
HRESULT DeleteSnapshots( [in] VSS_ID SourceObjectId, [in] VSS_OBJECT_TYPE eSourceObjectType, [in] BOOL bForceDelete, [out] LONG *plDeletedSnapshots, [out] VSS_ID *pNondeletedSnapshotID );
Parameters
- SourceObjectId [in]
-
Identifier of the shadow copy or a shadow copy set to be deleted.
- eSourceObjectType [in]
-
Type of the object on which all shadow copies will be deleted. The value of this parameter is VSS_OBJECT_SNAPSHOT or VSS_OBJECT_SNAPSHOT_SET.
- bForceDelete [in]
-
If the value of this parameter is TRUE, the provider will do everything possible to delete the shadow copy or shadow copies in a shadow copy set. If it is FALSE, no additional effort will be made.
- plDeletedSnapshots [out]
-
Number of deleted shadow copies.
- pNondeletedSnapshotID [out]
-
If an error occurs, the value of this parameter is the identifier of the first shadow copy that could not be deleted. Otherwise, it is GUID_NULL.
Return value
The following are the valid return codes for this method.
| Value | Meaning |
|---|---|
|
The shadow copies were successfully deleted. |
|
The caller does not have sufficient backup privileges or is not an administrator. |
|
One of the parameter values is not valid. |
|
The caller is out of memory or other system resources. |
|
Unexpected error. The error code is logged in the error log file. For more information, see Event and Error Handling Under VSS.
|
|
The specified shadow copy does not exist. |
|
Expected provider error. The provider logged the error in the event log. For more information, see Event and Error Handling Under VSS. |
|
Unexpected provider error. The error code is logged in the error log. For more information, see Event and Error Handling Under VSS. |
Remarks
Multiple shadow copies in a shadow copy set are deleted sequentially. If an error occurs during one of these individual deletions, DeleteSnapshots will return immediately; no attempt will be made to delete any remaining shadow copies. The VSS_ID of the undeleted shadow copy is returned in pNondeletedSnapshotID.
The requester is responsible for serializing the delete shadow copy operation.
During a backup, shadow copies are automatically released as soon as the IVssBackupComponents instance is released. In this case, it is not necessary to explicitly delete shadow copies.
Requirements
|
Minimum supported client | Windows XP [desktop apps only] |
|---|---|
|
Minimum supported server | Windows Server 2003 [desktop apps only] |
|
Header |
|
|
Library |
|
See also
Send comments about this topic to Microsoft
Build date: 11/5/2012
