The R_DhcpV4QueryPolicyEnforcement method is used to retrieve the state (enabled/disabled) of policy enforcement on the server or the specified IPv4 subnet.

 DWORD R_DhcpV4QueryPolicyEnforcement(
   [in, unique, string] DHCP_SRV_HANDLE ServerIpAddress,
   [in] BOOL ServerPolicy,
   [in] DHCP_IP_ADDRESS SubnetAddress,
   [out] BOOL* Enabled
 );

ServerIpAddress: The IP address/host name of the DHCP server. This parameter is unused.

ServerPolicy: This Boolean type indicates if the policy enforcement state of the server can be returned.

SubnetAddress: This is of type DHCP_IP_ADDRESS (section 2.2.1.2.1), which contains the IPv4 subnet ID for which the policy enforcement state can be returned. This parameter is ignored if ServerPolicy parameter is TRUE.

Enabled: This out parameter is a pointer to a Boolean type and indicates the state of policy enforcement. The memory for this must be allocated by the caller.

Return Values: A 32-bit unsigned integer value that indicates return status. A return value ERROR_SUCCESS (0x00000000) indicates operation was completed successfully. Otherwise, it contains a Win32 error code, as specified in [MS-ERREF]. This error code value can correspond to a DHCP specific failure, which takes a value between 20000 and 20099, or any generic failure.

Return value/code

Description

0x00000000

ERROR_SUCCESS

The call was successful.

0x00004E25

ERROR_DHCP_SUBNET_NOT_PRESENT

The specified IPv4 subnet does not exist.

The opnum field value for this method is 106.

When processing this call, the DHCP server MUST do the following:

Exceptions Thrown: No exceptions are thrown beyond those thrown by the underlying RPC protocol specified in [MS-RPCE].