Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
The DhcpV4SetPolicy function updates one or more parameters of an existing policy.
Syntax
DWORD DHCP_API_FUNCTION DhcpV4SetPolicy(
[in, optional] LPWSTR ServerIpAddress,
[in] DWORD FieldsModified,
[in] BOOL fGlobalPolicy,
[in] DHCP_IP_ADDRESS SubnetAddress,
[in] LPWSTR PolicyName,
[in] LPDHCP_POLICY Policy
);
Parameters
[in, optional] ServerIpAddress
Pointer to a null-terminated Unicode string that represents the IP address or hostname of the DHCP server.
[in] FieldsModified
A value from the DHCP_POLICY_FIELDS_TO_UPDATE enumeration that defines the DHCPv4 policy fields to modify.
[in] fGlobalPolicy
If TRUE the server level policy is set. Otherwise, the scope level policy is set.
[in] SubnetAddress
DHCP_IP_ADDRESS structure that contains the IPv4 subnet address of the policy to modify.
[in] PolicyName
A null-terminated Unicode string that represents the name of the policy to modify.
[in] Policy
Pointer to a DHCP_POLICY structure that contains the parameters of the policy to modify.
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.
Value | Meaning |
---|---|
|
One or more of the parameters were invalid. |
|
The specified IPv4 subnet does not exist. |
|
A policy range has been specified for a server level policy. |
|
The specified conditions or expressions of the policy are invalid. |
|
The specified policy range is not contained within the IP address range of the scope or the specified policy range is invalid. |
|
The specified policy range overlaps with the policy ranges of an existing policy at the specified scope. |
|
The specified processing order is greater than the maximum processing order of the existing policies at the specified level (server or scope). |
|
The vendor class or user class reference in the conditions of the policy does not exist. |
Requirements
Requirement | Value |
---|---|
Minimum supported client | None supported |
Minimum supported server | Windows Server 2012 [desktop apps only] |
Target Platform | Windows |
Header | dhcpsapi.h |
Library | Dhcpsapi.lib |
DLL | Dhcpsapi.dll |