<div class="content" name="R_DhcpV6GetStatelessStatistics" uuid="0103e640-eb83-40c1-886e-4a78709a0e88"><p>The <b>R_DhcpV6GetStatelessStatistics</b> method is used to
retrieve the statistics of the DHCPv6 stateless server. The caller of this
function can free the memory pointed to by the <i>StatelessStats</i> parameter
and its <b>ScopeStats</b> member array by calling the function <b>midl_user_free</b>
(section <a href="a7e5f2d1-04b7-4363-bdc0-76a1099664eb" data-linktype="relative-path">3</a>).</p><dl>
<dd>
<div><pre> DWORD R_DhcpV6GetStatelessStatistics(
   [in, unique, string] DHCP_SRV_HANDLE ServerIpAddress,
   [out] LPDHCPV6_STATELESS_STATS *StatelessStats
 );
</pre></div>
</dd></dl><p><b>ServerIpAddress: </b>The IP address of the DHCP
server. This parameter is unused.</p><p><b>StatelessStats: </b>A pointer of type <b>LPDHCPV6_STATELESS_STATS</b>
in which this method will place the DHCPv6 stateless server statistics.</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 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>0x00000000 ERROR_SUCCESS</td>
  <td>The call completed successfully.</td>
 </tr></tbody></table>
</dd></dl><p>The opnum field value for this method is 118.</p><p>When processing this call, the DHCP server MUST do the
following:</p><ul><li><p><span><span> 
</span></span>If the <i>StatelessStats</i> parameter is a null pointer, return
ERROR_INVALID_PARAMETER.</p>
</li><li><p><span><span> 
</span></span>Validate that 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 it is not authorized, return ERROR_ACCESS_DENIED.</p>
</li><li><p><span><span> 
</span></span>Allocate memory equal to the size of a <b>DHCPV6_STATELESS_STATS</b>
structure, and store the address of that memory in the location pointed to by
the <i>StatelessStats</i> parameter.</p>
</li><li><p><span><span> 
</span></span>Retrieve all the statistics stored in the <b>DHCPv6ServerStatelessStatistics</b>
ADM element.</p>
</li><li><p><span><span> 
</span></span>Allocate memory for the <b>ScopeStats</b> member of the <b>DHCPV6_STATELESS_STATS</b>
structure. Allocate an amount of memory sufficient to hold the number of
entries in the <b>DHCPv6ServerStatelessStatistics</b> ADM element.</p>
</li><li><p><span><span> 
</span></span>Copy the contents of the <b>DHCPv6ServerStatelessStatistics</b>
ADM element to the corresponding fields of the <b>DHCPV6_STATELESS_STATS</b>
structure.</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>