Windows Dev Center

Collapse the table of content
Expand the table of content
Expand Minimize

DhcpHlprCreateV4Policy function

The DhcpHlprCreateV4Policy function allocates and initializes a DHCP server policy structure.

Syntax


DWORD DHCP_API_FUNCTION DhcpHlprCreateV4Policy(
  _In_  LPWSTR              PolicyName,
  _In_  BOOL                fGlobalPolicy,
  _In_  DHCP_IP_ADDRESS     Subnet,
  _In_  DWORD               ProcessingOrder,
  _In_  DHCP_POL_LOGIC_OPER RootOperator,
  _In_  LPWSTR              Description,
  _In_  BOOL                Enabled,
  _Out_ LPDHCP_POLICY       *Policy
);

Parameters

PolicyName [in]

A null-terminated unicode string that contains the name of the DHCP server policy to create.

fGlobalPolicy [in]

If TRUE a server level policy is created. Otherwise, a scope level policy is created

Subnet [in]

DHCP_IP_ADDRESS structure that contains the IPv4 subnet address of the scope level policy to create.

ProcessingOrder [in]

Integer that specifies the processing order of the DHCP server policy. 1 indicates the highest priority and MAX_DWORD indicates the lowest.

RootOperator [in]

DHCP_POL_LOGIC_OPER enumeration that defines how the policy condition is to be evaluated in terms of the results of its constituents.

Description [in]

A pointer to a null-terminated Unicode string that contains the description of the DHCP server policy.

Enabled [in]

TRUE if the policy is enabled. Otherwise, it is FALSE.

Policy [out]

Pointer to a DHCP_POLICY structure that contains the parameters of the policy to create.

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.

 

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
DhcpHlprFreeV4Policy
DhcpHlprIsV4PolicySingleUC
DhcpHlprIsV4PolicyValid
DhcpHlprIsV4PolicyWellFormed
DhcpHlprModifyV4PolicyExpr
DhcpHlprResetV4PolicyExpr

 

 

Community Additions

ADD
Show:
© 2015 Microsoft