<div class="content" name="DeleteApplicationPool" uuid="c90ed4b2-06e5-4b66-909f-6c8a1c0a7de4"><p>The DeleteApplicationPool method deletes an application
pool.</p><dl>
<dd>
<div><pre> HRESULT DeleteApplicationPool(
   [in, unique, string] LPCWSTR szPool
 );
</pre></div>
</dd></dl><p><b>szPool: </b>A pointer to a Unicode string that
contains the name of the application pool to delete.</p><p><b>Return Values: </b> A signed 32-bit value that
indicates return status. If the method returns a negative value, it failed. If
the 12-bit facility code (bits 16–27) is set to 0x007, the value contains a
Win32 error code in the lower 16 bits. Zero or positive values indicate
success, with the lower 16 bits in positive nonzero values containing warnings
or flags defined in the method implementation. For more information about Win32
error codes and <a href="../ms-dtyp/a9046ed2-bfb2-4d56-a719-2824afce59ac" data-linktype="relative-path">HRESULT</a>
values, see <a href="../ms-erref/1bc92ddf-b79e-413c-bbaa-99a5281a6c90" data-linktype="relative-path">[MS-ERREF]</a>.
</p><dl>
<dd>
<table><thead>
  <tr>
   <th>
   <p>Return value/code</p>
   </th>
   <th>
   <p>Description</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>0x00000000 S_OK</td>
  <td>The call was successful.</td>
 </tr><tr>
  <td>0x80070490 ERROR_NOT_FOUND</td>
  <td>Element not found.</td>
 </tr><tr>
  <td>0x800710D3 ERROR_NOT_EMPTY</td>
  <td>The library, drive, or media pool must be empty to perform this operation.</td>
 </tr></tbody></table>
</dd></dl><p>The <a href="1243ba70-74ca-44f9-be0b-dfd6697010b4#gt_e127848e-c66d-427d-b3aa-9f904fa4ada7" data-linktype="relative-path">opnum</a>
field value for this method is 6. </p><p>When processing this call, the server MUST do the following:</p><ul><li><p><span><span> 
</span></span>Determine whether the application pool specified by the <i>szPool</i>
parameter exists. If it does not, return ERROR_NOT_FOUND.</p>
</li><li><p><span><span> 
</span></span>Enumerate the applications in the application pool specified by <i>szPool</i>
(see section <a href="3ab0eba3-5bab-413b-b7d9-c88f7e53ce72" data-linktype="relative-path">3.9.4.5</a>).
If any applications are associated with the pool, return ERROR_NOT_EMPTY.</p>
</li><li><p><span><span> 
</span></span>Delete the application pool.</p>
</li></ul></div>