3.1.1.4.3 QuerySnapshotsByVolume (Opnum 5)
The QuerySnapshotsByVolume method retrieves a collection of shadow copy objects that are present on a specified volume of the server.
-
HRESULT QuerySnapshotsByVolume( [in] VSS_PWSZ pwszVolumeName, [in] VSS_ID ProviderId, [out] IVssEnumObject** ppEnum );
pwszVolumeName: A null-terminated UNICODE string that contains the drive letter, mount point, or volume mount name for which the existing shadow copy collection is requested.
ProviderId: MUST be set to the shadow copy provider UUID as described in Standards Assignments (section 1.9).
ppEnum: A pointer to an IVssEnumObject pointer that upon completion, contains a collection of shadow copies that exist on the server for the specified volume. Each element in the collection MUST be a VSS_SNAPSHOT_PROP structure. A caller MUST release the received ppEnum when the caller is done with it.
Return Values: The method MUST return zero when it has succeeded or an implementation-specific nonzero error code on failure.
-
Return value/code
Description
0x80070057
E_INVALIDARG
Returned when pwszVolumeName or ppEnum is NULL or when ProviderId is GUID_NULL.
0x80042304
VSS_E_PROVIDER_NOT_REGISTERED
Returned when the provider with ID ProviderId does not exist on the server.
0x80070005
E_ACCESSDENIED
Returned when the user making the request does not have sufficient privileges to perform the operation.
No exceptions are thrown except those that are thrown by the underlying RPC protocol [MS-RPCE].
After the server receives this message, it MUST verify that ppEnum is not NULL.
The server MUST set the ppEnum pointer to an instance of IVssEnumObject that contains a VSS_SNAPSHOT_PROP structure for each shadow copy for the specified volume on the server. If the server has no shadow copies on the specified volume, it MUST return an empty IVssEnumObject object.