<div class="content"><p> </p><p>The <b>R_DhcpEnumSubnetClientsV6</b> method is used to
retrieve all DHCPv6 clients serviced from the specified IPv6 prefix. The caller
of this function can free the memory pointed to by <i>ClientInfo</i> and other
Elements by calling the function <b>midl_user_free</b> (section <span><a href="a7e5f2d1-04b7-4363-bdc0-76a1099664eb" data-linktype="relative-path">3</a></span>).</p><dl>
<dd>
<div><pre> DWORD R_DhcpEnumSubnetClientsV6(
   [in, unique, string] DHCP_SRV_HANDLE ServerIpAddress,
   [in] DHCP_IPV6_ADDRESS SubnetAddress,
   [in, out] DHCP_RESUME_IPV6_HANDLE* ResumeHandle,
   [in] DWORD PreferredMaximum,
   [out] LPDHCP_CLIENT_INFO_ARRAY_V6* ClientInfo,
   [out] DWORD* ClientsRead,
   [out] DWORD* ClientsTotal
 );
</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>This is 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>,
containing the IPv6 prefix ID from which DHCPv6 clients are enumerated.</p><p><b>ResumeHandle: </b>This is a pointer of type <span><a href="5529c4ec-688c-431c-abe2-8e5a1d76ffff" data-linktype="relative-path">DHCP_RESUME_IPV6_HANDLE (section 2.2.1.1.14)</a></span>
that identifies the enumeration operation. Initially, this value MUST be set to
zero, with a successful call returning the handle value used for subsequent
enumeration requests. This field contains the last IPv6 address retrieved from
the DHCPv6 client.</p><p><b>PreferredMaximum: </b>This is of type <span><a href="../ms-dtyp/262627d8-3418-4627-9218-4ffe110850b2" data-linktype="relative-path">DWORD</a></span>,
specifying the preferred maximum number of bytes to return. The minimum value
is 1,024 bytes (1 kilobyte), and the maximum value is 65,536 bytes (64
kilobytes); if the input value is greater or less than this range, it MUST be
set to the maximum or minimum value, respectively. To retrieve all the DHCPv6
clients serviced by a specific IPv6 prefix, 0xFFFFFFFF is specified.</p><p><b>ClientInfo: </b>This is a pointer of type <span><a href="da634b20-9854-467d-b5c8-b6d22d36e2ab" data-linktype="relative-path">LPDHCP_CLIENT_INFO_ARRAY_V6</a></span>
that points to the location that contains the DHCPv6 client lease record array.</p><p><b>ClientsRead: </b>This is a pointer to a DWORD that
specifies the number of DHCPv6 client lease records read in <i>ClientInfo</i>.
The caller MUST allocate memory for this parameter equal to the size of data
type DWORD.</p><p><b>ClientsTotal: </b>This is a pointer to a DWORD
that specifies the number of DHCPv6 client lease records remaining from the
current position. For example, if there are 100 DHCPv6 lease record clients for
an IPv6 prefix and if 10 DHCPv6 lease records are enumerated per call, then for
the first time this would have a value of 90.<a id="Appendix_A_Target_66"></a><a aria-label="Product behavior note 66" href="afab0546-79ae-4764-8dab-27a85cca5145#Appendix_A_66" data-linktype="relative-path">&lt;66&gt;</a> The
caller MUST allocate memory for this parameter equal to the size of data type
DWORD.</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>0x000000EA</p>
  <p>ERROR_MORE_DATA</p>
  </td>
  <td>
  <p>There are more elements available to enumerate.</p>
  </td>
 </tr><tr>
  <td>
  <p>0x00000103</p>
  <p>ERROR_NO_MORE_ITEMS</p>
  </td>
  <td>
  <p>There are no more elements left to enumerate.</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></tbody></table>
