<div class="content"><p> </p><p>The <b>R_DhcpGetOptionInfo</b> method retrieves the <span><a href="a9d6a415-4de6-4058-befe-ca2e42764485#gt_da9bfcf7-a7e0-4cf0-ac87-ffdd83a5f25b" data-linktype="relative-path">option
definition</a></span> of the specified option for the default <span><a href="a9d6a415-4de6-4058-befe-ca2e42764485#gt_713c7395-9431-4d67-bab1-a069ae7461e2" data-linktype="relative-path">user
class</a></span> and <span><a href="a9d6a415-4de6-4058-befe-ca2e42764485#gt_45d20b00-7166-4f94-b679-4cc5a7835a3a" data-linktype="relative-path">vendor class</a></span> pair at
the default option level. There is an extension method <span><a href="d282dfcd-ead8-4303-a1ad-c7fdd9c8c017" data-linktype="relative-path">R_DhcpGetOptionInfoV5 (section 3.2.4.17)</a></span>
that retrieves the option definition for a specific user class and vendor class
pair. The caller of this function can free the memory pointed to by the <i>OptionInfo</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_DhcpGetOptionInfo(
   [in, unique, string] DHCP_SRV_HANDLE ServerIpAddress,
   [in] DHCP_OPTION_ID OptionID,
   [out] LPDHCP_OPTION* OptionInfo
 );
</pre></div>
</dd></dl><p><b>ServerIpAddress: </b>The IP address/host name of
the DHCP server. This parameter is unused. </p><p><b>OptionID: </b>This is of type <span><a href="4a0bb785-ceec-4f7a-b4a7-64555f6e0b62" data-linktype="relative-path">DHCP_OPTION_ID (section 2.2.1.2.3)</a></span>,
containing the option identifier for the option being retrieved.</p><p><b>OptionInfo: </b>This is a pointer of type <span><a href="855b6a9a-e6e4-4c9d-a732-aadad749ca03" data-linktype="relative-path">LPDHCP_OPTION</a></span>.</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>0x00004E2A</p>
  <p>ERROR_DHCP_OPTION_NOT_PRESENT</p>
  </td>
  <td>
  <p>The specified option definition does not exist on the
  DHCP server database.</p>
  </td>
 </tr></tbody></table>
</dd></dl><p>The opnum field value for this method is 10.</p><p>When processing this call, the DHCP server MUST do the
following:</p><ul><li><p><span><span> 
</span></span>Validate whether 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 the error ERROR_ACCESS_DENIED.</p>
</li><li><p><span><span> 
</span></span>Iterate though the server Abstract Data Model (ADM) element <b>DHCPv4OptionDefList</b>,
and retrieve the <b>DHCPv4ClassedOptDefList</b> ADM element corresponding to
the <b>DHCPv4OptionDef</b> ADM element entry whose <b>UserClass</b> and <b>VendorClass</b>
ADM element fields are NULL. If there is no <b>DHCPv4OptionDef</b> ADM element
entry whose <b>UserClass</b> and <b>VendorClass</b> fields are NULL, return
ERROR_DHCP_CLASS_NOT_FOUND.</p>
</li><li><p><span><span> 
</span></span>Iterate through the <b>DHCPv4ClassedOptDefList</b> ADM element;
if there is no <b>DHCPv4ClassedOptDef</b> ADM element entry corresponding to
the <i>OptionID</i> parameter, return ERROR_DHCP_OPTION_NOT_PRESENT.</p>
</li><li><p><span><span> 
</span></span>Allocate memory to <i>OptionInfo</i> that is equal to the size of
the data type DHCP_OPTION and to its members as needed by the data in the <b>DHCPv4ClassedOptDef</b>
object. Copy the information in the <b>DHCPv4ClassedOptDef</b> ADM element to
the <i>OptionInfo</i> parameter structure, and return ERROR_SUCCESS to the
caller.</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>