DhcpEnumFilterV4 function (dhcpsapi.h)

The DhcpEnumFilterV4 function enumerates all of the filter records from the DHCP server's allow or deny list.

Syntax

DWORD DHCP_API_FUNCTION DhcpEnumFilterV4(
  [in]      DHCP_CONST WCHAR        *ServerIpAddress,
  [in, out] LPDHCP_ADDR_PATTERN     ResumeHandle,
  [in]      DWORD                   PreferredMaximum,
  [in]      DHCP_FILTER_LIST_TYPE   ListType,
  [out]     LPDHCP_FILTER_ENUM_INFO *EnumFilterInfo,
  [out]     DWORD                   *ElementsRead,
  [out]     DWORD                   *ElementsTotal
);

Parameters

[in] ServerIpAddress

Pointer to a Unicode string that specifies the IP address or hostname of the DHCP server.

[in, out] ResumeHandle

Pointer to a DHCP_ADDR_PATTERN structure that identifies the enumeration operation. Initially this parameter must be set to zero (0), with a successful call returning the address/pattern value used for subsequent enumeration requests.

[in] PreferredMaximum

A DWORD value that specifies the preferred maximum number of bytes to return. If the number of remaining unenumerated filter information size is less than this value, then all the filters configured on the particular list on the DHCP server are returned. The maximum value for this is 64 (kilobytes), and the minimum value is 1 (kilobyte).

[in] ListType

A DHCP_FILTER_LIST_TYPE that specifies the list of filters to be enumerated.

[out] EnumFilterInfo

Pointer to the address of an array of DHCP_FILTER_ENUM_INFO structures that contain the returned link-layer filter information configured on the DHCP server.

[out] ElementsRead

Pointer to a DWORD value that specifies the number of link-layer filter entries returned in EnumFilterInfo.

[out] ElementsTotal

Pointer to a DWORD value that specifies the number of link-layer filter entries defined on the DHCP server that have not yet been enumerated.

Return value

This function returns ERROR_SUCCESS upon a successful call. Otherwise, it returns one of the DHCP Server Management API Error Codes.

Return code Description
ERROR_ACCESS_DENIED
This call was performed by a client who is not a member of the "DHCP Administrators" security group.
ERROR_DHCP_JET_ERROR
An error occurred while accessing the DHCP server's database.
ERROR_MORE_DATA
There are no more elements available for enumeration.
ERROR_NO_MORE_ITEMS
There are no more elements left to enumerate.

Requirements

Requirement Value
Minimum supported client None supported
Minimum supported server Windows Server 2008 R2 [desktop apps only]
Target Platform Windows
Header dhcpsapi.h
Library Dhcpsapi.lib
DLL Dhcpsapi.dll

See also

DHCP_FILTER_ENUM_INFO

DHCP_FILTER_LIST_TYPE