<div class="content" name="DeleteInstanceAsync" uuid="0a7bdd3a-f834-4ae6-b7c4-b7ab7b93b755"><p>The IWbemServices::DeleteInstanceAsync method is the
asynchronous version of the <a href="dc4aee01-7b9f-4c1a-8671-658fa334b8a4" data-linktype="relative-path">IWbemServices::DeleteInstance</a>
method. The IWbemServices::DeleteInstanceAsync method deletes an instance of an
existing class from the namespace that is pointed to by the <a href="7a50647a-5311-41c2-8f4f-83bcfb497877" data-linktype="relative-path">IWbemServices</a> interface
that is used to call the method.</p><dl>
<dd>
<div><pre> HRESULT DeleteInstanceAsync(
   [in] const BSTR strObjectPath,
   [in] long lFlags,
   [in] IWbemContext* pCtx,
   [in] IWbemObjectSink* pResponseHandler
 );
</pre></div>
</dd></dl><p><b>strObjectPath: </b>MUST be the <a href="6837a7cb-ba2d-46b1-802c-fce2fd5a6ad6#gt_775e4b82-5447-4125-b887-b404421e1269" data-linktype="relative-path">CIM path</a> to the class
instance that the client wants to delete. This parameter MUST NOT be NULL. The
CIM path MUST contain the class name and the value of the key properties.</p><p><b>lFlags: </b>Flags that affect the behavior of the
IWbemServices::DeleteInstanceAsync method. Flag behavior MUST be interpreted as
specified in the following table.</p><dl>
<dd>
<table><thead>
  <tr>
   <th>
   <p>Value</p>
   </th>
   <th>
   <p>Meaning</p>
   </th>
  </tr>
 </thead><tbody><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></tbody></table>
</dd>
<dd>
<p>Any other DWORD value that does
not match the preceding condition MUST be treated as invalid.</p>
</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 contains 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 an <a href="0ddb4f22-371a-4697-af5b-d4184b179b68" data-linktype="relative-path">IWbemObjectSink</a> interface
object that is implemented by the client of this method. This parameter MUST
NOT be NULL.</p><p><b>Return Values: </b>This method MUST return an
HRESULT value that MUST indicate the status of the method call. The server MUST
return WBEM_S_NO_ERROR (specified in section <a href="a2899649-a5a3-4b13-9ffa-d8394dcdac63" data-linktype="relative-path">2.2.11</a>) 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 happens before asynchronous
operation is started.</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>strObjectPath</i>
parameter and return WBEM_E_QUOTA_VIOLATION if the limit is exceeded.<a id="Appendix_A_Target_45"></a><a aria-label="Product behavior note 45" href="27182640-aa3f-43b6-941f-a77d25f798e8#Appendix_A_45" data-linktype="relative-path">&lt;45&gt;</a></p><p>The method MUST fail if <i>strObjectPath</i> does not exist.</p><p>The requirements mentioned in the parameter definitions are
also checked before an asynchronous operation is started.</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 the CIM instance being updated is <a href="6837a7cb-ba2d-46b1-802c-fce2fd5a6ad6#gt_b11172af-9369-448d-9722-444eb52b21cb" data-linktype="relative-path">dynamic</a>, the security
principal that makes the call MUST have WBEM_WRITE_PROVIDER access to the
namespace; otherwise, WBEM_E_ACCESS_DENIED MUST be returned.</p><p>If the CIM instance being updated is static and if the CIM
instance is of a class that has a WMI system class as one of the classes in the
parent hierarchy, the security principal that makes the call MUST have
WBEM_FULL_WRITE access to the namespace; otherwise, WBEM_E_ACCESS_DENIED MUST
be returned.</p><p>If the CIM instance being updated is static and if the CIM
instance is of a class that does not have a WMI system class as one of the
classes in the parent hierarchy, the security principal that makes the call
MUST have WBEM_PARTIAL_WRITE_REP access to the namespace; otherwise,
WBEM_E_ACCESS_DENIED MUST be returned.</p><p>If the CIM instance being deleted is dynamic, the server
MUST obtain <b>SupportsDelete</b> for the given provider in the <b>ProviderTable</b>.
If <b>SupportsDelete</b> is FALSE, the server MUST return
WBEM_E_PROVIDER_NOT_CAPABLE.</p><p>In response to an IWbemServices::DeleteInstanceAsync method,
the server MUST evaluate the <i>strObjectPath</i> parameter (as specified in
this section) and MUST delete the instance that is identified by <i>strObjectPath</i>
from the current namespace. The method MUST fail if the following applies: if <i>strObjectPath</i>
does not exist; if the method parameters or their combinations are not valid as
specified in this section; or if the server is unable to execute the method.</p></div>