<div class="content"><p> </p><p>The method <b>R_DhcpV4RemoveOptionValue</b> removes the
option value for the specified policy.</p><dl>
<dd>
<div><pre> DWORD R_DhcpV4RemoveOptionValue(
   [in, unique, string] DHCP_SRV_HANDLE ServerIpAddress,
   [in] DWORD Flags,
   [in] DHCP_OPTION_ID OptionID,
   [in, string, unique] WCHAR* PolicyName,
   [in, string, unique] WCHAR* VendorName,
   [in] 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>Flags: </b>This is of type <span><a href="../ms-dtyp/262627d8-3418-4627-9218-4ffe110850b2" data-linktype="relative-path">DWORD</a></span>
that specifies that the option value is set for a specific or default vendor
class.</p><dl>
<dd>
<table><thead>
  <tr>
   <th>
   <p>Value</p>
   </th>
   <th>
   <p>Meaning</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>
  <p>DHCP_FLAGS_OPTION_DEFAULT</p>
  <p>0x00000000</p>
  </td>
  <td>
  <p>The option definition is set for the default vendor
  class.</p>
  </td>
 </tr><tr>
  <td>
  <p>DHCP_FLAGS_OPTION_IS_VENDOR</p>
  <p>0x00000003</p>
  </td>
  <td>
  <p>If a bitwise AND operation with this bitmask yields a
  nonzero value, it indicates that the option definition is set for a specific
  vendor class.</p>
  </td>
 </tr></tbody></table>
</dd></dl><p><b>OptionID: </b>This is of type <b>DHCP_OPTION_ID</b>
data type (section <span><a href="4a0bb785-ceec-4f7a-b4a7-64555f6e0b62" data-linktype="relative-path">2.2.1.2.3</a></span>),
containing the option ID of the option being set or modified.</p><p><b>PolicyName: </b>A pointer to a null-terminated
Unicode string that contains the name of the policy inside the subnet
identified by the <b>SubnetScopeInfo</b> member of the <i>ScopeInfo</i>
parameter for which the option value is being set.</p><p><b>VendorName: </b>A pointer to a null-terminated
Unicode string that contains the name of the vendor class to which the option
value is being set. This parameter is optional. If the vendor class is not
specified, the option value is set for a default vendor class.</p><p><b>ScopeInfo: </b>This is a pointer to a type <span><a href="177415f4-85c1-4496-a414-4938dca18b93" data-linktype="relative-path">DHCP_OPTION_SCOPE_INFO (section 2.2.1.2.41)</a></span>
that contains information describing the DHCPv4 scope for which this option
value is set. This value contains the server level or scope level at which the
option values are set.</p><p><b>Return Values: </b>A 32-bit unsigned integer value
that indicates return status. A return value of ERROR_SUCCESS (0x00000000)
indicates that the operation was completed successfully. Otherwise, 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 to 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, or no value is set for the specified option ID on the
  specified policy.</p>
  </td>
 </tr><tr>
  <td>
  <p>0x00004E4C</p>
  <p>ERROR_DHCP_CLASS_NOT_FOUND</p>
  </td>
  <td>
  <p>The class name being used is unknown or incorrect.</p>
  </td>
 </tr><tr>
  <td>
  <p>0x00004E8F</p>
  <p>ERROR_DHCP_POLICY_NOT_PRESENT</p>
  </td>
  <td>
  <p>The specified policy name does not exist.</p>
  </td>
 </tr></tbody></table>
</dd></dl><p>The opnum field value for this method is 104.</p><p>When processing this call, the DHCP server MUST do the
following:</p><ul><li><p><span><span> 
</span></span>The <i>Flags</i> parameter MUST pass one of the validations given
in the <i>Flags</i> parameter description. Otherwise, the method returns
ERROR_INVALID_PARAMETER.</p>
</li><li><p><span><span> 
</span></span>If the <b>ScopeType</b> member in the <i>ScopeInfo</i> parameter
is DhcpReservedOptions enumeration value or DhcpMScopeOptions enumeration value
and the <i>PolicyName</i> parameter is not NULL, the method returns
ERROR_INVALID_PARAMETER.</p>
</li><li><p><span><span> 
</span></span>Validate whether this method is authorized for read/write access
as specified in section <span><a href="38840bd0-0a5a-47ed-bc69-0dd870d33aec" data-linktype="relative-path">3.5.5</a></span>. If not,
return ERROR_ACCESS_DENIED.</p>
</li><li><p><span><span> 
</span></span>If the <i>VendorName</i> parameter is not NULL, retrieve the <b>DHCPv4ClassDef</b>
ADM element entry corresponding to the <i>VendorName</i> parameter from the server
ADM element <b>DHCPv4ClassDefList</b>. If the <b>DHCPv4ClassDef</b> ADM element
entry is not found, return ERROR_DHCP_CLASS_NOT_FOUND. If the <i>VendorName</i>
parameter is NULL, it refers to the default vendor class (see section <span><a href="6c69e0bd-f280-46d9-93b4-054370c6428c" data-linktype="relative-path">3.1.1.11</a></span>).</p>
</li><li><p><span><span> 
</span></span>If the <b>ScopeType</b> member in the <i>ScopeInfo</i> parameter
contains the DhcpDefaultOptions enumeration value:</p>
<ul><li><p><span><span>  </span></span>Iterate
through the server ADM element <b>DHCPv4OptionDefList</b> and retrieve the <b>DHCPv4OptionDef.DHCPv4ClassedOptDefList</b>
ADM element corresponding to the vendor class specified by the <i>VendorName</i>
parameter. If there is no <b>DHCPv4OptionDef</b> ADM element entry
corresponding to the specified vendor class, return ERROR_DHCP_CLASS_NOT_FOUND.</p>
</li><li><p><span><span>  </span></span>Iterate
through the <b>DHCPv4ClassedOptDefList</b> ADM element and if there is no <b>DHCPv4ClassedOptDef</b>
ADM element entry corresponding to the <i>OptionId</i> parameter, return
ERROR_DHCP_OPTION_NOT_PRESENT.</p>
</li><li><p><span><span>  </span></span>Delete
the <b>DefaultValue</b> member of the retrieved <b>DHCPv4ClassedOptDef</b> ADM
element and return ERROR_SUCCESS.</p>
</li></ul></li><li><p><span><span> 
</span></span>If the <b>ScopeType</b> member in the <i>ScopeInfo</i> parameter
contains the DhcpGlobalOptions enumeration value:</p>
<ul><li><p><span><span>  </span></span>Retrieve
the server ADM element <b>DHCPv4ServerPolicyList</b>. Retrieve the <b>DHCPv4Policy</b>
ADM element from the <b>DHCPv4ServerPolicyList</b> ADM element that has the same
name as the <i>PolicyName</i> parameter. If there is no policy with the
specified name, return ERROR_DHCP_POLICY_NOT_FOUND.</p>
</li><li><p><span><span>  </span></span>Retrieve
each <b>DHCPv4PolicyOptionValue ADM</b> element from the server ADM element <b>DHCPv4ServerPolicyOptionValuesList</b>.
Get the <b>DHCPv4PolicyOptionValue</b> ADM element for which the <b>DHCPv4PolicyOptionValue.PolicyName</b>
ADM element and the <b>DHCPv4PolicyOptionValue.VendorName</b> ADM element match
the <i>PolicyName</i> parameter and the <i>VendorName</i> parameter passed to
the method.</p>
</li><li><p><span><span>  </span></span>From
the <b>DHCPv4PolicyOptionValue.DHCPv4ClassedOptionValues</b> ADM element list,
if there is a <b>DHCPv4ClassedOptValue</b> ADM element that contains the same <b>OptionID</b>
ADM element as the <i>OptionId</i> parameter passed to the method, delete the <b>DHCPv4ClassedOptValue</b>
ADM element and return ERROR_SUCCESS.</p>
</li><li><p><span><span>  </span></span>If
there is no <b>DHCPv4ClassedOptValue</b> ADM element that contains the same <b>OptionID</b>
ADM element as the <i>OptionId</i> parameter, return
ERROR_DHCP_OPTION_NOT_PRESENT.</p>
</li></ul></li><li><p><span><span> 
</span></span>If the <i>ScopeInfo</i> parameter contains the <b>SubnetScopeInfo</b>
member:</p>
<ul><li><p><span><span>  </span></span>Retrieve
the server ADM element <b>DHCPv4ScopesList</b>. Retrieve the <b>DHCPv4Scope</b>
ADM element that contains the same IP address as the IP address in the <b>SubnetScopeInfo</b>
member. If there is no scope with the specified IP address, return
ERROR_DHCP_SUBNET_NOT_PRESENT.</p>
</li><li><p><span><span>  </span></span>Retrieve
the <b>DHCPv4Scope.DHCPv4ScopePolicyList</b> ADM element. Retrieve the <b>DHCPv4Policy</b>
ADM element from the <b>DHCPv4Scope.DHCPv4ScopePolicyList</b> ADM element with
the same <b>PolicyName</b> ADM element as the specified <i>PolicyName</i>
parameter. If there is no policy with the specified name, return
ERROR_DHCP_POLICY_NOT_FOUND.</p>
</li><li><p><span><span>  </span></span>Retrieve
each <b>DHCPv4PolicyOptionValue</b> ADM element from the scope ADM element <b>DHCPv4Scope.DHCPv4ScopePolicyOptionValuesList</b>.
Get the <b>DHCPv4PolicyOptionValue</b> ADM element for which the <b>DHCPv4PolicyOptionValue.PolicyName</b>
ADM element and the <b>DHCPv4PolicyOptionValue.VendorName</b> ADM element match
the <i>PolicyName</i> parameter and the <i>VendorName</i> parameter passed to
the method.</p>
</li><li><p><span><span>  </span></span>From
the <b>DHCPv4PolicyOptionValue.DHCPv4ClassedOptionValues</b> ADM element list,
if there is a <b>DHCPv4ClassedOptValue</b> ADM element that contains the same <b>OptionID</b>
ADM element as the <i>OptionId</i> parameter passed to the method, delete the <b>DHCPv4ClassedOptValue</b>
ADM element and return ERROR_SUCCESS.</p>
</li><li><p><span><span>  </span></span>If
there is no <b>DHCPv4ClassedOptValue</b> ADM element that contains the same <b>OptionID</b>
ADM element as the <i>OptionId</i> parameter, return
ERROR_DHCP_OPTION_NOT_PRESENT.</p>
</li></ul></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>