</dd></dl><p>The opnum field value for this method is 64.</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 access per section
<span><a href="baec2112-1146-4c42-b77e-b706e170a590" data-linktype="relative-path">3.5.4</a></span>.
If not, return ERROR_ACCESS_DENIED. </p>
</li><li><p><span><span> 
</span></span>If the <i>ResumeHandle</i> parameter points to 0x00000000, the
enumeration MUST start from the beginning of <b>DHCPv6ClientInfoList</b>.</p>
</li><li><p><span><span> 
</span></span>If the <i>ResumeHandle</i> parameter points to a nonzero value,
the server MUST continue enumeration based on the value of <i>ResumeHandle</i>.
If the value of <i>ResumeHandle</i> parameter does not match any <b>DHCPv6ClientInfo</b>
object in <b>DHCPv6ClientInfoList</b>, the server returns ERROR_FILE_NOT_FOUND.
If the value of <i>ResumeHandle</i> parameter does match a <b>DHCPv6ClientInfo</b>
object in <b>DHCPv6ClientInfoList</b>, and there are no more <b>DHCPv6ClientInfo</b>
objects in <b>DHCPv6Scope.DHCPv6ClientInfoList</b> with a value greater than <i>ResumeHandle</i>
parameter, then return ERROR_NO_MORE_ITEMS.<a id="Appendix_A_Target_67"></a><a aria-label="Product behavior note 67" href="afab0546-79ae-4764-8dab-27a85cca5145#Appendix_A_67" data-linktype="relative-path">&lt;67&gt;</a> If there
are other <b>DHCPv6ClientInfo</b> objects with an IPv6 address greater than the
value of <i>ResumeHandle</i> parameter, but the <b>DHCPv6Scope</b> object does
not match the <i>SubnetAddress</i> parameter, return ERROR_SUCCESS.</p>
</li><li><p><span><span> 
</span></span>The <i>PreferredMaximum</i> parameter specifies the maximum
number of bytes that the server can allocate and return to the caller
containing the data related to the <b>DHCPv6ClientInfo</b> objects. In case the
<i>PreferredMaximum</i> parameter is 0xFFFFFFFF, the server must allocate
memory for all remaining <b>DHCPv6ClientInfo</b> objects.</p>
</li><li><p><span><span> 
</span></span>If the <i>PreferredMaximum</i> parameter is less than 1024, it is
assigned 1024, and if the <i>PreferredMaximum</i> parameter is greater than
65536, it is assigned 65536.</p>
</li><li><p><span><span> 
</span></span>Allocate memory for the <i>PreferredMaximum</i> parameter number
of bytes.</p>
</li><li><p><span><span> 
</span></span>The actual number of records that corresponds to a specific <i>PreferredMaximum</i>
value can be determined only at runtime.</p>
</li><li><p><span><span> 
</span></span>Retrieve the <b>DHCPv6ClientInfo</b> object from <b>DHCPv6ClientInfoList</b>.
Copy this DHCPv6 client <span><a href="a9d6a415-4de6-4058-befe-ca2e42764485#gt_e6d76b31-2852-4bd5-8fbb-8e82a3cedb29" data-linktype="relative-path">lease record</a></span> in the
allocated memory, and then continue to the next <b>DHCPv6ClientInfo</b> object.</p>
</li><li><p><span><span> 
</span></span>If the retrieve operation has reached the maximum <b>DHCPv6ClientInfo</b>
objects that can be accommodated in the <i>PreferredMaximum</i> parameter, and
there are still more <b>DHCPv6ClientInfo</b> objects in <b>DHCPv6ClientInfoList</b>,
update <b>ClientsTotal</b> to the number of <b>DHCPv6ClientInfo</b> objects
that are not yet enumerated, and update <b>ClientsRead</b> to the number of
DHCPv6 client lease records that are enumerated in this retrieve operation.
Update the <i>ResumeHandle</i> parameter to the IPv6 address of the last <b>DHCPv6ClientInfo</b>
object read, and return ERROR_MORE_DATA.</p>
</li><li><p><span><span> 
</span></span>If the allocated memory is more than the number of <b>DHCPv6ClientInfo</b>
objects remaining in <b>DHCPClientInfoList</b>, update <b>ClientsTotal</b> to
the total number of <b>DHCPv6ClientInfo</b> objects enumerated in that retrieve
operation, and update <b>ClientsRead</b> to the number of <b>DHCPv6ClientInfo</b>
objects that are enumerated in this retrieve operation. Update the <b>ResumeHandle</b>
parameter to 0, and 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>