Managing network adapters

S

Simon Wilton

In my system I will have a built-in 10/100 network adapter, and an optional
wireless adapter. Only one connection will be used. When both adapters are
fitted, I want to set allow the user to set a static IP on one and disable
the other. When the system starts it should use the last setting that it
had.

I need to detect when both are fitted (which I think I can do with the
GetAdaptersInfo API call). Can anyone confirm that this lists adapters
whether or not they are disabled?

I can set the static addresses either using IPChange.exe with the name
supplied by GetAdaptersInfo, or with IP helper APIs.

The missing link is how do I programmatically enable and disable adapters,
and find their state. There is a state in structure returned by
GetInterfaceInfo, but this does not seem to do what I want. If I disable an
adapter from the desktop, GetInterfaceInfo does not see it at all - let
alone give the facility to re-enable it. What I really want is the APIs to
get and set the adapter state that are used in the properties of the the
network connection on the desktop. Any one know how?

TIA

Simon
 
S

Slobodan Brcin

Hi Simon,

Try posting this question in microsoft.public.win32.programmer.networks

Best regards,
Slobodan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top