The method R_DhcpV4EnumPolicies returns an enumerated list of all configured server level policies or scope level policies. The caller of this function can free the memory pointed to by the EnumInfo parameter by calling the function midl_user_free (section 3).

 DWORD R_DhcpV4EnumPolicies(
   [in, unique, string] DHCP_SRV_HANDLE ServerIpAddress,
   [in, out] LPDWORD ResumeHandle,
   [in] DWORD PreferredMaximum,
   [in] BOOL ServerPolicy,
   [in] DHCP_IP_ADDRESS SubnetAddress,
   [out] LPDHCP_POLICY_ARRAY EnumInfo,
   [out] DWORD* ElementsRead,
   [out] DWORD* ElementsTotal
 );

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

ResumeHandle: This is a pointer of type DWORD (see DHCP_RESUME_HANDLE data type, section 2.2.1.2.6) that identifies the enumeration operation. Initially, this value MUST be set to zero, with a successful call returning the handle value used for subsequent enumeration requests.

PreferredMaximum: This is of type DWORD specifying the preferred maximum number of policies to be returned. If the number of remaining unenumerated policies is less than the value of this parameter, then all the policies for the DHCPv4 server or for the specific subnet are returned. To retrieve all the policies on the DHCPv4 server or the specific subnet, 0xFFFFFFFF SHOULD be specified.

ServerPolicy: This is of type BOOL and indicates whether the server level policy or scope level policy is being requested.

SubnetAddress: This is of type DHCP_IP_ADDRESS data type (section 2.2.1.2.1) and identifies the IPv4 subnet from which the policy is being requested.

EnumInfo: This is a pointer of type LPDHCP_POLICY_ARRAY (section 2.2.1.2.111) in which policy information is retrieved.

ElementsRead: This is a pointer to a DWORD value that specifies the number of policies returned in the EnumInfo parameter. The caller MUST allocate memory for this parameter that is equal to the size of the DWORD data type.

ElementsTotal: This is a pointer to a DWORD value that specifies the number of policies that have not yet been enumerated. The caller MUST allocate memory for this parameter that is equal to the size of the DWORD data type.

Return Values: A 32-bit unsigned integer value that indicates return status. A return value of ERROR_SUCCESS (0x00000000) indicates that the 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.

0x000000EA

ERROR_MORE_DATA

There are more elements available to enumerate.

0x00000103

ERROR_NO_MORE_ITEMS

There are no more elements left to enumerate.

The opnum field value for this method is 112.

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 [MS-RPCE].