<div class="content"><p> </p><p>The <b>R_DhcpV4GetClientInfo</b> method retrieves DHCPv4
client lease record information from the DHCPv4 server database. The
information also includes the link-layer filter status information for the
DHCPv4 client and the policy, if any, that resulted in the specific IPv4
address assignment. The caller of this function can free the memory pointed to
by the <i>ClientInfo</i> parameter 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_DhcpV4GetClientInfo(
   [in, unique, string] DHCP_SRV_HANDLE ServerIpAddress,
   [in, ref] LPDHCP_SEARCH_INFO SearchInfo,
   [out] LPDHCP_CLIENT_INFO_PB* ClientInfo
 );
</pre></div>
</dd></dl><p><b>ServerIpAddress: </b>The IP address of the DHCP
server. This parameter is unused.</p><p><b>SearchInfo: </b>A pointer to a type <span><a href="f8ab6a93-be31-4643-b32c-e0ae6ba95a44" data-linktype="relative-path">DHCP_SEARCH_INFO (section 2.2.1.2.18)</a></span>
structure that contains the key to be used to search for the DHCPv4 client
lease record on the DHCPv4 server. If this parameter&#39;s <b>SearchType</b> member
is set to DhcpClientName and there are multiple lease records with the same <b>ClientName</b>
member, the server returns client information for the client having the lowest
numerical IP address.</p><p><b>ClientInfo: </b>A pointer of type <span><a href="6ac8d531-84bb-4e8c-8010-840c41fd72e8" data-linktype="relative-path">LPDHCP_CLIENT_INFO_PB</a></span>
that points to the location where the DHCPv4 client lease record information
will be returned. The caller SHOULD free this buffer. The structure&#39;s <b>ClientHardwareAddress</b>
member represents a DHCPv4 client unique-identifier as specified in section <span><a href="651865ec-6404-4191-ad30-113578a94556" data-linktype="relative-path">2.2.1.2.5.2</a></span>.</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 completed successfully.</p>
  </td>
 </tr><tr>
  <td>
  <p>0x00004E30</p>
  <p>ERROR_DHCP_INVALID_CLIENT</p>
  </td>
  <td>
  <p>The specified DHCP client is not valid.</p>
  </td>
 </tr></tbody></table>
</dd></dl><p>The opnum field value for this method is 123.</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 the <i>SearchInfo</i> or <i>ClientInfo</i>
parameter is NULL.</p>
</li><li><p><span><span> 
</span></span>If the <b>SearchType</b> member of the <i>SearchInfo</i>
parameter is set to DhcpClientName and the <b>ClientName</b> member of the <i>SearchInfo</i>
parameter is NULL, return ERROR_INVALID_PARAMETER.</p>
</li><li><p><span><span> 
</span></span>Validate whether this method is authorized for read access as
specified in 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>Iterate through the <b>DHCPv4ClientsList</b> ADM element of all
the <b>DHCPv4Scope</b> ADM element entries in the server <b>DHCPv4ScopesList</b>
ADM element, and retrieve the <b>DHCPv4Client</b> ADM element entry
corresponding to the <b>ClientIpAddress</b>, <b>ClientHardwareAddress</b>, or <b>ClientName</b>
member of the <i>SearchInfo</i> parameter as specified by the <b>SearchType</b>
member in the <i>SearchInfo</i> parameter. If the <b>DHCPv4Client</b> entry is
not found, return ERROR_DHCP_INVALID_DHCP_CLIENT.</p>
</li><li><p><span><span> 
</span></span>Copy the information from the <b>DHCPv4Client</b> entry to the <i>ClientInfo</i>
parameter. The <b>HostName</b> member in the <span><a href="51e16f4a-cb1d-400a-85c7-defe4cba1609" data-linktype="relative-path">DHCP_HOST_INFO</a></span>
structure is unused.</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>