IVssFileShareSnapshotProvider::DeleteSnapshots method (vsprov.h)

Deletes specific snapshots, or all snapshots in a specified snapshot set.

Syntax

HRESULT DeleteSnapshots(
  [in]  VSS_ID          SourceObjectId,
  [in]  VSS_OBJECT_TYPE eSourceObjectType,
  [in]  BOOL            bForceDelete,
  [out] LONG            *plDeletedSnapshots,
  [out] VSS_ID          *pNondeletedSnapshotID
);

Parameters

[in] SourceObjectId

Identifier of the shadow copy or shadow copy set to be deleted.

[in] eSourceObjectType

Type of the object to be deleted. The value of this parameter is VSS_OBJECT_SNAPSHOT or VSS_OBJECT_SNAPSHOT_SET.

[in] bForceDelete

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.

[out] plDeletedSnapshots

Pointer to a variable that receives the number of shadow copies that were deleted.

[out] pNondeletedSnapshotID

If an error occurs, this parameter receives a pointer to the identifier of the first shadow copy that could not be deleted. Otherwise, it points to GUID_NULL.

Return value

The following are the valid return codes for this method.

Value Meaning
S_OK
The shadow copies were successfully deleted.
E_ACCESSDENIED
The caller does not have sufficient backup privileges or is not an administrator.
E_INVALIDARG
One of the parameter values is not valid.
E_OUTOFMEMORY
The caller is out of memory or other system resources.
VSS_E_OBJECT_NOT_FOUND
The specified shadow copies were not found.
VSS_E_PROVIDER_VETO
Provider error. The provider logged the error in the event log. For more information, see Event and Error Handling Under VSS.

Remarks

The VSS coordinator calls this method as part of the snapshot auto-release process. The method is also called in response to requester driven delete operations.

Requirements

Requirement Value
Minimum supported client Windows 8.1 [desktop apps only]
Minimum supported server Windows Server 2012 R2 [desktop apps only]
Target Platform Windows
Header vsprov.h
Library VssApi.lib

See also

IVssFileShareSnapshotProvider