DhcpGetOptionValue function (dhcpsapi.h)

The DhcpGetOptionValue function retrieves a DHCP option value (the option code and associated data) for a particular scope.

Syntax

DWORD DHCP_API_FUNCTION DhcpGetOptionValue(
  DHCP_CONST WCHAR                  *ServerIpAddress,
  DHCP_OPTION_ID                    OptionID,
  DHCP_CONST DHCP_OPTION_SCOPE_INFO *ScopeInfo,
  LPDHCP_OPTION_VALUE               *OptionValue
);

Parameters

ServerIpAddress

Unicode string that specifies the IP address or hostname of the DHCP server.

OptionID

DHCP_OPTION_ID value that specifies the code for the option value to retrieve.

ScopeInfo

DHCP_OPTION_SCOPE_INFO structure that contains information on the scope where the option value is set.

OptionValue

DHCP_OPTION_VALUE structure that contains the returned option code and data.

Note  

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.

Remarks

This function requires host byte ordering for all DHCP_IP_ADDRESS values in parameter structures.

Requirements

   
Minimum supported client None supported
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header dhcpsapi.h
Library Dhcpsapi.lib
DLL Dhcpsapi.dll

See also

DHCP_OPTION_VALUE