<div class="content"><p> </p><p>The <b>R_DhcpCreateSubnetV6</b> method creates a new IPv6
prefix on the DHCPv6 server.</p><dl>
<dd>
<div><pre> DWORD R_DhcpCreateSubnetV6(
   [in, unique, string] DHCP_SRV_HANDLE ServerIpAddress,
   [in] DHCP_IPV6_ADDRESS SubnetAddress,
   [in, ref] LPDHCP_SUBNET_INFO_V6 SubnetInfo
 );
</pre></div>
</dd></dl><p><b>ServerIpAddress: </b>The IP address/host name of
the DHCP server. This parameter is unused.</p><p><b>SubnetAddress: </b>A pointer of type <span><a href="48b74c46-bf64-40db-92b9-6e61cee1bd33" data-linktype="relative-path">DHCP_IPV6_ADDRESS (section 2.2.1.2.28)</a></span>
that contains the IPv6 address of the subnet.</p><p><b>SubnetInfo: </b>A pointer to a structure of type <span><a href="9c609d1d-6ed0-40f6-bb2c-5228a8da03ea" data-linktype="relative-path">DHCP_SUBNET_INFO_V6 (section 2.2.1.2.56)</a></span>
that contains information about the IPv6 prefix to be added to the DHCPv6
server. The <b>Prefix</b> field is not stored in the database; any value
specified for this field does not alter the behavior of this method.</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>0x00004E2D</p>
  <p>ERROR_DHCP_JET_ERROR</p>
  </td>
  <td>
  <p>An error occurred while accessing the DHCP server
  database.</p>
  </td>
 </tr><tr>
  <td>
  <p>0x00004E7B</p>
  <p>ERROR_DHCP_INVALID_SUBNET_PREFIX</p>
  </td>
  <td>
  <p>The subnet prefix is invalid.</p>
  </td>
 </tr></tbody></table>
</dd></dl><p>The opnum field value for this method is 57.</p><p>When processing this call, the DHCP server MUST do the
following:</p><ul><li><p><span><span> 
</span></span>Validate if 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 <b>SubnetInfo</b> input parameter is NULL, return
ERROR_INVALID_PARAMETER.</p>
</li><li><p><span><span> 
</span></span>Validate that the subnet prefix specified in <b>SubnetAddress</b>
is not a <span><a href="a9d6a415-4de6-4058-befe-ca2e42764485#gt_e2c2c73e-9b5f-48ea-8902-41819735ca31" data-linktype="relative-path">unicast address</a></span> and
that the scope level is not link-local; otherwise, return
ERROR_DHCP_INVALID_SUBNET_PREFIX.<a id="Appendix_A_Target_60"></a><a aria-label="Product behavior note 60" href="afab0546-79ae-4764-8dab-27a85cca5145#Appendix_A_60" data-linktype="relative-path">&lt;60&gt;</a></p>
</li><li><p><span><span> 
</span></span>If the subnet prefix specified in <b>SubnetAddress</b> is already
configured on the DHCPv6 server, return ERROR_DUPLICATE_TAG.</p>
</li><li><p><span><span> 
</span></span>Create a <b>DHCPv6Scope</b> object and initialize the <b>DHCPv6Scope.SubnetInfoV6</b>
object with the information contained in <b>SubnetInfo</b>. Initialize <b>DHCPv6Scope.DHCPv6ExclusionRangeList</b>,
<b>DHCPv6Scope.DHCPv6ReservationList</b>, <b>DHCPv6Scope.DHCPv6ClientInfoList</b>,
and <b>DHCPv6Scope.DHCPv6ScopeOptionList</b> objects as empty lists. Add this <b>DHCPv6Scope</b>
object to <b>DHCPv6ScopeList</b> in sorted order of the <b>SubnetAddress</b>
field of the <b>DHCPv6Scope.SubnetInfoV6</b> object. </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 <span><a href="../ms-rpce/290c38b1-92fe-4229-91e6-4fc376610c15" data-linktype="relative-path">[MS-RPCE]</a></span>.</p></div>