The R_DhcpV4SetOptionValues method sets the specified option values for a policy at the specified level.

 DWORD R_DhcpV4SetOptionValues(
   [in, unique, string] DHCP_SRV_HANDLE ServerIpAddress,
   [in] DWORD Flags,
   [in, string, unique] WCHAR* PolicyName,
   [in, string, unique] WCHAR* VendorName,
   [in] LPDHCP_OPTION_SCOPE_INFO ScopeInfo,
   [in] LPDHCP_OPTION_VALUE_ARRAY OptionValues
 );

ServerIpAddress: The IP address/host name of the DHCP server. This parameter is unused.

Flags: This is of type DWORD that specifies that the option value is set for a specific or default vendor class.

Value

Meaning

DHCP_FLAGS_OPTION_DEFAULT

0x00000000

The option definition is set for the default vendor class.

DHCP_FLAGS_OPTION_IS_VENDOR

0x00000003

If a bitwise AND operation with this bitmask yields a nonzero value, it indicates that the option definition is set for a specific vendor class.

PolicyName: A pointer to a null-terminated Unicode string that contains the name of the policy inside the subnet identified by the SubnetScopeInfo member of the ScopeInfo parameter for which the option value is being set.

VendorName: A pointer to a null-terminated Unicode string that contains the name of the vendor class to which the option value is being set. This parameter is optional. If the vendor class is not specified, the option value is set for a default vendor class.

ScopeInfo: This is a pointer to a type DHCP_OPTION_SCOPE_INFO structure (section 2.2.1.2.41) that contains information describing the DHCPv4 scope for which this option value is set. This value contains the server or scope level at which the option values are set.

OptionValues: This is a pointer to a type DHCP_OPTION_VALUE_ARRAY structure (section 2.2.1.2.43) that points to the location that contains one or more option identifiers, along with the values.

Return Values: A 32-bit unsigned integer value that indicates return status. A return value of ERROR_SUCCESS (0x00000000) indicates that the operation was completed successfully. Otherwise, it contains a Win32 error code, as specified in [MS-ERREF]. This error code value can correspond to a DHCP-specific failure, which takes a value between 20000 and 20099, or to any generic failure.

Return value/code

Description

0x00000000

ERROR_SUCCESS

The call was successful.

0x00004E25

ERROR_DHCP_SUBNET_NOT_PRESENT

The specified IPv4 subnet does not exist on the DHCP server.

0x00004E2A

ERROR_DHCP_OPTION_NOT_PRESENT

The specified option definition does not exist on the DHCP server database.

0x00004E32

ERROR_DHCP_NOT_RESERVED_CLIENT

The specified DHCP client is not a reserved client.

0x00004E4C

ERROR_DHCP_CLASS_NOT_FOUND

The class name being used is unknown or incorrect.

0x00004E8FL

ERROR_DHCP_POLICY_NOT_PRESENT

The specified policy name does not exist.

0x00004EA8L

ERROR_DHCP_POLICY_FQDN_OPTION_UNSUPPORTED

The option value cannot be specified because the policy contains an FQDN-based condition.

The opnum field value for this method is 102.

When processing this call, the DHCP server MUST do the following:

Exceptions Thrown: No exceptions are thrown beyond those thrown by the underlying RPC protocol [MS-RPCE].