4.1 Enumerate Volumes Supporting Shadow Copies

The following message sequence illustrates how a client requests from a server the list of volumes for which a shadow copy can be made.

  1. The client requests an RPC binding handle to the interface by calling CoCreateInstanceEx with the class GUID that defines the COM class on the server that implements IVssSnapshotMgmt.

  2. The server returns a reference to the IVssSnapshotMgmt interface.

  3. The client calls IVssSnapshotMgmt::QueryVolumesSupportedForSnapshots, passing in the required parameters as described section 3.1.1.4.2.

  4. The server returns a reference to an IVssEnumMgmtObject interface that contains a collection of volumes that support shadow copies. The server initializes an internal cursor in the collection to point to the first object.

  5. The client calls IVssEnumMgmtObject::Next, passing in 1 for the number of elements to retrieve.

  6. The server returns the cursor volume in the collection as a VSS_MGMT_OBJECT_PROP structure, wrapping a VSS_VOLUME_PROP structure, and increments the internal cursor in the collection to the next object.

  7. The client inspects the VSS_MGMT_OBJECT_PROP.Obj.Vol member of the returned structure, which is a VSS_VOLUME_PROP structure, and passes the inspection results to a higher-level component for a decision whether the volume is interesting. The client can repeat steps 5 through 7 until the IVssEnumMgmtObject::Next call returns S_FALSE to signal the end of the enumeration.

  8. The server returns the value S_FALSE as the return value for the client's final call to IVssEnumMgmtObject::Next.

  9. The client calls IUnknown::Release, which is a COM method inherited by IVssEnumMgmtObject.

  10. The server decrements the reference count for the IVssEnumMgmtObject interface and returns the new reference count to the client.

  11. The client calls IUnknown::Release, which is a COM method inherited by IVssSnapshotMgmt.

  12. The server decrements the reference count for the IVssSnapshotMgmt interface and returns the new reference count to the client.

Enumerate Volumes Supporting Shadow Copies

Figure 1: Enumerate Volumes Supporting Shadow Copies