Re: Howto Tell if WiFi is connected



Hello remco, that is more in the lines of the manufacturer solution. Problem I ran into was these devices have two NIC cards, one wired and one WiFi. The factory solution was to bring up a dialog box and what for it to close. In normal circumstances this would work, but our OS needs to talk to web server right a way, in fact wall the main thread is still coming up. This presented a problem with DLL's like wininet, as they tried to Launch in a normal fashion, but the application had handle to the device already and wininet would blow out. My solution after your suggestion was to Search the device tree for enabled device's and then look for witch one has come up with a valid IP. I had to rewrite the Factory code to integrate into our desktop. This solution appears to work OK but, I still have a problem blowing out explorer.exe. The boot loader on these devices won't allow us to debug or do remote download so this will tack some time to salve. Hope this info will help some one else and thank your for your input. The code is rather large so i wont post it hear.

"Guy Winslow" <guywin@xxxxxxxxxxx> wrote in message
news:%23NE3820eFHA.584@xxxxxxxxxxxxxxxxxxxxxxx

We have a situation where we need to get web page from server when
device

is

turned on.  But WiFi card is not connected and Wininet.dll thinks

everything

is copasetic till it tries to get the page.  Have tried suggestion
from Televideo (TeleCLIENT), witch is to look for driver then see if
we have valid IP, but this tends to plow out the Wininet.dll when the
system is still coming up.  More then likely do to the fact you have
to call IOCTL wall network is connection.  Tried Microsoft suggestion
with is to look

for

not connected, but only works for wired network connection.  So has
any

one

been able to salve this in a manner that do's not blow out any
network

stack

parts or Wininet.dll?

I've done it on a wired connected with  a DeviceIoControl using
IOCTL_NDISUIO_QUERY_OID_VALUE as the IO control value. It returns the
connect status. I was just interested if a carrier was present, not so
much
if there was an internet connection present.
If you need more info, let me know -- I'll have to dig around for some
example code, though.
Remco

Here is current code snippet solution that only works with wired

connection:

BOOL IsConnected(WCHAR *szURL)
{
DWORD iflags = 0;
InternetGetConnectedState(&iflags , 0);
if(0 != (iflags & INTERNET_CONNECTION_CONFIGURED))
{
SetGlobalOffline(false);
if(0 != InternetCheckConnection(szURL, FLAG_ICC_FORCE_CONNECTION, 0))
return true;
}
return false;
}
void SetGlobalOffline(BOOL fGoOffline)
{
INTERNET_CONNECTED_INFO ci;
memset(&ci, 0, sizeof(ci));
if(fGoOffline)
{
ci.dwConnectedState = INTERNET_STATE_DISCONNECTED_BY_USER;
ci.dwFlags = ISO_FORCE_DISCONNECTED;
}
else
{
ci.dwConnectedState = INTERNET_STATE_CONNECTED;
}
InternetSetOption(NULL, INTERNET_OPTION_CONNECTED_STATE, &ci,
sizeof(ci));
}
Note - this works with wired connection but not with WiFi card.  Have
searched news groups and internet and found lots of other people with
similar problem.

--
Class Guy Winslow
{
public:
WINcontrols
H: 925-606-1091
M: 925-922-0222
gdwinslow@xxxxxxxxxxxxxxx
};



.



Relevant Pages

  • Interconnecting two AIX via a crossover cable
    ... Intranet and the remaining nic cards are directly ... Can this kind of configuration guarantee all Bart2 to Homer2 ... communication will always use the crossover connection instead of ...
    (comp.unix.aix)
  • Re: Two nic cards - the local connection drops the internet
    ... manageable switchs/hubs usually have web interface or ... >> I have two nic cards in my advanced 2000 server. ... loses connection on all my computers. ...
    (microsoft.public.win2000.networking)
  • Re: Shared Internet Connection w/W2K
    ... >I have a computer running Windows XP Home Edition SP2. ... >have the XP system connected via LAN switch to another ... shared Internet connection. ... Which two NIC cards are getting static IP addresses? ...
    (microsoft.public.windowsxp.network_web)
  • RE: SBS2003 Standard VPN connection does not work
    ... I have the sbs2003 with 2 nic cards there are no routers. ... >If the connection times out while verifying username and ... the server and the ...
    (microsoft.public.windows.server.sbs)