<div class="content"><p> </p><p>The <b>R_DhcpRemoveOptionValue</b> method removes the option
value for a specific option on the DHCPv4 server for the default <span><a href="a9d6a415-4de6-4058-befe-ca2e42764485#gt_713c7395-9431-4d67-bab1-a069ae7461e2" data-linktype="relative-path">user
class</a></span> and <span><a href="a9d6a415-4de6-4058-befe-ca2e42764485#gt_45d20b00-7166-4f94-b679-4cc5a7835a3a" data-linktype="relative-path">vendor class</a></span>. <i>ScopeInfo</i>
defines the level (that is, server, <span><a href="a9d6a415-4de6-4058-befe-ca2e42764485#gt_128cd76b-eecb-41e6-96f7-f73c2bf9235a" data-linktype="relative-path">scope</a></span>, <span><a href="a9d6a415-4de6-4058-befe-ca2e42764485#gt_04286a2c-1484-44d0-9854-7c57c8b4118c" data-linktype="relative-path">multicast
scope</a></span>, or IPv4 <span><a href="a9d6a415-4de6-4058-befe-ca2e42764485#gt_4e525014-9425-4eb0-9141-61189c4f04f9" data-linktype="relative-path">reservation</a></span> level)
on which this option value is removed.</p><dl>
<dd>
<div><pre> DWORD R_DhcpRemoveOptionValue(
   [in, unique, string] DHCP_SRV_HANDLE ServerIpAddress,
   [in] DHCP_OPTION_ID OptionID,
   [in, ref] LPDHCP_OPTION_SCOPE_INFO ScopeInfo
 );
</pre></div>
</dd></dl><p><b>ServerIpAddress: </b>The IP address/host name of
the DHCP server. This parameter is unused.</p><p><b>OptionID: </b>This is of type <span><a href="4a0bb785-ceec-4f7a-b4a7-64555f6e0b62" data-linktype="relative-path">DHCP_OPTION_ID (section 2.2.1.2.3)</a></span>,
containing the option identifier for the option being removed.</p><p><b>ScopeInfo: </b>This is a pointer to a <span><a href="177415f4-85c1-4496-a414-4938dca18b93" data-linktype="relative-path">DHCP_OPTION_SCOPE_INFO (section 2.2.1.2.41)</a></span>
structure that contains information describing the level (that is, server,
scope, multicast scope, or IPv4 reservation level) from which this option value
is removed.</p><p><b>Return Values: </b>A 32-bit unsigned integer value
that indicates return status. A return value ERROR_SUCCESS (0x00000000)
indicates that the operation was completed successfully, else it contains a
Win32 error code, as specified in <span><a href="../ms-erref/1bc92ddf-b79e-413c-bbaa-99a5281a6c90" data-linktype="relative-path">[MS-ERREF]</a></span>.
This error code value can correspond to a DHCP-specific failure, which takes a value
between 20000 and 20099, or any generic failure.</p><dl>
<dd>
<table><thead>
  <tr>
   <th>
   <p>Return value/code</p>
   </th>
   <th>
   <p>Description</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>
  <p>0x00000000</p>
  <p>ERROR_SUCCESS</p>
  </td>
  <td>
  <p>The call was successful.</p>
  </td>
 </tr><tr>
  <td>
  <p>0x00004E25</p>
  <p>ERROR_DHCP_SUBNET_NOT_PRESENT</p>
  </td>
  <td>
  <p>The specified IPv4 subnet does not exist on the DHCP
  server.</p>
  </td>
 </tr><tr>
  <td>
  <p>0x00004E2A</p>
  <p>ERROR_DHCP_OPTION_NOT_PRESENT</p>
  </td>
  <td>
  <p>The specified option definition does not exist on the
  DHCP server database.</p>
  </td>
 </tr><tr>
  <td>
  <p>0x00004E32</p>
  <p>ERROR_DHCP_NOT_RESERVED_CLIENT</p>
  </td>
  <td>
  <p>The specified DHCP client is not a reserved client.</p>
  </td>
 </tr></tbody></table>
