<div class="content" name="CreateClassEnumAsync" uuid="efd7250b-a5cf-459d-a2ef-c7b246a94449"><p>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. </p><dl>
<dd>
<div><pre> HRESULT CreateClassEnumAsync(
   [in] const BSTR strSuperclass,
   [in] long lFlags,
   [in] IWbemContext* pCtx,
   [in] IWbemObjectSink* pResponseHandler
 );
</pre></div>
</dd></dl><p><b>strSuperClass: </b>Specifies a <a href="6837a7cb-ba2d-46b1-802c-fce2fd5a6ad6#gt_fbb1e623-a709-400d-8d4a-85df94ad58c3" data-linktype="relative-path">superclass</a> name. Only
classes that are subclasses of this class MUST be returned. If <i>strSuperClass</i>
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 <i>lFlags</i>
parameter. Classes without a base class are considered to be derived from the
NULL superclass.</p><p><b>lFlags: </b>Flags that affect the behavior of the <a href="b05b1315-0d1f-46a6-8541-df2f72207a96" data-linktype="relative-path">CreateClassEnum</a> method.
Flag behavior MUST be interpreted as specified in the following table.</p><dl>
<dd>
<p>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.</p>
</dd>
<dd>
<table><thead>
  <tr>
   <th>
   <p>Value</p>
   </th>
   <th>
   <p>Meaning</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>WBEM_FLAG_USE_AMENDED_QUALIFIERS 0x00020000</td>
  <td>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.</td>
 </tr><tr>
  <td>WBEM_FLAG_SEND_STATUS 0x00000080</td>
  <td>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.</td>
 </tr><tr>
  <td>WBEM_FLAG_SHALLOW 0x00000001</td>
  <td>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.</td>
 </tr></tbody></table>
</dd></dl><p><b>pCtx: </b>MUST be a pointer to an <a href="18c8f1a1-652f-43b7-9186-6098bc303a8d" data-linktype="relative-path">IWbemContext</a> interface,
which MUST contain additional information that the client wants to pass to the
server. If <i>pCtx</i> is NULL, the parameter MUST be ignored.</p><p><b>pResponseHandler: </b>MUST be a pointer to the <a href="0ddb4f22-371a-4697-af5b-d4184b179b68" data-linktype="relative-path">IWbemObjectSink</a> 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.</p><p><b>Return Values: </b>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 <a href="a2899649-a5a3-4b13-9ffa-d8394dcdac63" data-linktype="relative-path">2.2.11</a>. The server MUST
return WBEM_S_NO_ERROR (specified in section 2.2.11) to indicate the successful
completion of the method.</p><dl>
<dd>
<p><b>WBEM_S_NO_ERROR</b> (0x00)</p>
</dd></dl><p>The following validation occurs before the asynchronous
operation starts:</p><p>The <a href="6837a7cb-ba2d-46b1-802c-fce2fd5a6ad6#gt_f3ef2572-95cf-4c5c-b3c9-551fd648f409" data-linktype="relative-path">security
principal</a> that makes the call MUST have WBEM_REMOTE_ENABLE and WBEM_ENABLE
accesses to the namespace; otherwise, WBEM_E_ACCESS_DENIED MUST be returned.</p><p>The server SHOULD enforce a maximum length for the <i>strSuperClass</i>
parameter and return WBEM_E_QUOTA_VIOLATION if the limit is exceeded.<a id="Appendix_A_Target_41"></a><a aria-label="Product behavior note 41" href="27182640-aa3f-43b6-941f-a77d25f798e8#Appendix_A_41" data-linktype="relative-path">&lt;41&gt;</a></p><p>Requirements mentioned in the parameter definitions are also
checked before starting the asynchronous operation.</p><p>If successful, the server MUST create a new entry in <b>AsyncOperationTable</b>
as specified in section <a href="83a955c3-2fba-4d06-bd88-76ed9bbada43" data-linktype="relative-path">3.1.1.1.3</a>.</p><p>The following validation occurs asynchronously:</p><p>If <i>strSuperClass</i> is dynamic, the server MUST obtain <b>SupportsEnumerate</b>
for the given provider in the <b>ProviderTable</b>. If <b>SupportsEnumerate</b>
is FALSE, the server MUST return WBEM_E_PROVIDER_NOT_CAPABLE.</p><p>In response to the IWbemServices::CreateClassEnumAsync
method, the server MUST evaluate the <i>strSuperClass</i> parameter (specified
in this section) and MUST return all classes that match the input parameters
from the current namespace. The method MUST fail if <i>strSuperClass</i> 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.</p></div>