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.Next |
IEnumWbemClassObject::Next (wbemcli.h) |
Use the IEnumWbemClassObject::Next method to get one or more objects starting at the current position in an enumeration. |
|
wmi\ienumwbemclassobject_next.htm |
wmi |
8bde633b-b04a-4a21-82ce-f5aab1d32d95 |
12/05/2018 |
IEnumWbemClassObject interface [Windows Management Instrumentation],Next method, IEnumWbemClassObject.Next, IEnumWbemClassObject::Next, Next, Next method [Windows Management Instrumentation], Next method [Windows Management Instrumentation],IEnumWbemClassObject interface, _hmm_ienumwbemclassobject_next, wbemcli/IEnumWbemClassObject::Next, wmi.ienumwbemclassobject_next |
wbemcli.h |
Wbemidl.h |
Windows |
Windows Vista |
Windows Server 2008 |
Wbemuuid.lib |
Fastprox.dll |
Windows |
19H1 |
|
|
|
|
|
|
Use the IEnumWbemClassObject::Next method to get one or more objects starting at the current position in an enumeration. This method advances the current position in the enumeration by uCount objects, so that subsequent calls return the subsequent objects.
Specifies the maximum amount of time in milliseconds that the call blocks before returning. If you use the constant WBEM_INFINITE (0xFFFFFFFF), the call blocks until objects are available. If you use the value 0 (WBEM_NO_WAIT), the call returns immediately, whether any objects are available or not.
Number of requested objects.
Pointer to enough storage to hold the number of IWbemClassObject interface pointers specified by uCount. This storage must be supplied by the caller. This parameter cannot be NULL. The caller must call Release on each of the received interface pointers when they are no longer needed.
Pointer to a ULONG that receives the number of objects returned. This number can be less than the number requested in uCount. This pointer cannot be NULL.
The Next method returns an HRESULT indicating the status of the method call. The following list lists the value contained within an HRESULT.
You may see COM-specific error codes returned if network problems cause you to lose the remote connection to Windows Management. On error, you can call the COM function GetErrorInfo to obtain more error information.
If more than one object is requested, and if the number of requested objects is returned, the function returns WBEM_S_NO_ERROR. If less than the requested number of objects is available, and if the enumeration has completed, those objects are returned and the function returns WBEM_S_FALSE.
If the enumeration has not completed, the call waits for objects to be available up to the specified time-out. If the enumeration times out before the objects are available, the function returns WBEM_S_TIMEDOUT.
For an extended discussion and example of making queries in C++ and WMI, see Making WMI Queries In C++ on CodeProject.
In the following code, more than one object is requested:HRESULT ProcessEnum( IEnumWbemClassObject* pEnum )
{
HRESULT hRes = WBEM_S_NO_ERROR;
// Final Next will return WBEM_S_FALSE
while ( WBEM_S_NO_ERROR == hRes )
{
ULONG uReturned;
IWbemClassObject* apObj[10];
hRes = pEnum->Next( WBEM_INFINITE, 10, apObj, &uReturned );
if ( SUCCEEDED( hRes ) )
{
// Do something with the objects.
//ProcessObjects( uReturned, apObj );
for ( ULONG n = 0; n < uReturned; n++ )
{
apObj[n]->Release();
}
} // If Enum succeeded...
} // While Enum is returning objects...
return hRes;
}