Expand Minimize

DhcpHlprAddV4PolicyCondition function

The DhcpHlprAddV4PolicyCondition function allocates, initializes, and adds a DHCP server policy condition to a DHCP server policy.

Syntax


DWORD DHCP_API_FUNCTION DhcpHlprAddV4PolicyCondition(
  _Inout_  LPDHCP_POLICY Policy,
  _In_     DWORD ParentExpr,
  _In_     DHCP_POL_ATTR_TYPE Type,
  _In_     DWORD OptionID,
  _In_     DWORD SubOptionID,
  _In_     LPWSTR VendorName,
  _In_     DHCP_POL_COMPARATOR Operator,
  __in_reads_bytes (ValueLength) LPBYTE Value,
  _In_     DWORD ValueLength,
  _Out_    DWORD *ConditionIndex
);

Parameters

Policy [in, out]

Pointer to a DHCP_POLICY structure that contains the policy to modify.

ParentExpr [in]

Integer that specifies the expression index that corresponds to this constituent condition.

Type [in]

DHCP_POL_ATTR_TYPE enumeration that specifies the attribute type for this condition.

OptionID [in]

DHCP_OPTION_ID value that specifies the unique option identifier for criteria based on DHCP options or sub-options.

SubOptionID [in]

DHCP_OPTION_ID value that specifies the unique sub-option identifier for criteria based on DHCP sub-options.

VendorName [in]

A pointer to a null-terminated Unicode string that represents the vendor name.

Operator [in]

DHCP_POL_COMPARATOR enumeration that specifies the comparison operator for the condition.

Value

Pointer to an array of bytes that contains the value to be used for the comparison.

ValueLength [in]

Integer that specifies the length of Value.

ConditionIndex [out]

Pointer to a DWORD that contains the newly created condition's index in the DHCP server policy.

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_INVALID_PARAMETER

One or more of the parameters were invalid.

ERROR_NOT_ENOUGH_MEMORY

Not enough memory available.

ERROR_DHCP_POLICY_BAD_PARENT_EXPR

The parent expression specified does not exist.

 

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

DhcpHlprAddV4PolicyExpr
DhcpHlprAddV4PolicyRange
DhcpHlprCreateV4Policy
DhcpHlprFreeV4Policy
DhcpHlprIsV4PolicySingleUC
DhcpHlprIsV4PolicyValid
DhcpHlprIsV4PolicyWellFormed
DhcpHlprModifyV4PolicyExpr
DhcpHlprResetV4PolicyExpr

 

 

Community Additions

ADD
Show:
© 2014 Microsoft