DhcpGetOptionInfoV5 function (dhcpsapi.h)
The DhcpGetOptionInfoV5 function returns information on a specific DHCP option.
Syntax
DWORD DhcpGetOptionInfoV5(
[in] LPWSTR ServerIpAddress,
[in] DWORD Flags,
[in] DHCP_OPTION_ID OptionID,
[in] LPWSTR ClassName,
[in] LPWSTR VendorName,
[out] LPDHCP_OPTION *OptionInfo
);
Parameters
[in] ServerIpAddress
Unicode string that specifies the IP address or hostname of the DHCP server.
[in] Flags
Specifies a bit flag that indicates whether or not the option is vendor-specific. If it is not, this parameter should be 0.
[in] OptionID
DHCP_OPTION_ID value that specifies the code for the option to retrieve information on.
[in] ClassName
Unicode string that specifies the DHCP class name of the option. This parameter is optional.
[in] VendorName
Unicode string that specifies the vendor of the option. This parameter is optional, and must be null when Flags is not set to DHCP_FLAGS_OPTION_IS_VENDOR. If it is not set, then the option definition for the default vendor class is returned.
[out] OptionInfo
Pointer to a DHCP_OPTION structure that contains the returned information on the option specified by OptionID.
The memory for this parameter must be free using DhcpRpcFreeMemory.
Return value
This function returns ERROR_SUCCESS upon a successful call. Otherwise, it returns one of the DHCP Server Management API Error Codes.
Return code | Description |
---|---|
|
This call was performed by a client who is not a member of the "DHCP Administrators" security group. |
|
An error occurred while accessing the DHCP server's database. |
|
The specified IPv4 subnet is not defined on the DHCP server. |
|
The specified option definition does not exist in the DHCP server database. |
|
The specified DHCP client is not a reserved client. o |
Requirements
Requirement | Value |
---|---|
Minimum supported client | None supported |
Minimum supported server | Windows Server 2008 R2 [desktop apps only] |
Target Platform | Windows |
Header | dhcpsapi.h |
Library | Dhcpsapi.lib |
DLL | Dhcpsapi.dll |