DhcpEnumSubnetsV6 function (dhcpsapi.h)

The DhcpEnumSubnetsV6 function returns an enumerated list of subnets defined on the DHCP server.

Syntax

DWORD DHCP_API_FUNCTION DhcpEnumSubnetsV6(
  [in]      DHCP_CONST WCHAR   *ServerIpAddress,
  [in, out] DHCP_RESUME_HANDLE *ResumeHandle,
  [in]      DWORD              PreferredMaximum,
  [out]     LPDHCPV6_IP_ARRAY  *EnumInfo,
  [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_RESUME_HANDLE value that identifies the enumeration operation. Initially, this value should be zero, with a successful call returning the handle value used for subsequent enumeration requests. For example, if PreferredMaximum is set to 100, and 200 subnet addresses are stored on the server, the resume handle can be used after the first 100 subnets are retrieved to obtain the next 100 on a subsequent call, and so forth.

[in] PreferredMaximum

Specifies the preferred maximum number of subnet addresses to return. If the number of remaining unenumerated options is less than this value, then that amount will be returned.

[out] EnumInfo

Pointer to a DHCPV6_IP_ARRAY structure that contains the subnet IDs available on the DHCP server. If no subnets are defined, this value will be null.

[out] ElementsRead

Pointer to a DWORD value that specifies the number of subnet addresses returned in EnumInfo.

[out] ElementsTotal

Pointer to a DWORD value that specifies the number of subnets defined on the DHCP server that have not yet been enumerated.

Return value

This function returns ERROR_SUCCESS upon a successful call. If a call is made with the same ResumeHandle value and all items on the server have been enumerated, this method returns ERROR_NO_MORE_ITEMS with ElementsRead and ElementsTotal set to 0. Otherwise, it returns one of the DHCP Server Management API Error Codes.

Return code Description
ERROR_INVALID_PARAMETER
The parameters were invalid.
ERROR_NO_MORE_ITEMS
No more items to enumerate.
ERROR_NOT_ENOUGH_MEMORY
Memory failure.
ERROR_MORE_DATA
More data is available to enumerate.

Requirements

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