<div class="content" name="R_DhcpV4FailoverDeleteScopeFromRelationship" uuid="016e6f31-e9ea-4c7d-b686-45440810a1c7"><p>The <b>R_DhcpV4FailoverDeleteScopeFromRelationship</b>
method is used to delete one or more scopes from an existing failover
relationship.</p><dl>
<dd>
<div><pre> DWORD R_DhcpV4FailoverDeleteScopeFromRelationship(
   [in, unique, string] DHCP_SRV_HANDLE ServerIpAddress,
   [in] LPDHCP_FAILOVER_RELATIONSHIP pRelationship
 );
</pre></div>
</dd></dl><p><b>ServerIpAddress: </b>The IP address/host name of
the DHCP server. This parameter is unused.</p><p><b>pRelationship: </b>This is a pointer to a type <b>DHCP_FAILOVER_RELATIONSHIP</b>
structure (section <a href="9153f2b7-e4df-4475-9275-d2092a93bd51" data-linktype="relative-path">2.2.1.2.98</a>)
that contains information about the failover relationship from which scopes as
specified in <b>pScopes</b> member of <i>pRelationship</i>.parameter are to be
deleted.</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 <a href="../ms-erref/1bc92ddf-b79e-413c-bbaa-99a5281a6c90" data-linktype="relative-path">[MS-ERREF]</a>.
This error code value can correspond to a DHCP-specific failure, which takes a
value between 20000 and 20123, 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>0x00000000 ERROR_SUCCESS</td>
  <td>The call was successful.</td>
 </tr><tr>
  <td>0x00004E25 ERROR_DHCP_SUBNET_NOT_PRESENT</td>
  <td>IPv4 scope doesn&#39;t exist on the DHCPv4 server.</td>
 </tr><tr>
  <td>0x00004E92 ERROR_DHCP_FO_RELATIONSHIP_DOES_NOT_EXIST</td>
  <td>Failover relationship doesn&#39;t exist.</td>
 </tr><tr>
  <td>0x00004E94 ERROR_DHCP_FO_SCOPE_NOT_IN_RELATIONSHIP</td>
  <td>IPv4 subnet is not part of the failover relationship.</td>
 </tr><tr>
  <td>0x00004EA5 ERROR_DHCP_FO_SCOPE_SYNC_IN_PROGRESS</td>
  <td>Failover relationship is being re-integrated with the failover partner server.</td>
 </tr></tbody></table>
</dd></dl><p>The opnum field value for this method is 95.</p><p>When processing this call, the DHCP server MUST do the
following:</p><ul><li><p><span><span> 
</span></span>Return ERROR_INVALID_PARAMETER if any of the following are true:</p>
<ul><li><p><span><span>  </span></span><i>pRelationship</i>
parameter is NULL.</p>
</li><li><p><span><span>  </span></span><b>relationshipName</b>
member of <i>pRelationship</i> parameter is NULL.</p>
</li><li><p><span><span>  </span></span><b>pScopes</b>
member of <i>pRelationship</i> parameter is NULL.</p>
</li><li><p><span><span>  </span></span><b>NumElements</b>
member of <b>pScopes</b> member as pointed by <i>pRelationship</i> parameter is
0.</p>
</li></ul></li><li><p><span><span> 
</span></span>Validate whether this method is authorized for read/write access
as specified in section <a href="38840bd0-0a5a-47ed-bc69-0dd870d33aec" data-linktype="relative-path">3.5.5</a>.
If not, return ERROR_ACCESS_DENIED.</p>
</li><li><p><span><span> 
</span></span>Iterate through the <b>DHCPv4ScopesList</b> ADM element on the
DHCPv4 server and if any of the IPv4 subnet addresses in the <b>pScopes</b>
member of <i>pRelationship</i> parameter doesn&#39;t have a corresponding <b>DHCPv4ScopesList.DHCPv4Scope</b>
ADM element on the DHCPv4 server, return ERROR_DHCP_SUBNET_NOT_PRESENT.</p>
</li><li><p><span><span> 
</span></span>For any of the IPv4 subnet addresses passed in <b>pScopes</b>
member of <i>pRelationship</i> parameter, if the corresponding <b>DHCPv4Scope.DHCPv4IpRange</b>
ADM element is of type DhcpIpRangesBootpOnly enumeration value (section <a href="0a196713-4790-412f-a2d7-893cbad301da" data-linktype="relative-path">2.2.1.2.38</a>), return ERROR_INVALID_PARAMETER.</p>
</li><li><p><span><span> 
</span></span>If there are no elements in <b>DHCPv4FailoverRelationshipList</b>
ADM element, return ERROR_FILE_NOT_FOUND.</p>
</li><li><p><span><span> 
</span></span>Iterate through the server ADM element <b>DHCPv4FailoverRelationshipList</b>,
and retrieve the <b>DHCPv4FailoverRelationship</b> ADM element corresponding to
<b>relationshipName</b> member of <i>pRelationship</i> parameter. If the
corresponding ADM element <b>DHCPv4FailoverRelationship</b> is not found,
return ERROR_DHCP_FO_RELATIONSHIP_DOES_NOT_EXIST.</p>
</li><li><p><span><span> 
</span></span>If any of the IPv4 subnet addresses passed in <b>pScopes</b>
member of <i>pRelationship</i> parameter is not configured on the retrieved <b>DHCPv4FailoverRelationship</b>
ADM element, return ERROR_DHCP_FO_SCOPE_NOT_IN_RELATIONSHIP, or, if the
relationship is re-integrating with the partner server, return
ERROR_DHCP_FO_SCOPE_SYNC_IN_PROGRESS. Otherwise, remove all the IPv4 subnets
addresses in the <b>pScopes</b> member of <i>pRelationship</i> parameter from
the retrieved <b>DHCPv4FailoverRelationship</b> ADM element&#39;s <b>pScope</b>
member.</p>
</li><li><p><span><span> 
</span></span>For each of the input IPv4 subnet addresses passed in <b>pScopes</b>
member in <i>pRelationship</i> parameter, iterate through the <b>DHCPv4ScopesList</b>
ADM element and retrieve the corresponding <b>DHCPv4Scope</b> ADM element and
set <b>DHCPv4Scope.IsFailover</b> ADM element to FALSE.</p>
</li><li><p><span><span> 
</span></span>Return ERROR_SUCCESS.</p>
</li></ul><p><b>Exceptions Thrown:</b> No exceptions are thrown beyond
those thrown by the underlying RPC protocol <a href="../ms-rpce/290c38b1-92fe-4229-91e6-4fc376610c15" data-linktype="relative-path">[MS-RPCE]</a>.</p></div>