次の方法で共有


3.1.4.3.11 IWbemServices::CreateClassEnumAsync (Opnum 13)

The IWbemServices::CreateClassEnumAsync method provides an asynchronous class enumeration. When this method is invoked, the server MUST return all classes that satisfy the selection criteria.

 HRESULT CreateClassEnumAsync(
   [in] const BSTR strSuperclass,
   [in] long lFlags,
   [in] IWbemContext* pCtx,
   [in] IWbemObjectSink* pResponseHandler
 );

strSuperClass: Specifies a superclass name. Only classes that are subclasses of this class MUST be returned. If strSuperClass is NULL or a zero-length string, all classes in the namespace MUST be considered in the result set. The results MUST be filtered by using the lFlags parameter. Classes without a base class are considered to be derived from the NULL superclass.

lFlags: Flags that affect the behavior of the CreateClassEnum method. Flag behavior MUST be interpreted as specified in the following table.

The server MUST allow any combination of zero or more flags from the following table and MUST comply with all the restrictions in a flag description. Any other DWORD value that does not match a flag condition MUST be treated as not valid.

Value

Meaning

WBEM_FLAG_USE_AMENDED_QUALIFIERS

0x00020000

If this bit is not set, the server SHOULD return no CIM localizable information.

If this bit is set, the server SHOULD return CIM localizable information for the CIM object as specified in section 2.2.6.

WBEM_FLAG_SEND_STATUS

0x00000080

If this bit is not set, the server MUST make one final IWbemObjectSink::SetStatus call on the interface pointer that is provided in the pResponseHandler parameter.

If this bit is set, the server MAY make intermediate IWbemObjectSink::SetStatus calls on the interface pointer prior to call completion.

WBEM_FLAG_SHALLOW

0x00000001

When this bit is not set, the server MUST return all classes that are derived from the requested class and all its subclasses.

When this bit is set, the server MUST only return the classes that are directly derived from the requested class.

pCtx: MUST be a pointer to an IWbemContext interface, which MUST contain additional information that the client wants to pass to the server. If pCtx is NULL, the parameter MUST be ignored.

pResponseHandler: MUST be a pointer to the IWbemObjectSink that is implemented by the caller, where enumeration results are delivered. The parameter MUST NOT be NULL. In error cases, indicated by the return value, the supplied IWbemObjectSink interface pointer MUST NOT be used. If WBEM_S_NO_ERROR is returned, the user IWbemObjectSink interface pointer MUST be called to indicate the results of the CreateClassEnumAsync operation, as specified later in this section.

Return Values: This method MUST return an HRESULT, which MUST indicate the status of the method call. The HRESULT MUST have the type and values as specified in section 2.2.11. The server MUST return WBEM_S_NO_ERROR (specified in section 2.2.11) to indicate the successful completion of the method.

WBEM_S_NO_ERROR (0x00)

The following validation occurs before the asynchronous operation starts:

The security principal that makes the call MUST have WBEM_REMOTE_ENABLE and WBEM_ENABLE accesses to the namespace; otherwise, WBEM_E_ACCESS_DENIED MUST be returned.

The server SHOULD enforce a maximum length for the strSuperClass parameter and return WBEM_E_QUOTA_VIOLATION if the limit is exceeded.<41>

Requirements mentioned in the parameter definitions are also checked before starting the asynchronous operation.

If successful, the server MUST create a new entry in AsyncOperationTable as specified in section 3.1.1.1.3.

The following validation occurs asynchronously:

If strSuperClass is dynamic, the server MUST obtain SupportsEnumerate for the given provider in the ProviderTable. If SupportsEnumerate is FALSE, the server MUST return WBEM_E_PROVIDER_NOT_CAPABLE.

In response to the IWbemServices::CreateClassEnumAsync method, the server MUST evaluate the strSuperClass parameter (specified in this section) and MUST return all classes that match the input parameters from the current namespace. The method MUST fail if strSuperClass does not exist, if the method parameters or their combinations are not valid as specified earlier in this section, or if the server is unable to execute the method.