DhcpV4GetClientInfo function (dhcpsapi.h)
The DhcpV4GetClientInfo function retrieves DHCP client lease record information from the DHCP server database.
Syntax
DWORD DHCP_API_FUNCTION DhcpV4GetClientInfo(
[in, optional] DHCP_CONST WCHAR *ServerIpAddress,
[in] DHCP_CONST DHCP_SEARCH_INFO *SearchInfo,
[out] LPDHCP_CLIENT_INFO_PB *ClientInfo
);
Parameters
[in, optional] ServerIpAddress
Pointer to a null-terminated Unicode string that represents the IP address or hostname of the DHCP server.
[in] SearchInfo
Pointer to a DHCP_SEARCH_INFO structure that defines the key used to search for the client lease record on the DHCP server.
[out] ClientInfo
Pointer to a DHCP_CLIENT_INFO_PB structure that returns the DHCP client lease record information.
Return value
If the function succeeds, it returns ERROR_SUCCESS.
If the function fails, it returns one of the following or an error code from DHCP Server Management API Error Codes.
Value | Meaning |
---|---|
|
Invalid or NULL SearchInfo was passed to the function. |
|
This call was performed by a client that is not a member of the DHCP Users or DHCP Administrators security groups. |
|
The DHCP client is not valid. In this case, the search information passed had no corresponding IPv4 lease records. |
Remarks
If the SearchType member of the structure passed to SearchInfo is DhcpClientName and there are multiple lease records with the same client hostnames, the lease record returned is indeterminate.
ClientInfo should be free using DhcpRpcFreeMemory.
Requirements
Requirement | Value |
---|---|
Minimum supported client | None supported |
Minimum supported server | Windows Server 2012 [desktop apps only] |
Target Platform | Windows |
Header | dhcpsapi.h |
Library | Dhcpsapi.lib |
DLL | Dhcpsapi.dll |