The R_DhcpV4GetClientInfo method retrieves DHCPv4 client lease record information from the DHCPv4 server database. The information also includes the link-layer filter status information for the DHCPv4 client and the policy, if any, that resulted in the specific IPv4 address assignment. The caller of this function can free the memory pointed to by the ClientInfo parameter by calling the function midl_user_free (section 3).
DWORD R_DhcpV4GetClientInfo( [in, unique, string] DHCP_SRV_HANDLE ServerIpAddress, [in, ref] LPDHCP_SEARCH_INFO SearchInfo, [out] LPDHCP_CLIENT_INFO_PB* ClientInfo );
ServerIpAddress: The IP address of the DHCP server. This parameter is unused.
SearchInfo: A pointer to a type DHCP_SEARCH_INFO (section 2.2.1.2.18) structure that contains the key to be used to search for the DHCPv4 client lease record on the DHCPv4 server. If this parameter's SearchType member is set to DhcpClientName and there are multiple lease records with the same ClientName member, the server returns client information for the client having the lowest numerical IP address.
ClientInfo: A pointer of type LPDHCP_CLIENT_INFO_PB that points to the location where the DHCPv4 client lease record information will be returned. The caller SHOULD free this buffer. The structure's ClientHardwareAddress member represents a DHCPv4 client unique-identifier as specified in section 2.2.1.2.5.2.
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 to any generic failure.
|
Return value/code |
Description |
|---|---|
|
0x00000000 ERROR_SUCCESS |
The call completed successfully. |
|
0x00004E30 ERROR_DHCP_INVALID_CLIENT |
The specified DHCP client is not valid. |
The opnum field value for this method is 123.
When processing this call, the DHCP server MUST do the following:
Return ERROR_INVALID_PARAMETER if the SearchInfo or ClientInfo parameter is NULL.
If the SearchType member of the SearchInfo parameter is set to DhcpClientName and the ClientName member of the SearchInfo parameter is NULL, return ERROR_INVALID_PARAMETER.
Validate whether this method is authorized for read access as specified in section 3.5.4. If not, return ERROR_ACCESS_DENIED.
Iterate through the DHCPv4ClientsList ADM element of all the DHCPv4Scope ADM element entries in the server DHCPv4ScopesList ADM element, and retrieve the DHCPv4Client ADM element entry corresponding to the ClientIpAddress, ClientHardwareAddress, or ClientName member of the SearchInfo parameter as specified by the SearchType member in the SearchInfo parameter. If the DHCPv4Client entry is not found, return ERROR_DHCP_INVALID_DHCP_CLIENT.
Copy the information from the DHCPv4Client entry to the ClientInfo parameter. The HostName member in the DHCP_HOST_INFO structure is unused.
Return ERROR_SUCCESS.
Exceptions Thrown: No exceptions are thrown beyond those thrown by the underlying RPC protocol [MS-RPCE].