Skip to content

Latest commit

 

History

History
118 lines (93 loc) · 4.34 KB

nf-wbemcli-ienumwbemclassobject-clone.md

File metadata and controls

118 lines (93 loc) · 4.34 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:wbemcli.IEnumWbemClassObject.Clone
IEnumWbemClassObject::Clone (wbemcli.h)
The IEnumWbemClassObject::Clone method makes a logical copy of the entire enumerator, retaining its current position in an enumeration.
Clone
Clone method [Windows Management Instrumentation]
Clone method [Windows Management Instrumentation]
IEnumWbemClassObject interface
IEnumWbemClassObject interface [Windows Management Instrumentation]
Clone method
IEnumWbemClassObject.Clone
IEnumWbemClassObject::Clone
_hmm_ienumwbemclassobject_clone
wbemcli/IEnumWbemClassObject::Clone
wmi.ienumwbemclassobject_clone
wmi\ienumwbemclassobject_clone.htm
wmi
a323c662-e005-44aa-a903-1eb7d6ddff9e
12/05/2018
Clone, Clone method [Windows Management Instrumentation], Clone method [Windows Management Instrumentation],IEnumWbemClassObject interface, IEnumWbemClassObject interface [Windows Management Instrumentation],Clone method, IEnumWbemClassObject.Clone, IEnumWbemClassObject::Clone, _hmm_ienumwbemclassobject_clone, wbemcli/IEnumWbemClassObject::Clone, wmi.ienumwbemclassobject_clone
wbemcli.h
Wbemidl.h
Windows
Windows Vista
Windows Server 2008
Wbemuuid.lib
Fastprox.dll
Windows
19H1
IEnumWbemClassObject::Clone
wbemcli/IEnumWbemClassObject::Clone
c++
APIRef
kbSyntax
COM
Fastprox.dll
IEnumWbemClassObject.Clone

IEnumWbemClassObject::Clone

-description

The IEnumWbemClassObject::Clone method makes a logical copy of the entire enumerator, retaining its current position in an enumeration. This method makes only a "best effort" copy. Due to the dynamic nature of many CIM objects, it is possible that the new enumerator does not enumerate the same set of objects as the source enumerator.

Note  

When the enumeration is initialized with the WBEM_FLAG_FORWARD_ONLY flag, IEnumWbemClassObject::Clone is not supported.

Any pending asynchronous deliveries begun by NextAsync are not cloned.

 

-parameters

-param ppEnum [out]

Receives a pointer to a new IEnumWbemClassObject object. The caller must call Release when the interface pointer is no longer required. On error, there will not be a return of a new object.

-returns

On error, you can call the COM function GetErrorInfo to obtain more error information. COM-specific error codes may also be returned if network problems cause you to lose the remote connection to Windows Management.

The following list lists the value contained within an HRESULT.

-remarks

Because the call-back to the sink might not be returned at the same authentication level as the client requires, it is recommended that you use semisynchronous communication instead of asynchronous. If you require asynchronous communication, see Calling a Method.

For more information about using methods semisynchronously, see IEnumWbemClassObject and Calling a Method.

Examples

The following code shows how to use the IEnumWbemClassObject::Clone method.

BOOL CloneEnum(IEnumWbemClassObject *pSrc)
{
    IEnumWbemClassObject *pCopy = 0;

    HRESULT hRes = pSrc->Clone(&pCopy);

    if (hRes != WBEM_S_NO_ERROR)       // Failed to clone it.
        return FALSE;

    // Use the copy of the enumerator.
    // ...

    pCopy->Release();

    return TRUE;
}