In my app I'm using InternetGetConnectedState
to determine if the system is online.
I was using Windows 10
and it was always working fine.
Recently I've upgraded my machine to Windows 11
and found that it's not working anymore: it's returning TRUE
always.
In its lpdwFlags
parameter it returns 18, which means LAN (0x2) | RasInstalled (0x10)
.
I think this is a regression and it's related to Ras (I connect using Dial-up).
Two questions:
As InternetGetConnectedState recommends,
use the INetworkListManager::GetConnectivity method instead.
There is a Microsoft sample NetworkListManager which is uploaded recently.