Tags:Microsoft, Windows CE .NET, 4.2, C++ using eVC
Background on the overall problem: I'm writing an application on Windows CE .NET 4.2 that is trying to change a network adapter from DHCP to static IP. Unfortunately, the default registry (which I can change but can't save the changes so that the next time I start the machine it's got the static IP registry settings) has configured the network adapter to be DHCP. So I need to on startup change the registry setting for that network adapter to static IP and then re-bind that adapter using IOCTL_NDIS_REBIND_ADAPTER. Unfotunately, I've noticed a bug/problem in Windows CE 4.2 that when I change the registry setting (particulary the EnableDHCP = false) while the adapter is still trying to obtain a DHCP IP address the registry gets change back to EnableDHCP = true when the DHCP checking eventually times out.
The question: So I need to find out how can my application program can check to make sure that the adapter has finish checking for DHCP and then I can safely change the registry settings and then rebind the adapter? As the DHCP timeout takes considerable time, if there is a better way to change a DHCP enabled network adapter to a static IP address without waiting for the DHCP to timeout that would be even better.