3.4.5.2.1.4 IEnumVdsObject::Clone (Opnum 6)

The Clone method creates a new enumeration that has the same state as the current enumeration.

 [helpstring("method Clone")] HRESULT Clone(
   [out] IEnumVdsObject** ppEnum
 );

ppEnum: A pointer to an IEnumVdsObject interface that, if successfully completed, receives the IEnumVdsObject interface of the cloned enumeration. Callers MUST release the interface that is received when they are done with it.

Return Values: The method MUST return zero or a non-error HRESULT (as specified in [MS-ERREF]) to indicate success or return an implementation-specific nonzero error code to indicate failure. For the HRESULT values predefined by the Virtual Disk Service Remote Protocol, see section 2.2.3.

When the server receives this message, it MUST validate the parameter:

  • Verify that ppEnum is not NULL.

The server MUST perform the following:

  • Create a new enumeration object that implements the IEnumVdsObject interface. Then set the pointer that ppEnum references to the interface.

  • Set the list of objects in the new enumeration object to equal the list of objects in this enumeration.

  • Set the current index in the new enumeration to equal the current index in this enumeration.

  • Return an HRESULT that indicates failure or success.