<div class="content" name="DeleteSection" uuid="9835e313-e8c0-4f10-9a1b-32a62bccbef7"><p>The DeleteSection method is received by the server in an
RPC_REQUEST packet. In response, the server deletes the specified section
definition.</p><dl>
<dd>
<div><pre> HRESULT DeleteSection(
   [in] VARIANT varIndex
 );
</pre></div>
</dd></dl><p><b>varIndex: </b> A VARIANT index that specifies the
section definition to delete. If the VARIANT is of type integer, the index is a
zero-based index to the collection. If the VARIANT is of type string, the index
is the string name of the section definition.</p><p><b>Return Values: </b>The server MUST return zero if
it successfully processes the message that is received from the client. If
processing fails, the server MUST return a nonzero <a href="../ms-dtyp/a9046ed2-bfb2-4d56-a719-2824afce59ac" data-linktype="relative-path">HRESULT</a>
code as defined in <a href="../ms-erref/1bc92ddf-b79e-413c-bbaa-99a5281a6c90" data-linktype="relative-path">[MS-ERREF]</a>.
The following table describes the error conditions that MUST be handled and the
corresponding error codes. A server MAY return additional
implementation-specific error codes.</p><dl>
<dd>
<table><thead>
  <tr>
   <th>
   <p>Return value/code</p>
   </th>
   <th>
   <p>Description</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>0X00000000 NO_ERROR</td>
  <td>The operation completed successfully.</td>
 </tr><tr>
  <td>0X80070585 ERROR_INVALID_INDEX</td>
  <td>The integer index specified by varIndex is invalid, or the section with name specified by cIndex could not be found.</td>
 </tr><tr>
  <td>0X80070021 ERROR_LOCK_VIOLATION</td>
  <td>The instance is set to read-only.</td>
 </tr><tr>
  <td>0X00000002 ERROR_PATH_NOT_FOUND</td>
  <td>The system cannot find the path specified.The section could not be found.</td>
 </tr></tbody></table>
</dd></dl><p> </p></div>