3.2.4.129 R_DhcpV4SetPolicyEx (Opnum 128)

The R_DhcpV4SetPolicyEx method modifies the specified policy.

The method is an extension of the R_DhcpV4SetPolicy (Opnum 110) (section 3.2.4.111) method, where the method specifies a DHCP_POLICY_EX (section 2.2.1.2.121) structure rather than a DHCP_POLICY (section 2.2.1.2.110) structure. The structure contains a list of DHCP_PROPERTY (section 2.2.1.2.117) elements that can be updated for the policy.

 DWORD R_DhcpV4SetPolicyEx(
   [in, unique, string] DHCP_SRV_HANDLE ServerIpAddress,
   [in] DWORD FieldsModified,
   [in] BOOL ServerPolicy,
   [in] DHCP_IP_ADDRESS SubnetAddress,
   [in, unique, string] LPWSTR PolicyName,
   [in] LPDHCP_POLICY_EX Policy
 );

ServerIpAddress: As specified in R_DhcpV4SetPolicy (Opnum 110).

FieldsModified: As specified in R_DhcpV4SetPolicy (Opnum 110).

ServerPolicy: As specified in R_DhcpV4SetPolicy (Opnum 110).

SubnetAddress: As specified in R_DhcpV4SetPolicy (Opnum 110).

PolicyName: As specified in R_DhcpV4SetPolicy (Opnum 110).

Policy: This is a pointer to a DHCP_POLICY_EX structure and contains the policy data to be modified. The DHCP_PROPERTY elements that are modified are as follows:

DNSSuffix: Specifies the DNSSuffix for the policy when the DHCP_PROPERTY_ID (section 2.2.1.1.27) is DhcpPropIdPolicyDnsSuffix and the value of the DHCP_PROPERTY_TYPE (section 2.2.1.1.26) is DhcpPropTypeString.

Return Values: As specified in R_DhcpV4SetPolicy (Opnum 110).

The opnum field value for this method is 128.

The remainder of the processing behavior for this method is as defined for the R_DhcpV4SetPolicy (Opnum 110) method, except as follows:

  • The FieldsModified parameter can also be set to the DhcpUpdatePolicyDnsSuffix value of the DHCP_POLICY_FIELDS_TO_UPDATE (section 2.2.1.1.21) enumeration.

  • If the FieldsModified parameter is set to DhcpUpdatePolicyDnsSuffix, the R_DhcpV4SetPolicyEx method searches for the property with an ID value of DhcpPropIdPolicyDnsSuffix and Type value of DhcpPropTypeString. If such a property is located, the R_DhcpV4SetPolicyEx method validates that the string length of the property value does not exceed 255 characters. If the length is exceeded, the R_DhcpV4SetPolicyEx method returns ERROR_INVALID_PARAMETER.

  • The R_DhcpV4SetPolicyEx method updates the server or scope level <DHCPv4Policy> ADM element retrieved earlier according to the following:

    In addition to steps 1 through 5 specified in R_DhcpV4SetPolicy (Opnum 110), the R_DhcpV4SetPolicyEx method adds the following instruction:

    • If the DhcpUpdatePolicyDnsSuffix enumeration value is set in the FieldsModified parameter, update the DNSSuffix of the policy in the <DHCPv4Policy.DnsSuffix> ADM element. If no such property exists in the list of properties with an ID value equal to DhcpPropIdPolicyDnsSuffix and a Type value equal to DhcpPropTypeString, or if the StringValue of the property is NULL or of zero length, then the <DHCPv4Policy.DnsSuffix> ADM element is cleared; otherwise, the ADM element is set to the StringValue of the property.

  • The FieldsModified parameter is set to any value other than DhcpUpdatePolicyName, DhcpUpdatePolicyOrder, DhcpUpdatePolicyExpr, DhcpUpdatePolicyRanges, DhcpUpdatePolicyDescr, DhcpUpdatePolicyStatus, or DhcpUpdatePolicyDnsSuffix, as defined in DHCP_POLICY_FIELDS_TO_UPDATE enumeration.

  • The R_DhcpV4SetPolicyEx method returns ERROR_INVALID_PARAMETER.