DhcpSetOptionValueV5 function (dhcpsapi.h)

The DhcpSetOptionValueV5 function sets information for a specific option value on the DHCP server. This function extends the functionality provided by DhcpSetOptionValue by allowing the caller to specify a class and/or vendor for the option.

Syntax

DWORD DhcpSetOptionValueV5(
  [in]           LPWSTR                   ServerIpAddress,
  [in]           DWORD                    Flags,
  [in]           DHCP_OPTION_ID           OptionId,
  [in, optional] LPWSTR                   ClassName,
  [in, optional] LPWSTR                   VendorName,
  [in]           LPDHCP_OPTION_SCOPE_INFO ScopeInfo,
  [in]           LPDHCP_OPTION_DATA       OptionValue
);

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.

Value Meaning
DHCP_FLAGS_OPTION_IS_VENDOR
This flag should be set if the option is provided by a vendor.

[in] OptionId

DHCP_OPTION_ID value that contains the unique option ID number (also called an "option code") of the option being set. Many of these option ID numbers are defined; a complete list of standard DHCP and BOOTP option codes can be found at http://www.ietf.org/rfc/rfc2132.txt.

[in, optional] ClassName

Unicode string that specifies the DHCP class of the option. This parameter is optional.

[in, optional] VendorName

Unicode string that specifies the vendor of the option. This parameter is optional, and should be NULL when Flags is not set to DHCP_FLAGS_OPTION_IS_VENDOR.

[in] ScopeInfo

Pointer to a DHCP_OPTION_SCOPE_INFO structure that contains information describing the DHCP scope this option value will be set on.

[in] OptionValue

Pointer to a DHCP_OPTION_DATA structure that contains the data value corresponding to the DHCP option code specified by OptionID.

Return value

This function returns ERROR_SUCCESS upon a successful call. Otherwise, it returns one of the DHCP Server Management API Error Codes.

Requirements

Requirement Value
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_DATA

DHCP_OPTION_SCOPE_INFO

DhcpV4SetOptionValue