GetBestRoute and GetBestInterface in Vista

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have noticed a change of behaviour from XP to Vista with regard to the
GetBestRoute and GetBestInterface. On Vista, If I turn on my internal WLAN,
connect to an access point, get the IP layer up, and then turn off the WLAN
adapter, the two mentionned primitives do not see that the IP connectivity is
gone and this for at least one minute. Funny enough, if I open Internet
Explorer and try to reach a Web site, it detects directly that there is no IP
connectivity, the two mentionned primitives however still return that there
is a route or an interface respectively.



Any suggestion on how to get an up-to-date status of the routing ? What I
need to test is whether there is IP connectivity with a default gateway for
routing.
 
Laurent Frelechoux said:
I have noticed a change of behaviour from XP to Vista with regard to the
GetBestRoute and GetBestInterface. On Vista, If I turn on my internal
WLAN,

Hi Laurent,

The short answer is: I dunno. But a couple of guesses ... first, in Vista,
the out parameter of GetBestInterface() is a pointer to a NET_IFINDEX
structure; not a DWORD as in XP and ealier. So you may need to adjust that
in your code.

Also, what does does GetBestInterface() return? Does it complete with
NO_ERROR? Or do you get a return code like ERROR_CAN_NOT_COMPLETE or
ERROR_NOT_SUPPORTED? That might give you a clue.

Finally, note that GetBestInterface only works with the IPv4 stack. On
Vista, by default you will have the IPv4 and IPv6 stacks running
side-by-side. If your IP connection is actually over IPv6, you would need to
use GetBestInterfaceEx().

microsoft.public.windows.vista.general is a pretty user-oriented newsgroup,
there aren't many devlopers here. You may get better results asking in
places like microsoft.public.win32.programmer.networks, or the MSDN Windows
Vista Wireless SDK forum:
http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=1700&SiteID=1


Good luck with it,
 
Back
Top