Expand Minimize

DhcpHlprIsV4PolicyValid function

The DhcpHlprIsV4PolicyValid function verifies a DHCP server policy.

Syntax


DWORD DHCP_API_FUNCTION DhcpHlprIsV4PolicyValid(
  _In_  LPDHCP_POLICY pPolicy
);

Parameters

pPolicy [in]

Pointer to DHCP_POLICY structure that contains the policy to verify.

Return value

If the function succeeds, it returns ERROR_SUCCESS.

If the function fails, it returns one of the following or an error code from DHCP Server Management API Error Codes.

ValueMeaning
ERROR_DHCP_SUBNET_NOT_PRESENT

The specified IPv4 subnet does not exist.

ERROR_INVALID_PARAMETER

The parameter was invalid.

ERROR_DHCP_INVALID_POLICY_EXPRESSION

The specified conditions or expressions of the policy are invalid.

ERROR_DHCP_RANGE_INVALID_IN_SERVER_POLICY

A policy range has been specified for a server level policy.

ERROR_DHCP_POLICY_RANGE_BAD

The specified policy range is not contained within the IP address range of the scope or the specified policy range is invalid.

 

Remarks

The API performs the following validations on the policy structure.

  1. The policy must be well formed.
  2. Server policies must not have any ranges.
  3. Server policies must have the subnet address set to 0.0.0.0.
  4. Scope policies must have a subnet address.
  5. All associated ranges must be valid and non-overlapping.
  6. For all expressions, the parent expression index must be set to 0.

Requirements

Minimum supported client

None supported

Minimum supported server

Windows Server 2012 [desktop apps only]

Header

Dhcpsapi.h

Library

Dhcpsapi.lib

DLL

Dhcpsapi.dll

See also

DhcpHlprAddV4PolicyCondition
DhcpHlprAddV4PolicyExpr
DhcpHlprAddV4PolicyRange
DhcpHlprCreateV4Policy
DhcpHlprFreeV4Policy
DhcpHlprIsV4PolicySingleUC
DhcpHlprIsV4PolicyWellFormed
DhcpHlprResetV4PolicyExpr
DhcpHlprModifyV4PolicyExpr

 

 

Community Additions

ADD
Show:
© 2015 Microsoft