DhcpSetOptionValuesV5 function (dhcpsapi.h)
The DhcpSetOptionValuesV5 function sets option codes and their associated data values for a specific scope defined on the DHCP server. This function extends the functionality provided by DhcpSetOptionValues by allowing the caller to specify a class and/or vendor for the options.
Syntax
DWORD DhcpSetOptionValuesV5(
[in] LPWSTR ServerIpAddress,
[in] DWORD Flags,
[in] LPWSTR ClassName,
[in] LPWSTR VendorName,
[in] LPDHCP_OPTION_SCOPE_INFO ScopeInfo,
[in] LPDHCP_OPTION_VALUE_ARRAY OptionValues
);
Parameters
[in] ServerIpAddress
Unicode string that specifies the IPv4 address of the DHCP server.
[in] Flags
This parameter must be set to 0 and ignored upon receipt.
[in] ClassName
Unicode string that specifies the DHCP class of the options. This parameter is optional.
[in] VendorName
Unicode string that specifies the vendor of the options. If no vendor class is specified, then the option value is set for the default vendor class. This parameter is optional.
[in] ScopeInfo
Pointer to a DHCP_OPTION_SCOPE_INFO structure that contains information describing the DHCP scope these option values will be set on. This parameter indicates whether the option value is set for the default, server, or scope level, or for an IPv4 reservation.
[in] OptionValues
Pointer to a DHCP_OPTION_VALUE_ARRAY structure that contains a list of option codes and the corresponding data value that will be set for them.
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 |
---|---|
|
An error occurred while accessing the DHCP server database. |
|
The specified IPv4 subnet does not exist on the DHCP server. |
|
The specified option definition could not be found in the DHCP server database. |
|
The specified DHCP client is not an IPv4 reserved client. |
|
The specified class name cannot be found in the DHCP server database. |
Remarks
The caller of this function must release the memory pointed to by OptionValues after the call completes.
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 |