views:

168

answers:

0

I am working with NLM API's (windows). I have a LAN connection and Wireless data card connection. I am enumerating the networks available.

Code:

HRESULT hr;
VARIANT_BOOL pBool1, pBool2;
IEnumNetworks *pEnumNetworks;
INetwork *pNetwork;


hr = pNetwork->get_IsConnected(&pBool1);

hr = pNetwork->get_IsConnectedToInternet(&pBool2);

I have both LAN and Wireless data card connected.

For LAN pBool1 value is True and pBool2 value is False.

For Wireless Data card both pBool1 and pBool2 values are true.

When I disconnect the wireless data card, For LAN pBool2 value is false, though i am able to access Internet while i am in LAN connection ?? Any idea why this value is False?

How can we differentiate LAN and wireless data card network connection using NLM(NetworkListManager) API's?