Skip to content

Latest commit

 

History

History
158 lines (120 loc) · 5.33 KB

nf-dhcpsapi-dhcpenumsubnetclientsv4.md

File metadata and controls

158 lines (120 loc) · 5.33 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:dhcpsapi.DhcpEnumSubnetClientsV4
DhcpEnumSubnetClientsV4 function (dhcpsapi.h)
Returns an enumerated list of client lease records with served IP addresses in the specified subnet.
DhcpEnumSubnetClientsV4
DhcpEnumSubnetClientsV4 function [DHCP]
dhcp.dhcpenumsubnetclientsv4
dhcpsapi/DhcpEnumSubnetClientsV4
dhcp\dhcpenumsubnetclientsv4.htm
DHCP
3451dc35-4cd1-4430-a19f-f0aa0533ea4b
12/05/2018
DhcpEnumSubnetClientsV4, DhcpEnumSubnetClientsV4 function [DHCP], dhcp.dhcpenumsubnetclientsv4, dhcpsapi/DhcpEnumSubnetClientsV4
dhcpsapi.h
Windows
None supported
Windows Server 2008 R2 [desktop apps only]
Dhcpsapi.lib
Dhcpsapi.dll
Windows
19H1
DhcpEnumSubnetClientsV4
dhcpsapi/DhcpEnumSubnetClientsV4
c++
APIRef
kbSyntax
DllExport
Dhcpsapi.dll
DhcpEnumSubnetClientsV4

DhcpEnumSubnetClientsV4 function

-description

The DhcpEnumSubnetClientsV4 function returns an enumerated list of client lease records with served IP addresses in the specified subnet. This function extends the functionality provided in DhcpEnumSubnetClients by returning a list of DHCP_CLIENT_INFO_V4 structures that contain the specific client type (DHCP and/or BOOTP).

-parameters

-param ServerIpAddress [in]

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

-param SubnetAddress [in]

DHCP_IP_ADDRESS value containing the IP address of the subnet gateway.

-param ResumeHandle [in, out]

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. This parameter contains the last IPv4 address retrieved from the DHCPv4 client.

The presence of additional enumerable data is indicated when this function returns ERROR_MORE_DATA. If no additional enumerable data is available on the DHCPv4 server, ERROR_NO_MORE_ITEMS is returned.

-param PreferredMaximum [in]

Specifies the preferred maximum number of bytes of subnet client elements to return. If the number of remaining unenumerated elements (in bytes) is less than this value, then that amount will be returned. The minimum value is 1024 bytes, and the maximum value is 65536 bytes.

To retrieve all the subnet client elements for the default user and vendor class at the specified level, set this parameter to 0xFFFFFFFF.

-param ClientInfo [out]

Pointer to a DHCP_CLIENT_INFO_ARRAY_V4 structure that contains the DHCPv4 client lease record array. If no clients are available, this field will be null.

-param ClientsRead [out]

Pointer to a DWORD value that specifies the number of client lease records returned in ClientInfo.

-param ClientsTotal [out]

Pointer to a DWORD value that specifies the total number of client lease records remaining on the DHCPv4 server. For example, if there are 100 DHCPv4 lease records for an IPv4 subnet, and if 10 DHCPv4 lease records are enumerated per call, then this parameter would return a value of 90 after the first call.

-returns

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_DHCP_JET_ERROR
An error occurred while accessing the DHCP server database.
ERROR_MORE_DATA
There are more elements available to enumerate.
ERROR_NO_MORE_ITEMS
There are no more elements left to enumerate.
ERROR_DHCP_SUBNET_NOT_PRESENT
The specified IPv4 subnet does not exist on the DHCP server.

-remarks

The caller of this function must free the memory for ClientInfo after the call completes.

-see-also

DHCP_CLIENT_INFO_ARRAY_V4

DhcpEnumSubnetClients

DhcpEnumSubnetClientsV5