</dd></dl><p>The opnum field value for this method is 15.</p><p>When processing this call, the DHCP server MUST do the
following:</p><ul><li><p><span><span> 
</span></span>Validate that this method is authorized for read/write access per
section <span><a href="38840bd0-0a5a-47ed-bc69-0dd870d33aec" data-linktype="relative-path">3.5.5</a></span>. If not,
return the error ERROR_ACCESS_DENIED.</p>
</li><li><p><span><span> 
</span></span>If the <i>ScopeInfo</i> parameter contains DhcpDefaultOptions,
return the error ERROR_INVALID_PARAMETER.</p>
</li><li><p><span><span> 
</span></span>If the <i>ScopeInfo</i> parameter contains DhcpGlobalOptions,
iterate through the server Abstract Data Model (ADM) element <b>DHCPv4ServerOptValueList</b>
and retrieve the <b>DHCPv4OptionValue</b> ADM element entry if the <b>UserClass</b>
and <b>VendorClass</b> ADM element fields are NULL. If the <b>DHCPv4OptionValue</b>
ADM element is not found, return ERROR_DHCP_OPTION_NOT_PRESENT, else retrieve
the <b>DHCPv4ClassedOptValue</b> ADM element entry corresponding to the <i>OptionID</i>
parameter from the <b>DHCPv4OptionValue.DHCPv4ClassedOptValueList</b> ADM
element. Go to the last step.</p>
</li><li><p><span><span> 
</span></span>If the <i>ScopeInfo</i> parameter contains DhcpSubnetOptions,
retrieve the <b>DHCPv4Scope</b> ADM element entry corresponding to the <b>SubnetScopeInfo</b>
member of the <i>ScopeInfo</i> parameter from the server ADM element <b>DHCPv4ScopesList</b>.
If the <b>DHCPv4Scope</b> ADM element entry is not found, return
ERROR_DHCP_SUBNET_NOT_PRESENT, else iterate through <b>DHCPv4Scope.DHCPv4ScopeOptValuesList</b>
ADM element and retrieve the <b>DHCPv4OptionValue</b> ADM element entry if the <b>UserClass</b>
and <b>VendorClass</b> ADM element fields are NULL. If the <b>DHCPv4OptionValue</b>
ADM element is not found, return ERROR_DHCP_OPTION_NOT_PRESENT, else retrieve
the <b>DHCPv4ClassedOptValue</b> ADM element entry corresponding to the <i>OptionID</i>
parameter from the <b>DHCPv4OptionValue.DHCPv4ClassedOptValueList</b> ADM
element. Go to the last step. </p>
</li><li><p><span><span> 
</span></span>If the <i>ScopeInfo</i> parameter contains DhcpMScopeOptions,
retrieve the <b>DHCPv4MScope</b> ADM element entry corresponding to the <i>ScopeInfo</i>
parameter from the server ADM element <b>DHCPv4MScopesList</b>. If the <b>DHCPv4MScope</b>
ADM element entry is not found, return ERROR_DHCP_SUBNET_NOT_PRESENT, else
iterate through <b>DHCPv4MScope.DHCPv4MScopeOptValuesList</b> ADM element and
retrieve the <b>DHCPv4OptionValue</b> ADM element entry if the <b>UserClass</b>
and <b>VendorClass</b> ADM element fields are NULL. If the <b>DHCPv4OptionValue</b>
ADM element is not found, return ERROR_DHCP_OPTION_NOT_PRESENT, else retrieve
the <b>DHCPv4ClassedOptValue</b> ADM element entry corresponding to the <i>OptionID</i>
parameter from the <b>DHCPv4OptionValue.DHCPv4ClassedOptValueList</b> ADM
element. Go to the last step.</p>
</li><li><p><span><span> 
</span></span>If the <i>ScopeInfo</i> parameter contains DhcpReservedOptions,
retrieve the <b>DHCPv4Scope</b> ADM element entry from the server ADM element <b>DHCPv4ScopesList</b>
that contains the <b>ReservedIpAddress</b> member of the <i>ScopeInfo</i>
parameter. If the <b>DHCPv4Scope</b> ADM element entry is not found, return
ERROR_DHCP_NOT_RESERVED_CLIENT, else if the <b>ScopeInfo.SubnetAddress</b> ADM
element does not match with the <i>ScopeInfo&#39;s </i><b>ReservedIpSubnetAddress</b>
member, return ERROR_DHCP_SUBNET_NOT_PRESENT, else retrieve the <b>DHCPv4Reservation</b>
ADM element entry from the <b>DHCPv4Scope.DHCPv4ReservationsList</b> ADM
element corresponding to the <b>ReservedIpAddress</b> member. If the <b>ReservedIpAddress</b>
member is not part of the <b>DHCPv4Scope</b> ADM element, or if there is no <b>DHCPv4Reservation</b>
ADM element corresponding to the <b>ReservedIpAddress</b> member, return
ERROR_DHCP_NOT_RESERVED_CLIENT, else iterate through <b>DHCPv4Reservation.DHCPv4ResvOptValuesList</b>
ADM element and retrieve the <b>DHCPv4OptionValue</b> ADM element entry if the <b>UserClass</b>
and <b>VendorClass</b> ADM element fields are NULL. If the <b>DHCPv4OptionValue</b>
ADM element is not found, return ERROR_DHCP_OPTION_NOT_PRESENT, else retrieve
the <b>DHCPv4ClassedOptValue</b> ADM element entry corresponding to the <i>OptionID</i>
parameter from the <b>DHCPv4OptionValue.DHCPv4ClassedOptValueList</b> ADM
element.</p>
</li><li><p><span><span> 
</span></span>If the <b>DHCPv4ClassedOptValue</b> ADM element entry
corresponding to the <i>OptionID</i> parameter is not present, then return
ERROR_DHCP_OPTION_NOT_PRESENT.<a id="Appendix_A_Target_30"></a><a aria-label="Product behavior note 30" href="afab0546-79ae-4764-8dab-27a85cca5145#Appendix_A_30" data-linktype="relative-path">&lt;30&gt;</a>
Otherwise, delete the <b>DHCPv4ClassedOptValue</b> ADM element entry
corresponding to the <i>OptionID</i> parameter from the <b>DHCPv4ClassedOptValueList</b>
ADM element, and return ERROR_SUCCESS.</p>
</li></ul><p><b>Exceptions Thrown:</b> No exceptions are thrown beyond
those thrown by the underlying RPC protocol specified in <span><a href="../ms-rpce/290c38b1-92fe-4229-91e6-4fc376610c15" data-linktype="relative-path">[MS-RPCE]</a></span>.</p></div>