4.11 Querying the IPv6 Binding Information of the DHCP Service
In this example, the DHCPv6 server is configured with three endpoints. This example illustrates how to query the list of endpoints from the DHCP server.
The client calls R_DhcpGetServerBindingInfoV6 (section 3.2.4.70) and provides the following parameters:
One of the RPC endpoints of the DHCPv6 server as the server IP address. This parameter is optional and can be passed as a pointer to a null Unicode string.
Zero as the reserved ULONG Flags parameter.
A pointer, BindElementsInfo, of type LPDHCPV6_BIND_ELEMENT_ARRAY (section 2.2.1.2.83) to a structure that contains a pointer to an array of type DHCPV6_BIND_ELEMENT (section 2.2.1.2.82) and the number of elements in the array.
The call to this RPC method returns ERROR_SUCCESS, and the following parameter is updated:
The pointer, BindElementsInfo, of type LPDHCPV6_BIND_ELEMENT_ARRAY is updated with three as the number of elements in the array and a pointer to a buffer containing the addresses of the three endpoints of the DHCP server.
Upon a successful call, after the client no longer needs the list of endpoints, the client frees the memory pointed to by the pointer BindElementsInfo of type LPDHCPV6_BIND_ELEMENT_ARRAY by calling the function midl_user_free (section 3).