How do I receive notification when a network interface is brought up and ready, under Windows XP?
Ready means the interface already obtained a network IP address via DHCP and is ready to use.
How do I receive notification when a network interface is brought up and ready, under Windows XP?
Ready means the interface already obtained a network IP address via DHCP and is ready to use.
You can use GetAdaptersAddresses to receive status of all adapters, then check if it is up or down. You'll have to repeat the process till the status changes. I'm not aware of any way to receive notification.
Also, for each adapter you can search it's IP address in the registry. That would be in SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces##ADAPTERNAME##, Were ##ADAPTERNAME## is the AdapterName member of the IP_ADAPTER_ADDRESSES structure. Check the EnableDHCP to find if it is a dynamic address, then look at the DhcpIPAddress key.
You can definitely get an event when an interface is ready! Just use IPHelper! The function you shall be looking for is NotifyAddrChange http://msdn.microsoft.com/en-us/library/aa366329%28v=VS.85%29.aspx and it is available starting from Windows 2000. When an adapter is up and running, it will be assigned an IP address, and thus triggered the callback.
A GetAdapterAddress can be used when triggered to figure the information you need. On Vista or above there is NotifyIpInterfaceChange that directly tell which adapter has IP change.