Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
NT
apps
dfs
dns
domain
dsmnfpnw
embedded
fsft
mail
misc
oemdsp.preinstall
personalfax
print
protocol.ipx
protocol.misc
protocol.ras
protocol.routing
protocol.tcpip
registry
setup
terminalserv.app.
terminalserv.client
terminalserv.connectivity
terminalserv.domain
terminalserv.misc
terminalserv.prot.rdp
terminalserv.prot.tcpip
terminalserv.setup
terminalserv.user
windowsnt.wntsee
  
 
date: Thu, 19 May 2005 14:15:58 -0400,    group: microsoft.public.windowsnt.protocol.misc        back       


With multiple ethernet adapters, programmatically find current one?   
On multiple-adapter Win NT 4.0 machines, is there a key that denotes which
of the listed adapters is the one currently being used?

There are several numbers under
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
NT\CurrentVersion\NetworkCards\, and they are not all NIC cards.

I have no way of knowing which one to use (programmatically).

FYI: I have a program that is currently hard-coded with the name of our NIC
card ("RTL8139" by RealTek).
Since future revs of the our product may receive a different NIC(s), I hope
to have the program do the work.

Thanks, in advance,

DRBarkley

p.s.  I hope I have posted this correctly, I believe this is Cross-Posting,
not Multi-Posting?
(I'm sure I will hear about it, if wrong ;-))
date: Thu, 19 May 2005 14:15:58 -0400   author:   DR Barkley

Re: With multiple ethernet adapters, programmatically find current one?   
You choose adapter to use with metric , look at
"route print" command , the route ( so NIC )  with less metric have higher 
priority.
Arkady


"DR Barkley"  wrote in message 
news:OlewP7JXFHA.2768@tk2msftngp13.phx.gbl...
> On multiple-adapter Win NT 4.0 machines, is there a key that denotes which
> of the listed adapters is the one currently being used?
>
> There are several numbers under
> HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
> NT\CurrentVersion\NetworkCards\, and they are not all NIC cards.
>
> I have no way of knowing which one to use (programmatically).
>
> FYI: I have a program that is currently hard-coded with the name of our 
> NIC
> card ("RTL8139" by RealTek).
> Since future revs of the our product may receive a different NIC(s), I 
> hope
> to have the program do the work.
>
> Thanks, in advance,
>
> DRBarkley
>
> p.s.  I hope I have posted this correctly, I believe this is 
> Cross-Posting,
> not Multi-Posting?
> (I'm sure I will hear about it, if wrong ;-))
>
>
date: Fri, 20 May 2005 13:29:30 +0200   author:   Arkady Frenkel

Re: With multiple ethernet adapters, programmatically find current one?   
Hi Arkady,

Thanks for your reply!

I see that the metrics are as follows, now (they may change later):

[1] The RTL8139 Fast Ethernet Adapters
[2] Remote Access WAN Wrapper
[3] Remote Access Mac
[4] Remote Access WAN Wrapper

Are you saying that the lowest metric will always be the current Ethernet
adapter?

Thanks again for your time,

DRBarkley

"Arkady Frenkel"  wrote in message
news:%23E$JOeSXFHA.2740@TK2MSFTNGP14.phx.gbl...
> You choose adapter to use with metric , look at
> "route print" command , the route ( so NIC )  with less metric have higher
> priority.
> Arkady
>
>
> "DR Barkley"  wrote in message
> news:OlewP7JXFHA.2768@tk2msftngp13.phx.gbl...
> > On multiple-adapter Win NT 4.0 machines, is there a key that denotes
which
> > of the listed adapters is the one currently being used?
> >
> > There are several numbers under
> > HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
> > NT\CurrentVersion\NetworkCards\, and they are not all NIC cards.
> >
> > I have no way of knowing which one to use (programmatically).
> >
> > FYI: I have a program that is currently hard-coded with the name of our
> > NIC
> > card ("RTL8139" by RealTek).
> > Since future revs of the our product may receive a different NIC(s), I
> > hope
> > to have the program do the work.
> >
> > Thanks, in advance,
> >
> > DRBarkley
> >
> > p.s.  I hope I have posted this correctly, I believe this is
> > Cross-Posting,
> > not Multi-Posting?
> > (I'm sure I will hear about it, if wrong ;-))
> >
> >
>
>
date: Fri, 20 May 2005 07:32:30 -0400   author:   DR Barkley

Re: With multiple ethernet adapters, programmatically find current one?   
DR Barkley wrote:
> Hi Arkady,
> 
> Thanks for your reply!
> 
> I see that the metrics are as follows, now (they may change later):
> 
> [1] The RTL8139 Fast Ethernet Adapters
> [2] Remote Access WAN Wrapper
> [3] Remote Access Mac
> [4] Remote Access WAN Wrapper
> 
> Are you saying that the lowest metric will always be the current Ethernet
> adapter?

Makes sense doesn't it?

-- 
Model: INFJ
Primary function: Coprocessor
Secondary function: Cluster commander

"In the cold breeze that I walk along
The memories of generations burn within me
Been forever since I cried the pain and sorrow
I live and die, proud of my people gaining"
	-- Wolf's rain theme
date: Fri, 20 May 2005 15:20:51 +0200   author:   Jure Sah

Re: With multiple ethernet adapters, programmatically find current one?   
I'm gonna take that as a yes.

It actually makes no more (or less) sense to me than if it were some other
place.
Nor does any of the rest of the post: (Model: INFJ, Primary function:
Coprocessor, Secondary function: Cluster commander, or Wolfe's (whoever that
is) rain theme).

But, I expect it makes plenty of sense to many others who work with this
stuff, regularly.
So, a sincere thanks for the (probably sincere) response ;-).

DR Barkley

"Jure Sah"  wrote in message
news:Tulje.12219$F6.2556356@news.siol.net...
> DR Barkley wrote:
> > Hi Arkady,
> >
> > Thanks for your reply!
> >
> > I see that the metrics are as follows, now (they may change later):
> >
> > [1] The RTL8139 Fast Ethernet Adapters
> > [2] Remote Access WAN Wrapper
> > [3] Remote Access Mac
> > [4] Remote Access WAN Wrapper
> >
> > Are you saying that the lowest metric will always be the current
Ethernet
> > adapter?
>
> Makes sense doesn't it?
>
> -- 
> Model: INFJ
> Primary function: Coprocessor
> Secondary function: Cluster commander
>
> "In the cold breeze that I walk along
> The memories of generations burn within me
> Been forever since I cried the pain and sorrow
> I live and die, proud of my people gaining"
> -- Wolf's rain theme
date: Fri, 20 May 2005 09:35:59 -0400   author:   DR Barkley

Re: With multiple ethernet adapters, programmatically find current one?   
DR Barkley wrote:
> I'm gonna take that as a yes.
> 
> It actually makes no more (or less) sense to me than if it were some other
> place.

As far as I know (I just might be wrong thoe), the routing table 
explains how the network is phisically layed out, that is, it states 
trough what devices your network transmition has to pass in order to 
reach it's destination.

The metrics on the routing table tell the computer where to send the 
data according to the IP number provided. That is, if the data is 
intended for a computer outside your private LAN, it will be forwarded 
to a gateway device that connects your LAN to the outside world, if 
however the data is intended to be delivered to a computer on the LAN, 
it will be sent directly. And then of course there is the case when you 
are infact sending data to your self (localhost or 127.0.0.1), in which 
case the data will stay within the local adapter's sphere.

To be able to determine all this, the routing table must contain the 
full hiearchy of devices responsible for delivering messages from 
computers to computers, computers to gateways or gateways to gateways. 
This full hierarchy only reaches as far as the next gateway and 
naturally, begins with the first device capable of relaying messages 
accross a network.

This first device is your main network adapter.

> Nor does any of the rest of the post: (Model: INFJ, Primary function:
> Coprocessor, Secondary function: Cluster commander, or Wolfe's (whoever that
> is) rain theme).

It's called a signature file. The symbol "-- " indicates it's begining. 
Standard in USENET postings as some text trailing each posted message, 
it does not have anything to do with the contens of the post, it's just 
there as the poster's signature.

> But, I expect it makes plenty of sense to many others who work with this
> stuff, regularly.
> So, a sincere thanks for the (probably sincere) response ;-).

Helps to know what you're doing tho.

Good luck.

-- 
Model: INFJ
Primary function: Coprocessor
Secondary function: Cluster commander

"In the cold breeze that I walk along
The memories of generations burn within me
Been forever since I cried the pain and sorrow
I live and die, proud of my people gaining"
	-- Wolf's rain theme
date: Fri, 20 May 2005 16:03:42 +0200   author:   Jure Sah

Re: With multiple ethernet adapters, programmatically find current one?   
Jure,

Thank you for the explanation.

I didn't realize that about the --; I havn't done much USENETting.
I have noticed the "signature files", but they usually begin with a
name/title--which makes it more obvious.

I think this will help me make my program do what it has to do.
If I understand correctly (from the Many other sources I've researched), the
lowest Metric may not necessarily be a "1".
So, I will need to make sure I get the least, which compels the next
question:

Will they always be in order, from least to highest, so that I only need to
get the first?

Thanks again for all,

Dr Barkley

"Jure Sah"  wrote in message
news:27mje.12221$F6.2556521@news.siol.net...
> DR Barkley wrote:
> > I'm gonna take that as a yes.
> >
> > It actually makes no more (or less) sense to me than if it were some
other
> > place.
>
> As far as I know (I just might be wrong thoe), the routing table
> explains how the network is phisically layed out, that is, it states
> trough what devices your network transmition has to pass in order to
> reach it's destination.
>
> The metrics on the routing table tell the computer where to send the
> data according to the IP number provided. That is, if the data is
> intended for a computer outside your private LAN, it will be forwarded
> to a gateway device that connects your LAN to the outside world, if
> however the data is intended to be delivered to a computer on the LAN,
> it will be sent directly. And then of course there is the case when you
> are infact sending data to your self (localhost or 127.0.0.1), in which
> case the data will stay within the local adapter's sphere.
>
> To be able to determine all this, the routing table must contain the
> full hiearchy of devices responsible for delivering messages from
> computers to computers, computers to gateways or gateways to gateways.
> This full hierarchy only reaches as far as the next gateway and
> naturally, begins with the first device capable of relaying messages
> accross a network.
>
> This first device is your main network adapter.
>
> > Nor does any of the rest of the post: (Model: INFJ, Primary function:
> > Coprocessor, Secondary function: Cluster commander, or Wolfe's (whoever
that
> > is) rain theme).
>
> It's called a signature file. The symbol "-- " indicates it's begining.
> Standard in USENET postings as some text trailing each posted message,
> it does not have anything to do with the contens of the post, it's just
> there as the poster's signature.
>
> > But, I expect it makes plenty of sense to many others who work with this
> > stuff, regularly.
> > So, a sincere thanks for the (probably sincere) response ;-).
>
> Helps to know what you're doing tho.
>
> Good luck.
>
> -- 
> Model: INFJ
> Primary function: Coprocessor
> Secondary function: Cluster commander
>
> "In the cold breeze that I walk along
> The memories of generations burn within me
> Been forever since I cried the pain and sorrow
> I live and die, proud of my people gaining"
> -- Wolf's rain theme
date: Fri, 20 May 2005 10:46:21 -0400   author:   DR Barkley

Re: With multiple ethernet adapters, programmatically find current one?   
No , e.g. in the case you have dial-up and ethernet OS set lowest to dial-up 
IIRC, but route of lowest one will be tried first for sure
Arkady

"DR Barkley"  wrote in message 
news:ume$S%23SXFHA.1468@tk2msftngp13.phx.gbl...
> Hi Arkady,
>
> Thanks for your reply!
>
> I see that the metrics are as follows, now (they may change later):
>
> [1] The RTL8139 Fast Ethernet Adapters
> [2] Remote Access WAN Wrapper
> [3] Remote Access Mac
> [4] Remote Access WAN Wrapper
>
> Are you saying that the lowest metric will always be the current Ethernet
> adapter?
>
> Thanks again for your time,
>
> DRBarkley
>
> "Arkady Frenkel"  wrote in message
> news:%23E$JOeSXFHA.2740@TK2MSFTNGP14.phx.gbl...
>> You choose adapter to use with metric , look at
>> "route print" command , the route ( so NIC )  with less metric have 
>> higher
>> priority.
>> Arkady
>>
>>
>> "DR Barkley"  wrote in message
>> news:OlewP7JXFHA.2768@tk2msftngp13.phx.gbl...
>> > On multiple-adapter Win NT 4.0 machines, is there a key that denotes
> which
>> > of the listed adapters is the one currently being used?
>> >
>> > There are several numbers under
>> > HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
>> > NT\CurrentVersion\NetworkCards\, and they are not all NIC cards.
>> >
>> > I have no way of knowing which one to use (programmatically).
>> >
>> > FYI: I have a program that is currently hard-coded with the name of our
>> > NIC
>> > card ("RTL8139" by RealTek).
>> > Since future revs of the our product may receive a different NIC(s), I
>> > hope
>> > to have the program do the work.
>> >
>> > Thanks, in advance,
>> >
>> > DRBarkley
>> >
>> > p.s.  I hope I have posted this correctly, I believe this is
>> > Cross-Posting,
>> > not Multi-Posting?
>> > (I'm sure I will hear about it, if wrong ;-))
>> >
>> >
>>
>>
>
>
date: Sun, 22 May 2005 10:16:09 +0200   author:   Arkady Frenkel

Re: With multiple ethernet adapters, programmatically find current one?   
BTW you can change that default behavior ( Dial-up before Lan "Routing IP 
Packets to Network
Adapter Rather than RAS") , look at Q 143168 of KB MSDN
( on web http://support.microsoft.com/kb/q143168/ )
Arkady

"Arkady Frenkel"  wrote in message 
news:uLmmr3pXFHA.2684@TK2MSFTNGP09.phx.gbl...
> No , e.g. in the case you have dial-up and ethernet OS set lowest to 
> dial-up IIRC, but route of lowest one will be tried first for sure
> Arkady
>
> "DR Barkley"  wrote in message 
> news:ume$S%23SXFHA.1468@tk2msftngp13.phx.gbl...
>> Hi Arkady,
>>
>> Thanks for your reply!
>>
>> I see that the metrics are as follows, now (they may change later):
>>
>> [1] The RTL8139 Fast Ethernet Adapters
>> [2] Remote Access WAN Wrapper
>> [3] Remote Access Mac
>> [4] Remote Access WAN Wrapper
>>
>> Are you saying that the lowest metric will always be the current Ethernet
>> adapter?
>>
>> Thanks again for your time,
>>
>> DRBarkley
>>
>> "Arkady Frenkel"  wrote in message
>> news:%23E$JOeSXFHA.2740@TK2MSFTNGP14.phx.gbl...
>>> You choose adapter to use with metric , look at
>>> "route print" command , the route ( so NIC )  with less metric have 
>>> higher
>>> priority.
>>> Arkady
>>>
>>>
>>> "DR Barkley"  wrote in message
>>> news:OlewP7JXFHA.2768@tk2msftngp13.phx.gbl...
>>> > On multiple-adapter Win NT 4.0 machines, is there a key that denotes
>> which
>>> > of the listed adapters is the one currently being used?
>>> >
>>> > There are several numbers under
>>> > HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
>>> > NT\CurrentVersion\NetworkCards\, and they are not all NIC cards.
>>> >
>>> > I have no way of knowing which one to use (programmatically).
>>> >
>>> > FYI: I have a program that is currently hard-coded with the name of 
>>> > our
>>> > NIC
>>> > card ("RTL8139" by RealTek).
>>> > Since future revs of the our product may receive a different NIC(s), I
>>> > hope
>>> > to have the program do the work.
>>> >
>>> > Thanks, in advance,
>>> >
>>> > DRBarkley
>>> >
>>> > p.s.  I hope I have posted this correctly, I believe this is
>>> > Cross-Posting,
>>> > not Multi-Posting?
>>> > (I'm sure I will hear about it, if wrong ;-))
>>> >
>>> >
>>>
>>>
>>
>>
>
>
date: Sun, 22 May 2005 10:23:54 +0200   author:   Arkady Frenkel

Re: With multiple ethernet adapters, programmatically find current one?   
So, is there any way to find out the current adapter name?

"Arkady Frenkel"  wrote in message
news:uLmmr3pXFHA.2684@TK2MSFTNGP09.phx.gbl...
> No , e.g. in the case you have dial-up and ethernet OS set lowest to
dial-up
> IIRC, but route of lowest one will be tried first for sure
> Arkady
>
> "DR Barkley"  wrote in message
> news:ume$S%23SXFHA.1468@tk2msftngp13.phx.gbl...
> > Hi Arkady,
> >
> > Thanks for your reply!
> >
> > I see that the metrics are as follows, now (they may change later):
> >
> > [1] The RTL8139 Fast Ethernet Adapters
> > [2] Remote Access WAN Wrapper
> > [3] Remote Access Mac
> > [4] Remote Access WAN Wrapper
> >
> > Are you saying that the lowest metric will always be the current
Ethernet
> > adapter?
> >
> > Thanks again for your time,
> >
> > DRBarkley
> >
> > "Arkady Frenkel"  wrote in message
> > news:%23E$JOeSXFHA.2740@TK2MSFTNGP14.phx.gbl...
> >> You choose adapter to use with metric , look at
> >> "route print" command , the route ( so NIC )  with less metric have
> >> higher
> >> priority.
> >> Arkady
> >>
> >>
> >> "DR Barkley"  wrote in message
> >> news:OlewP7JXFHA.2768@tk2msftngp13.phx.gbl...
> >> > On multiple-adapter Win NT 4.0 machines, is there a key that denotes
> > which
> >> > of the listed adapters is the one currently being used?
> >> >
> >> > There are several numbers under
> >> > HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
> >> > NT\CurrentVersion\NetworkCards\, and they are not all NIC cards.
> >> >
> >> > I have no way of knowing which one to use (programmatically).
> >> >
> >> > FYI: I have a program that is currently hard-coded with the name of
our
> >> > NIC
> >> > card ("RTL8139" by RealTek).
> >> > Since future revs of the our product may receive a different NIC(s),
I
> >> > hope
> >> > to have the program do the work.
> >> >
> >> > Thanks, in advance,
> >> >
> >> > DRBarkley
> >> >
> >> > p.s.  I hope I have posted this correctly, I believe this is
> >> > Cross-Posting,
> >> > not Multi-Posting?
> >> > (I'm sure I will hear about it, if wrong ;-))
> >> >
> >> >
> >>
> >>
> >
> >
>
>
date: Tue, 24 May 2005 11:43:53 -0400   author:   DR Barkley

Re: With multiple ethernet adapters, programmatically find current one?   
I don't know what you mean current , because if you have few and each one 
connect to different LAN each one is current.And all those you can enumerate 
with GetAdaptersInfo() ( from W2K ) or GetIfTable/GetIfEntry from NT and 
older
Arkady

"DR Barkley"  wrote in message 
news:eiaVkdHYFHA.2520@TK2MSFTNGP09.phx.gbl...
> So, is there any way to find out the current adapter name?
>
> "Arkady Frenkel"  wrote in message
> news:uLmmr3pXFHA.2684@TK2MSFTNGP09.phx.gbl...
>> No , e.g. in the case you have dial-up and ethernet OS set lowest to
> dial-up
>> IIRC, but route of lowest one will be tried first for sure
>> Arkady
>>
>> "DR Barkley"  wrote in message
>> news:ume$S%23SXFHA.1468@tk2msftngp13.phx.gbl...
>> > Hi Arkady,
>> >
>> > Thanks for your reply!
>> >
>> > I see that the metrics are as follows, now (they may change later):
>> >
>> > [1] The RTL8139 Fast Ethernet Adapters
>> > [2] Remote Access WAN Wrapper
>> > [3] Remote Access Mac
>> > [4] Remote Access WAN Wrapper
>> >
>> > Are you saying that the lowest metric will always be the current
> Ethernet
>> > adapter?
>> >
>> > Thanks again for your time,
>> >
>> > DRBarkley
>> >
>> > "Arkady Frenkel"  wrote in message
>> > news:%23E$JOeSXFHA.2740@TK2MSFTNGP14.phx.gbl...
>> >> You choose adapter to use with metric , look at
>> >> "route print" command , the route ( so NIC )  with less metric have
>> >> higher
>> >> priority.
>> >> Arkady
>> >>
>> >>
>> >> "DR Barkley"  wrote in message
>> >> news:OlewP7JXFHA.2768@tk2msftngp13.phx.gbl...
>> >> > On multiple-adapter Win NT 4.0 machines, is there a key that denotes
>> > which
>> >> > of the listed adapters is the one currently being used?
>> >> >
>> >> > There are several numbers under
>> >> > HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
>> >> > NT\CurrentVersion\NetworkCards\, and they are not all NIC cards.
>> >> >
>> >> > I have no way of knowing which one to use (programmatically).
>> >> >
>> >> > FYI: I have a program that is currently hard-coded with the name of
> our
>> >> > NIC
>> >> > card ("RTL8139" by RealTek).
>> >> > Since future revs of the our product may receive a different NIC(s),
> I
>> >> > hope
>> >> > to have the program do the work.
>> >> >
>> >> > Thanks, in advance,
>> >> >
>> >> > DRBarkley
>> >> >
>> >> > p.s.  I hope I have posted this correctly, I believe this is
>> >> > Cross-Posting,
>> >> > not Multi-Posting?
>> >> > (I'm sure I will hear about it, if wrong ;-))
>> >> >
>> >> >
>> >>
>> >>
>> >
>> >
>>
>>
>
>
date: Wed, 25 May 2005 14:16:03 +0200   author:   Arkady Frenkel

Re: With multiple ethernet adapters, programmatically find current one?   
I didn't realize that there could be more than one in use.

Thanks very much for your replies,

DrBarkley

"Arkady Frenkel"  wrote in message
news:u7kpnrRYFHA.612@TK2MSFTNGP12.phx.gbl...
> I don't know what you mean current , because if you have few and each one
> connect to different LAN each one is current.And all those you can
enumerate
> with GetAdaptersInfo() ( from W2K ) or GetIfTable/GetIfEntry from NT and
> older
> Arkady
>
> "DR Barkley"  wrote in message
> news:eiaVkdHYFHA.2520@TK2MSFTNGP09.phx.gbl...
> > So, is there any way to find out the current adapter name?
> >
> > "Arkady Frenkel"  wrote in message
> > news:uLmmr3pXFHA.2684@TK2MSFTNGP09.phx.gbl...
> >> No , e.g. in the case you have dial-up and ethernet OS set lowest to
> > dial-up
> >> IIRC, but route of lowest one will be tried first for sure
> >> Arkady
> >>
> >> "DR Barkley"  wrote in message
> >> news:ume$S%23SXFHA.1468@tk2msftngp13.phx.gbl...
> >> > Hi Arkady,
> >> >
> >> > Thanks for your reply!
> >> >
> >> > I see that the metrics are as follows, now (they may change later):
> >> >
> >> > [1] The RTL8139 Fast Ethernet Adapters
> >> > [2] Remote Access WAN Wrapper
> >> > [3] Remote Access Mac
> >> > [4] Remote Access WAN Wrapper
> >> >
> >> > Are you saying that the lowest metric will always be the current
> > Ethernet
> >> > adapter?
> >> >
> >> > Thanks again for your time,
> >> >
> >> > DRBarkley
> >> >
> >> > "Arkady Frenkel"  wrote in message
> >> > news:%23E$JOeSXFHA.2740@TK2MSFTNGP14.phx.gbl...
> >> >> You choose adapter to use with metric , look at
> >> >> "route print" command , the route ( so NIC )  with less metric have
> >> >> higher
> >> >> priority.
> >> >> Arkady
> >> >>
> >> >>
> >> >> "DR Barkley"  wrote in message
> >> >> news:OlewP7JXFHA.2768@tk2msftngp13.phx.gbl...
> >> >> > On multiple-adapter Win NT 4.0 machines, is there a key that
denotes
> >> > which
> >> >> > of the listed adapters is the one currently being used?
> >> >> >
> >> >> > There are several numbers under
> >> >> > HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
> >> >> > NT\CurrentVersion\NetworkCards\, and they are not all NIC cards.
> >> >> >
> >> >> > I have no way of knowing which one to use (programmatically).
> >> >> >
> >> >> > FYI: I have a program that is currently hard-coded with the name
of
> > our
> >> >> > NIC
> >> >> > card ("RTL8139" by RealTek).
> >> >> > Since future revs of the our product may receive a different
NIC(s),
> > I
> >> >> > hope
> >> >> > to have the program do the work.
> >> >> >
> >> >> > Thanks, in advance,
> >> >> >
> >> >> > DRBarkley
> >> >> >
> >> >> > p.s.  I hope I have posted this correctly, I believe this is
> >> >> > Cross-Posting,
> >> >> > not Multi-Posting?
> >> >> > (I'm sure I will hear about it, if wrong ;-))
> >> >> >
> >> >> >
> >> >>
> >> >>
> >> >
> >> >
> >>
> >>
> >
> >
>
>
date: Wed, 25 May 2005 07:45:56 -0400   author:   DrBarkley

Re: With multiple ethernet adapters, programmatically find current one?   
Not at all. Just FYI.
If you have few , in each group ( e.g. two connected to one LAN , next two 
to other ) , in each group current will be one with less metric , as I wrote 
, so you have two currents in the case.
Arkady

"DrBarkley"  wrote in message 
news:OObZR9RYFHA.4024@TK2MSFTNGP10.phx.gbl...
>I didn't realize that there could be more than one in use.
>
> Thanks very much for your replies,
>
> DrBarkley
>
> "Arkady Frenkel"  wrote in message
> news:u7kpnrRYFHA.612@TK2MSFTNGP12.phx.gbl...
>> I don't know what you mean current , because if you have few and each one
>> connect to different LAN each one is current.And all those you can
> enumerate
>> with GetAdaptersInfo() ( from W2K ) or GetIfTable/GetIfEntry from NT and
>> older
>> Arkady
>>
>> "DR Barkley"  wrote in message
>> news:eiaVkdHYFHA.2520@TK2MSFTNGP09.phx.gbl...
>> > So, is there any way to find out the current adapter name?
>> >
>> > "Arkady Frenkel"  wrote in message
>> > news:uLmmr3pXFHA.2684@TK2MSFTNGP09.phx.gbl...
>> >> No , e.g. in the case you have dial-up and ethernet OS set lowest to
>> > dial-up
>> >> IIRC, but route of lowest one will be tried first for sure
>> >> Arkady
>> >>
>> >> "DR Barkley"  wrote in message
>> >> news:ume$S%23SXFHA.1468@tk2msftngp13.phx.gbl...
>> >> > Hi Arkady,
>> >> >
>> >> > Thanks for your reply!
>> >> >
>> >> > I see that the metrics are as follows, now (they may change later):
>> >> >
>> >> > [1] The RTL8139 Fast Ethernet Adapters
>> >> > [2] Remote Access WAN Wrapper
>> >> > [3] Remote Access Mac
>> >> > [4] Remote Access WAN Wrapper
>> >> >
>> >> > Are you saying that the lowest metric will always be the current
>> > Ethernet
>> >> > adapter?
>> >> >
>> >> > Thanks again for your time,
>> >> >
>> >> > DRBarkley
>> >> >
>> >> > "Arkady Frenkel"  wrote in message
>> >> > news:%23E$JOeSXFHA.2740@TK2MSFTNGP14.phx.gbl...
>> >> >> You choose adapter to use with metric , look at
>> >> >> "route print" command , the route ( so NIC )  with less metric have
>> >> >> higher
>> >> >> priority.
>> >> >> Arkady
>> >> >>
>> >> >>
>> >> >> "DR Barkley"  wrote in message
>> >> >> news:OlewP7JXFHA.2768@tk2msftngp13.phx.gbl...
>> >> >> > On multiple-adapter Win NT 4.0 machines, is there a key that
> denotes
>> >> > which
>> >> >> > of the listed adapters is the one currently being used?
>> >> >> >
>> >> >> > There are several numbers under
>> >> >> > HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
>> >> >> > NT\CurrentVersion\NetworkCards\, and they are not all NIC cards.
>> >> >> >
>> >> >> > I have no way of knowing which one to use (programmatically).
>> >> >> >
>> >> >> > FYI: I have a program that is currently hard-coded with the name
> of
>> > our
>> >> >> > NIC
>> >> >> > card ("RTL8139" by RealTek).
>> >> >> > Since future revs of the our product may receive a different
> NIC(s),
>> > I
>> >> >> > hope
>> >> >> > to have the program do the work.
>> >> >> >
>> >> >> > Thanks, in advance,
>> >> >> >
>> >> >> > DRBarkley
>> >> >> >
>> >> >> > p.s.  I hope I have posted this correctly, I believe this is
>> >> >> > Cross-Posting,
>> >> >> > not Multi-Posting?
>> >> >> > (I'm sure I will hear about it, if wrong ;-))
>> >> >> >
>> >> >> >
>> >> >>
>> >> >>
>> >> >
>> >> >
>> >>
>> >>
>> >
>> >
>>
>>
>
>
date: Wed, 25 May 2005 17:26:02 +0200   author:   Arkady Frenkel

Re: With multiple ethernet adapters, programmatically find current one?   
Forgot to mention , the info you can receive by GetIpForwardTable()
Arkady

"Arkady Frenkel"  wrote in message 
news:uPn%23xVTYFHA.1384@TK2MSFTNGP09.phx.gbl...
> Not at all. Just FYI.
> If you have few , in each group ( e.g. two connected to one LAN , next two 
> to other ) , in each group current will be one with less metric , as I 
> wrote , so you have two currents in the case.
> Arkady
>
> "DrBarkley"  wrote in message 
> news:OObZR9RYFHA.4024@TK2MSFTNGP10.phx.gbl...
>>I didn't realize that there could be more than one in use.
>>
>> Thanks very much for your replies,
>>
>> DrBarkley
>>
>> "Arkady Frenkel"  wrote in message
>> news:u7kpnrRYFHA.612@TK2MSFTNGP12.phx.gbl...
>>> I don't know what you mean current , because if you have few and each 
>>> one
>>> connect to different LAN each one is current.And all those you can
>> enumerate
>>> with GetAdaptersInfo() ( from W2K ) or GetIfTable/GetIfEntry from NT and
>>> older
>>> Arkady
>>>
>>> "DR Barkley"  wrote in message
>>> news:eiaVkdHYFHA.2520@TK2MSFTNGP09.phx.gbl...
>>> > So, is there any way to find out the current adapter name?
>>> >
>>> > "Arkady Frenkel"  wrote in message
>>> > news:uLmmr3pXFHA.2684@TK2MSFTNGP09.phx.gbl...
>>> >> No , e.g. in the case you have dial-up and ethernet OS set lowest to
>>> > dial-up
>>> >> IIRC, but route of lowest one will be tried first for sure
>>> >> Arkady
>>> >>
>>> >> "DR Barkley"  wrote in message
>>> >> news:ume$S%23SXFHA.1468@tk2msftngp13.phx.gbl...
>>> >> > Hi Arkady,
>>> >> >
>>> >> > Thanks for your reply!
>>> >> >
>>> >> > I see that the metrics are as follows, now (they may change later):
>>> >> >
>>> >> > [1] The RTL8139 Fast Ethernet Adapters
>>> >> > [2] Remote Access WAN Wrapper
>>> >> > [3] Remote Access Mac
>>> >> > [4] Remote Access WAN Wrapper
>>> >> >
>>> >> > Are you saying that the lowest metric will always be the current
>>> > Ethernet
>>> >> > adapter?
>>> >> >
>>> >> > Thanks again for your time,
>>> >> >
>>> >> > DRBarkley
>>> >> >
>>> >> > "Arkady Frenkel"  wrote in message
>>> >> > news:%23E$JOeSXFHA.2740@TK2MSFTNGP14.phx.gbl...
>>> >> >> You choose adapter to use with metric , look at
>>> >> >> "route print" command , the route ( so NIC )  with less metric 
>>> >> >> have
>>> >> >> higher
>>> >> >> priority.
>>> >> >> Arkady
>>> >> >>
>>> >> >>
>>> >> >> "DR Barkley"  wrote in message
>>> >> >> news:OlewP7JXFHA.2768@tk2msftngp13.phx.gbl...
>>> >> >> > On multiple-adapter Win NT 4.0 machines, is there a key that
>> denotes
>>> >> > which
>>> >> >> > of the listed adapters is the one currently being used?
>>> >> >> >
>>> >> >> > There are several numbers under
>>> >> >> > HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
>>> >> >> > NT\CurrentVersion\NetworkCards\, and they are not all NIC cards.
>>> >> >> >
>>> >> >> > I have no way of knowing which one to use (programmatically).
>>> >> >> >
>>> >> >> > FYI: I have a program that is currently hard-coded with the name
>> of
>>> > our
>>> >> >> > NIC
>>> >> >> > card ("RTL8139" by RealTek).
>>> >> >> > Since future revs of the our product may receive a different
>> NIC(s),
>>> > I
>>> >> >> > hope
>>> >> >> > to have the program do the work.
>>> >> >> >
>>> >> >> > Thanks, in advance,
>>> >> >> >
>>> >> >> > DRBarkley
>>> >> >> >
>>> >> >> > p.s.  I hope I have posted this correctly, I believe this is
>>> >> >> > Cross-Posting,
>>> >> >> > not Multi-Posting?
>>> >> >> > (I'm sure I will hear about it, if wrong ;-))
>>> >> >> >
>>> >> >> >
>>> >> >>
>>> >> >>
>>> >> >
>>> >> >
>>> >>
>>> >>
>>> >
>>> >
>>>
>>>
>>
>>
>
>
date: Wed, 25 May 2005 17:28:00 +0200   author:   Arkady Frenkel

Re: With multiple ethernet adapters, programmatically find current one?   
In article news:OObZR9RYFHA.4024@TK2MSFTNGP10.phx.gbl, DrBarkley wrote:
> I didn't realize that there could be more than one in use.
>
I've just happened across this thread and this is the first useful 
'answer' in it.  When you initially asked "which of the listed adapters 
is the one currently being used?", the answer you should have been given 
is: there is no such thing, there is no such concept.

Unfortunately you were given misleading answers, including the 
identification of the list of indexes for your adaptors as their TCP/IP 
metrics...  :-(

The only valid response to your question is: Why do you want to know 
this, what will you use the information for?  Are you using IP, IPX, 
NetBIOS over LLC, or raw Ethernet frames...



> Thanks very much for your replies,
>
> DrBarkley
>
> "Arkady Frenkel"  wrote in message
> news:u7kpnrRYFHA.612@TK2MSFTNGP12.phx.gbl...
>> I don't know what you mean current , because if you have few and
>> each one connect to different LAN each one is current.And all those
>> you can enumerate with GetAdaptersInfo() ( from W2K ) or
>> GetIfTable/GetIfEntry from NT and older
>> Arkady
>>
>> "DR Barkley"  wrote in message
>> news:eiaVkdHYFHA.2520@TK2MSFTNGP09.phx.gbl...
>>> So, is there any way to find out the current adapter name?
>>>
>>> "Arkady Frenkel"  wrote in message
>>> news:uLmmr3pXFHA.2684@TK2MSFTNGP09.phx.gbl...
>>>> No , e.g. in the case you have dial-up and ethernet OS set lowest
>>>> to dial-up IIRC, but route of lowest one will be tried first for
>>>> sure
>>>> Arkady
>>>>
>>>> "DR Barkley"  wrote in message
>>>> news:ume$S%23SXFHA.1468@tk2msftngp13.phx.gbl...
>>>>> Hi Arkady,
>>>>>
>>>>> Thanks for your reply!
>>>>>
>>>>> I see that the metrics are as follows, now (they may change
>>>>> later):
>>>>>
>>>>> [1] The RTL8139 Fast Ethernet Adapters
>>>>> [2] Remote Access WAN Wrapper
>>>>> [3] Remote Access Mac
>>>>> [4] Remote Access WAN Wrapper
>>>>>
>>>>> Are you saying that the lowest metric will always be the current
>>>>> Ethernet adapter?
>>>>>
>>>>> Thanks again for your time,
>>>>>
>>>>> DRBarkley
>>>>>
>>>>> "Arkady Frenkel"  wrote in message
>>>>> news:%23E$JOeSXFHA.2740@TK2MSFTNGP14.phx.gbl...
>>>>>> You choose adapter to use with metric , look at
>>>>>> "route print" command , the route ( so NIC )  with less metric
>>>>>> have higher
>>>>>> priority.
>>>>>> Arkady
>>>>>>
>>>>>>
>>>>>> "DR Barkley"  wrote in message
>>>>>> news:OlewP7JXFHA.2768@tk2msftngp13.phx.gbl...
>>>>>>> On multiple-adapter Win NT 4.0 machines, is there a key that
>>>>>>> denotes which of the listed adapters is the one currently being
>>>>>>> used?
>>>>>>>
>>>>>>> There are several numbers under
>>>>>>> HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
>>>>>>> NT\CurrentVersion\NetworkCards\, and they are not all NIC cards.
>>>>>>>
>>>>>>> I have no way of knowing which one to use (programmatically).
>>>>>>>
>>>>>>> FYI: I have a program that is currently hard-coded with the
>>>>>>> name of our NIC
>>>>>>> card ("RTL8139" by RealTek).
>>>>>>> Since future revs of the our product may receive a different
>>>>>>> NIC(s), I hope
>>>>>>> to have the program do the work.
>>>>>>>
>>>>>>> Thanks, in advance,
>>>>>>>
>>>>>>> DRBarkley
>>>>>>>
>>>>>>> p.s.  I hope I have posted this correctly, I believe this is
>>>>>>> Cross-Posting,
>>>>>>> not Multi-Posting?
>>>>>>> (I'm sure I will hear about it, if wrong ;-))

-- 
Alan J. McFarlane
http://www.alanjmcf.me.uk/
Please follow-up in the newsgroup for the benefit of all.
date: Wed, 25 May 2005 20:33:20 +0100   author:   Alan J. McFarlane LID

Re: With multiple ethernet adapters, programmatically find current one?   
Alan,

I had given up on this thread, but stopped back by and saw your response.
Thanks for the reply.

I am a Visual Basic (VB6) programmer, and maintain software for an NT 4.0
product that we build.
Soon, we may be changing NIC providers, and I would like to have my software
capable of determining which NIC is installed.
Currently, I can have my software "look" at the first metric (1) to get the
adapter name, but, I don't know if this will always be true.

Thanks again,

DrBarkley

"Alan J. McFarlane" <alanjmcf@yahoo.com.INVALID> wrote in message
news:4294d2f5$2$2369$ed2619ec@ptn-nntp-reader02.plus.net...
> In article news:OObZR9RYFHA.4024@TK2MSFTNGP10.phx.gbl, DrBarkley wrote:
> > I didn't realize that there could be more than one in use.
> >
> I've just happened across this thread and this is the first useful
> 'answer' in it.  When you initially asked "which of the listed adapters
> is the one currently being used?", the answer you should have been given
> is: there is no such thing, there is no such concept.
>
> Unfortunately you were given misleading answers, including the
> identification of the list of indexes for your adaptors as their TCP/IP
> metrics...  :-(
>
> The only valid response to your question is: Why do you want to know
> this, what will you use the information for?  Are you using IP, IPX,
> NetBIOS over LLC, or raw Ethernet frames...
>
>
>
> > Thanks very much for your replies,
> >
> > DrBarkley
> >
> > "Arkady Frenkel"  wrote in message
> > news:u7kpnrRYFHA.612@TK2MSFTNGP12.phx.gbl...
> >> I don't know what you mean current , because if you have few and
> >> each one connect to different LAN each one is current.And all those
> >> you can enumerate with GetAdaptersInfo() ( from W2K ) or
> >> GetIfTable/GetIfEntry from NT and older
> >> Arkady
> >>
> >> "DR Barkley"  wrote in message
> >> news:eiaVkdHYFHA.2520@TK2MSFTNGP09.phx.gbl...
> >>> So, is there any way to find out the current adapter name?
> >>>
> >>> "Arkady Frenkel"  wrote in message
> >>> news:uLmmr3pXFHA.2684@TK2MSFTNGP09.phx.gbl...
> >>>> No , e.g. in the case you have dial-up and ethernet OS set lowest
> >>>> to dial-up IIRC, but route of lowest one will be tried first for
> >>>> sure
> >>>> Arkady
> >>>>
> >>>> "DR Barkley"  wrote in message
> >>>> news:ume$S%23SXFHA.1468@tk2msftngp13.phx.gbl...
> >>>>> Hi Arkady,
> >>>>>
> >>>>> Thanks for your reply!
> >>>>>
> >>>>> I see that the metrics are as follows, now (they may change
> >>>>> later):
> >>>>>
> >>>>> [1] The RTL8139 Fast Ethernet Adapters
> >>>>> [2] Remote Access WAN Wrapper
> >>>>> [3] Remote Access Mac
> >>>>> [4] Remote Access WAN Wrapper
> >>>>>
> >>>>> Are you saying that the lowest metric will always be the current
> >>>>> Ethernet adapter?
> >>>>>
> >>>>> Thanks again for your time,
> >>>>>
> >>>>> DRBarkley
> >>>>>
> >>>>> "Arkady Frenkel"  wrote in message
> >>>>> news:%23E$JOeSXFHA.2740@TK2MSFTNGP14.phx.gbl...
> >>>>>> You choose adapter to use with metric , look at
> >>>>>> "route print" command , the route ( so NIC )  with less metric
> >>>>>> have higher
> >>>>>> priority.
> >>>>>> Arkady
> >>>>>>
> >>>>>>
> >>>>>> "DR Barkley"  wrote in message
> >>>>>> news:OlewP7JXFHA.2768@tk2msftngp13.phx.gbl...
> >>>>>>> On multiple-adapter Win NT 4.0 machines, is there a key that
> >>>>>>> denotes which of the listed adapters is the one currently being
> >>>>>>> used?
> >>>>>>>
> >>>>>>> There are several numbers under
> >>>>>>> HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
> >>>>>>> NT\CurrentVersion\NetworkCards\, and they are not all NIC cards.
> >>>>>>>
> >>>>>>> I have no way of knowing which one to use (programmatically).
> >>>>>>>
> >>>>>>> FYI: I have a program that is currently hard-coded with the
> >>>>>>> name of our NIC
> >>>>>>> card ("RTL8139" by RealTek).
> >>>>>>> Since future revs of the our product may receive a different
> >>>>>>> NIC(s), I hope
> >>>>>>> to have the program do the work.
> >>>>>>>
> >>>>>>> Thanks, in advance,
> >>>>>>>
> >>>>>>> DRBarkley
> >>>>>>>
> >>>>>>> p.s.  I hope I have posted this correctly, I believe this is
> >>>>>>> Cross-Posting,
> >>>>>>> not Multi-Posting?
> >>>>>>> (I'm sure I will hear about it, if wrong ;-))
>
> -- 
> Alan J. McFarlane
> http://www.alanjmcf.me.uk/
> Please follow-up in the newsgroup for the benefit of all.
>
>
>
date: Tue, 7 Jun 2005 07:44:51 -0400   author:   Dave

Re: With multiple ethernet adapters, programmatically find current one?   
I just realized that I hadn't answered your other question:

> >  Are you using IP, IPX, NetBIOS over LLC, or raw Ethernet frames...

We are using IP.

"Dave"  wrote in message
news:eggwRZ1aFHA.2496@TK2MSFTNGP14.phx.gbl...
> Alan,
>
> I had given up on this thread, but stopped back by and saw your response.
> Thanks for the reply.
>
> I am a Visual Basic (VB6) programmer, and maintain software for an NT 4.0
> product that we build.
> Soon, we may be changing NIC providers, and I would like to have my
software
> capable of determining which NIC is installed.
> Currently, I can have my software "look" at the first metric (1) to get
the
> adapter name, but, I don't know if this will always be true.
>
> Thanks again,
>
> DrBarkley
>
> "Alan J. McFarlane" <alanjmcf@yahoo.com.INVALID> wrote in message
> news:4294d2f5$2$2369$ed2619ec@ptn-nntp-reader02.plus.net...
> > In article news:OObZR9RYFHA.4024@TK2MSFTNGP10.phx.gbl, DrBarkley wrote:
> > > I didn't realize that there could be more than one in use.
> > >
> > I've just happened across this thread and this is the first useful
> > 'answer' in it.  When you initially asked "which of the listed adapters
> > is the one currently being used?", the answer you should have been given
> > is: there is no such thing, there is no such concept.
> >
> > Unfortunately you were given misleading answers, including the
> > identification of the list of indexes for your adaptors as their TCP/IP
> > metrics...  :-(
> >
> > The only valid response to your question is: Why do you want to know
> > this, what will you use the information for?  Are you using IP, IPX,
> > NetBIOS over LLC, or raw Ethernet frames...
> >
> >
> >
> > > Thanks very much for your replies,
> > >
> > > DrBarkley
> > >
> > > "Arkady Frenkel"  wrote in message
> > > news:u7kpnrRYFHA.612@TK2MSFTNGP12.phx.gbl...
> > >> I don't know what you mean current , because if you have few and
> > >> each one connect to different LAN each one is current.And all those
> > >> you can enumerate with GetAdaptersInfo() ( from W2K ) or
> > >> GetIfTable/GetIfEntry from NT and older
> > >> Arkady
> > >>
> > >> "DR Barkley"  wrote in message
> > >> news:eiaVkdHYFHA.2520@TK2MSFTNGP09.phx.gbl...
> > >>> So, is there any way to find out the current adapter name?
> > >>>
> > >>> "Arkady Frenkel"  wrote in message
> > >>> news:uLmmr3pXFHA.2684@TK2MSFTNGP09.phx.gbl...
> > >>>> No , e.g. in the case you have dial-up and ethernet OS set lowest
> > >>>> to dial-up IIRC, but route of lowest one will be tried first for
> > >>>> sure
> > >>>> Arkady
> > >>>>
> > >>>> "DR Barkley"  wrote in message
> > >>>> news:ume$S%23SXFHA.1468@tk2msftngp13.phx.gbl...
> > >>>>> Hi Arkady,
> > >>>>>
> > >>>>> Thanks for your reply!
> > >>>>>
> > >>>>> I see that the metrics are as follows, now (they may change
> > >>>>> later):
> > >>>>>
> > >>>>> [1] The RTL8139 Fast Ethernet Adapters
> > >>>>> [2] Remote Access WAN Wrapper
> > >>>>> [3] Remote Access Mac
> > >>>>> [4] Remote Access WAN Wrapper
> > >>>>>
> > >>>>> Are you saying that the lowest metric will always be the current
> > >>>>> Ethernet adapter?
> > >>>>>
> > >>>>> Thanks again for your time,
> > >>>>>
> > >>>>> DRBarkley
> > >>>>>
> > >>>>> "Arkady Frenkel"  wrote in message
> > >>>>> news:%23E$JOeSXFHA.2740@TK2MSFTNGP14.phx.gbl...
> > >>>>>> You choose adapter to use with metric , look at
> > >>>>>> "route print" command , the route ( so NIC )  with less metric
> > >>>>>> have higher
> > >>>>>> priority.
> > >>>>>> Arkady
> > >>>>>>
> > >>>>>>
> > >>>>>> "DR Barkley"  wrote in message
> > >>>>>> news:OlewP7JXFHA.2768@tk2msftngp13.phx.gbl...
> > >>>>>>> On multiple-adapter Win NT 4.0 machines, is there a key that
> > >>>>>>> denotes which of the listed adapters is the one currently being
> > >>>>>>> used?
> > >>>>>>>
> > >>>>>>> There are several numbers under
> > >>>>>>> HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
> > >>>>>>> NT\CurrentVersion\NetworkCards\, and they are not all NIC cards.
> > >>>>>>>
> > >>>>>>> I have no way of knowing which one to use (programmatically).
> > >>>>>>>
> > >>>>>>> FYI: I have a program that is currently hard-coded with the
> > >>>>>>> name of our NIC
> > >>>>>>> card ("RTL8139" by RealTek).
> > >>>>>>> Since future revs of the our product may receive a different
> > >>>>>>> NIC(s), I hope
> > >>>>>>> to have the program do the work.
> > >>>>>>>
> > >>>>>>> Thanks, in advance,
> > >>>>>>>
> > >>>>>>> DRBarkley
> > >>>>>>>
> > >>>>>>> p.s.  I hope I have posted this correctly, I believe this is
> > >>>>>>> Cross-Posting,
> > >>>>>>> not Multi-Posting?
> > >>>>>>> (I'm sure I will hear about it, if wrong ;-))
> >
> > -- 
> > Alan J. McFarlane
> > http://www.alanjmcf.me.uk/
> > Please follow-up in the newsgroup for the benefit of all.
> >
> >
> >
>
>
date: Tue, 7 Jun 2005 09:21:23 -0400   author:   Dave

Re: With multiple ethernet adapters, programmatically find current one?   
In article ,
Dave  wrote:
>  ...
>I am a Visual Basic (VB6) programmer, and maintain software for an NT
>4.0 product that we build.
>Soon, we may be changing NIC providers, and I would like to have my
>software capable of determining which NIC is installed.

The first few bytes of the MAC identifies the manufacturer.

-- 
					-- Rod --
rodd(at)polylogics(dot)com
date: Tue, 7 Jun 2005 19:44:33 +0000 (UTC)   author:   (Rod Dorman)

Re: With multiple ethernet adapters, programmatically find current one?   
In article news:uKEBOP2aFHA.3132@TK2MSFTNGP09.phx.gbl, Dave wrote:

> "Dave"  wrote in message
> news:eggwRZ1aFHA.2496@TK2MSFTNGP14.phx.gbl...
>> I am a Visual Basic (VB6) programmer, and maintain software for an
>> NT 4.0 product that we build.
>> Soon, we may be changing NIC providers, and I would like to have my
>> software capable of determining which NIC is installed.
>> Currently, I can have my software "look" at the first metric (1) to
>> get the adapter name, but, I don't know if this will always be true.
>>
That is NOT the metric!!!

> I just realized that I hadn't answered your other question:
>
>>>  Are you using IP, IPX, NetBIOS over LLC, or raw Ethernet frames...
>
> We are using IP.
>
The most important question still needs to be answered: Why do you want 
to know?  And that's the high level reason for it, the reason why the 
user of the program needs the program to manually select a interface.  I 
can think of almost no good reason to write code that selects an 
interface by name chosen at compile time.

Particularly since you are using IP which is layered over ther Link 
Layer and means you should only very very rarely need to care about the 
Link Layer devices.  There's the routing table, including the metric 
settings, etc to allow one to allow the administrator to control what 
interfaces are used for what.


>> "Alan J. McFarlane" <alanjmcf@yahoo.com.INVALID> wrote in message
>> news:4294d2f5$2$2369$ed2619ec@ptn-nntp-reader02.plus.net...
>>> In article news:OObZR9RYFHA.4024@TK2MSFTNGP10.phx.gbl, DrBarkley
>>> wrote:
>>>> I didn't realize that there could be more than one in use.
>>>>
>>> I've just happened across this thread and this is the first useful
>>> 'answer' in it.  When you initially asked "which of the listed
>>> adapters is the one currently being used?", the answer you should
>>> have been given is: there is no such thing, there is no such
>>> concept.
>>>
>>> Unfortunately you were given misleading answers, including the
>>> identification of the list of indexes for your adaptors as their
>>> TCP/IP metrics...  :-(
>>>
>>> The only valid response to your question is: Why do you want to know
>>> this, what will you use the information for?  Are you using IP, IPX,
>>> NetBIOS over LLC, or raw Ethernet frames...
>>>
>>>
>>>
>>>> Thanks very much for your replies,
>>>>
>>>> DrBarkley
>>>>
>>>> "Arkady Frenkel"  wrote in message
>>>> news:u7kpnrRYFHA.612@TK2MSFTNGP12.phx.gbl...
>>>>> I don't know what you mean current , because if you have few and
>>>>> each one connect to different LAN each one is current.And all
>>>>> those you can enumerate with GetAdaptersInfo() ( from W2K ) or
>>>>> GetIfTable/GetIfEntry from NT and older
>>>>> Arkady
>>>>>
>>>>> "DR Barkley"  wrote in message
>>>>> news:eiaVkdHYFHA.2520@TK2MSFTNGP09.phx.gbl...
>>>>>> So, is there any way to find out the current adapter name?
>>>>>>
>>>>>> "Arkady Frenkel"  wrote in message
>>>>>> news:uLmmr3pXFHA.2684@TK2MSFTNGP09.phx.gbl...
>>>>>>> No , e.g. in the case you have dial-up and ethernet OS set
>>>>>>> lowest to dial-up IIRC, but route of lowest one will be tried
>>>>>>> first for sure
>>>>>>> Arkady
>>>>>>>
>>>>>>> "DR Barkley"  wrote in message
>>>>>>> news:ume$S%23SXFHA.1468@tk2msftngp13.phx.gbl...
>>>>>>>> Hi Arkady,
>>>>>>>>
>>>>>>>> Thanks for your reply!
>>>>>>>>
>>>>>>>> I see that the metrics are as follows, now (they may change
>>>>>>>> later):
>>>>>>>>
>>>>>>>> [1] The RTL8139 Fast Ethernet Adapters
>>>>>>>> [2] Remote Access WAN Wrapper
>>>>>>>> [3] Remote Access Mac
>>>>>>>> [4] Remote Access WAN Wrapper
>>>>>>>>
>>>>>>>> Are you saying that the lowest metric will always be the
>>>>>>>> current Ethernet adapter?
>>>>>>>>
>>>>>>>> Thanks again for your time,
>>>>>>>>
>>>>>>>> DRBarkley
>>>>>>>>
>>>>>>>> "Arkady Frenkel"  wrote in message
>>>>>>>> news:%23E$JOeSXFHA.2740@TK2MSFTNGP14.phx.gbl...
>>>>>>>>> You choose adapter to use with metric , look at
>>>>>>>>> "route print" command , the route ( so NIC )  with less metric
>>>>>>>>> have higher
>>>>>>>>> priority.
>>>>>>>>> Arkady
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> "DR Barkley"  wrote in message
>>>>>>>>> news:OlewP7JXFHA.2768@tk2msftngp13.phx.gbl...
>>>>>>>>>> On multiple-adapter Win NT 4.0 machines, is there a key that
>>>>>>>>>> denotes which of the listed adapters is the one currently
>>>>>>>>>> being used?
>>>>>>>>>>
>>>>>>>>>> There are several numbers under
>>>>>>>>>> HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
>>>>>>>>>> NT\CurrentVersion\NetworkCards\, and they are not all NIC
>>>>>>>>>> cards.
>>>>>>>>>>
>>>>>>>>>> I have no way of knowing which one to use (programmatically).
>>>>>>>>>>
>>>>>>>>>> FYI: I have a program that is currently hard-coded with the
>>>>>>>>>> name of our NIC
>>>>>>>>>> card ("RTL8139" by RealTek).
>>>>>>>>>> Since future revs of the our product may receive a different
>>>>>>>>>> NIC(s), I hope
>>>>>>>>>> to have the program do the work.
>>>>>>>>>>
>>>>>>>>>> Thanks, in advance,
>>>>>>>>>>
>>>>>>>>>> DRBarkley
>>>>>>>>>>
>>>>>>>>>> p.s.  I hope I have posted this correctly, I believe this is
>>>>>>>>>> Cross-Posting,
>>>>>>>>>> not Multi-Posting?
>>>>>>>>>> (I'm sure I will hear about it, if wrong ;-))
>>>
>>> --
>>> Alan J. McFarlane
>>> http://www.alanjmcf.me.uk/
>>> Please follow-up in the newsgroup for the benefit of all.

-- 
Alan J. McFarlane
http://www.alanjmcf.me.uk/
Please follow-up in the newsgroup for the benefit of all.
date: Thu, 9 Jun 2005 12:15:21 +0100   author:   Alan J. McFarlane LID

Re: With multiple ethernet adapters, programmatically find current one?   
Thanks again, Alan.

I'm sure I'm misunderstanding something, as I am not very knowledgeable in
this area.

Before the responses on this thread, the card name was a hardcoded
("RTL81391").

Now, my program gets the Network Interface Card(NIC) name as follows:
    AdapterName = QueryValue("Software\Microsoft\Windows
NT\CurrentVersion\NetworkCards\1", "ServiceName")     ' currently returns
RTL81391
    (QueryValue uses RegOpenKeyEx and QueryValueEx to return the info
requested)
AdapterName is used to determine the appropriate adapter key:
    Ethernet_Adapter_Parameters_Key = "SYSTEM\CurrentControlSet\Services\" &
AdapterName & "\Parameters\Tcpip"
Which allows the program/user to get/set the IP Address, SubnetMask, and
Gateway.
    (The IP address is static on each of the machines--for reasons beyond
me).

In the future, we may have 100 units with one NIC, and 100 others with a
different NIC.
But, I want my software to work with either.

I hope this makes more sense...

Thank you,

Dave

"Alan J. McFarlane" <alanjmcf@yahoo.com.INVALID> wrote in message
news:42a82726$0$5028$ed2619ec@ptn-nntp-reader01.plus.net...
> In article news:uKEBOP2aFHA.3132@TK2MSFTNGP09.phx.gbl, Dave wrote:
>
> > "Dave"  wrote in message
> > news:eggwRZ1aFHA.2496@TK2MSFTNGP14.phx.gbl...
> >> I am a Visual Basic (VB6) programmer, and maintain software for an
> >> NT 4.0 product that we build.
> >> Soon, we may be changing NIC providers, and I would like to have my
> >> software capable of determining which NIC is installed.
> >> Currently, I can have my software "look" at the first metric (1) to
> >> get the adapter name, but, I don't know if this will always be true.
> >>
> That is NOT the metric!!!
>
> > I just realized that I hadn't answered your other question:
> >
> >>>  Are you using IP, IPX, NetBIOS over LLC, or raw Ethernet frames...
> >
> > We are using IP.
> >
> The most important question still needs to be answered: Why do you want
> to know?  And that's the high level reason for it, the reason why the
> user of the program needs the program to manually select a interface.  I
> can think of almost no good reason to write code that selects an
> interface by name chosen at compile time.
>
> Particularly since you are using IP which is layered over ther Link
> Layer and means you should only very very rarely need to care about the
> Link Layer devices.  There's the routing table, including the metric
> settings, etc to allow one to allow the administrator to control what
> interfaces are used for what.
>
>
> >> "Alan J. McFarlane" <alanjmcf@yahoo.com.INVALID> wrote in message
> >> news:4294d2f5$2$2369$ed2619ec@ptn-nntp-reader02.plus.net...
> >>> In article news:OObZR9RYFHA.4024@TK2MSFTNGP10.phx.gbl, DrBarkley
> >>> wrote:
> >>>> I didn't realize that there could be more than one in use.
> >>>>
> >>> I've just happened across this thread and this is the first useful
> >>> 'answer' in it.  When you initially asked "which of the listed
> >>> adapters is the one currently being used?", the answer you should
> >>> have been given is: there is no such thing, there is no such
> >>> concept.
> >>>
> >>> Unfortunately you were given misleading answers, including the
> >>> identification of the list of indexes for your adaptors as their
> >>> TCP/IP metrics...  :-(
> >>>
> >>> The only valid response to your question is: Why do you want to know
> >>> this, what will you use the information for?  Are you using IP, IPX,
> >>> NetBIOS over LLC, or raw Ethernet frames...
> >>>
> >>>
> >>>
> >>>> Thanks very much for your replies,
> >>>>
> >>>> DrBarkley
> >>>>
> >>>> "Arkady Frenkel"  wrote in message
> >>>> news:u7kpnrRYFHA.612@TK2MSFTNGP12.phx.gbl...
> >>>>> I don't know what you mean current , because if you have few and
> >>>>> each one connect to different LAN each one is current.And all
> >>>>> those you can enumerate with GetAdaptersInfo() ( from W2K ) or
> >>>>> GetIfTable/GetIfEntry from NT and older
> >>>>> Arkady
> >>>>>
> >>>>> "DR Barkley"  wrote in message
> >>>>> news:eiaVkdHYFHA.2520@TK2MSFTNGP09.phx.gbl...
> >>>>>> So, is there any way to find out the current adapter name?
> >>>>>>
> >>>>>> "Arkady Frenkel"  wrote in message
> >>>>>> news:uLmmr3pXFHA.2684@TK2MSFTNGP09.phx.gbl...
> >>>>>>> No , e.g. in the case you have dial-up and ethernet OS set
> >>>>>>> lowest to dial-up IIRC, but route of lowest one will be tried
> >>>>>>> first for sure
> >>>>>>> Arkady
> >>>>>>>
> >>>>>>> "DR Barkley"  wrote in message
> >>>>>>> news:ume$S%23SXFHA.1468@tk2msftngp13.phx.gbl...
> >>>>>>>> Hi Arkady,
> >>>>>>>>
> >>>>>>>> Thanks for your reply!
> >>>>>>>>
> >>>>>>>> I see that the metrics are as follows, now (they may change
> >>>>>>>> later):
> >>>>>>>>
> >>>>>>>> [1] The RTL8139 Fast Ethernet Adapters
> >>>>>>>> [2] Remote Access WAN Wrapper
> >>>>>>>> [3] Remote Access Mac
> >>>>>>>> [4] Remote Access WAN Wrapper
> >>>>>>>>
> >>>>>>>> Are you saying that the lowest metric will always be the
> >>>>>>>> current Ethernet adapter?
> >>>>>>>>
> >>>>>>>> Thanks again for your time,
> >>>>>>>>
> >>>>>>>> DRBarkley
> >>>>>>>>
> >>>>>>>> "Arkady Frenkel"  wrote in message
> >>>>>>>> news:%23E$JOeSXFHA.2740@TK2MSFTNGP14.phx.gbl...
> >>>>>>>>> You choose adapter to use with metric , look at
> >>>>>>>>> "route print" command , the route ( so NIC )  with less metric
> >>>>>>>>> have higher
> >>>>>>>>> priority.
> >>>>>>>>> Arkady
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>> "DR Barkley"  wrote in message
> >>>>>>>>> news:OlewP7JXFHA.2768@tk2msftngp13.phx.gbl...
> >>>>>>>>>> On multiple-adapter Win NT 4.0 machines, is there a key that
> >>>>>>>>>> denotes which of the listed adapters is the one currently
> >>>>>>>>>> being used?
> >>>>>>>>>>
> >>>>>>>>>> There are several numbers under
> >>>>>>>>>> HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
> >>>>>>>>>> NT\CurrentVersion\NetworkCards\, and they are not all NIC
> >>>>>>>>>> cards.
> >>>>>>>>>>
> >>>>>>>>>> I have no way of knowing which one to use (programmatically).
> >>>>>>>>>>
> >>>>>>>>>> FYI: I have a program that is currently hard-coded with the
> >>>>>>>>>> name of our NIC
> >>>>>>>>>> card ("RTL8139" by RealTek).
> >>>>>>>>>> Since future revs of the our product may receive a different
> >>>>>>>>>> NIC(s), I hope
> >>>>>>>>>> to have the program do the work.
> >>>>>>>>>>
> >>>>>>>>>> Thanks, in advance,
> >>>>>>>>>>
> >>>>>>>>>> DRBarkley
> >>>>>>>>>>
> >>>>>>>>>> p.s.  I hope I have posted this correctly, I believe this is
> >>>>>>>>>> Cross-Posting,
> >>>>>>>>>> not Multi-Posting?
> >>>>>>>>>> (I'm sure I will hear about it, if wrong ;-))
> >>>
> >>> --
> >>> Alan J. McFarlane
> >>> http://www.alanjmcf.me.uk/
> >>> Please follow-up in the newsgroup for the benefit of all.
>
> -- 
> Alan J. McFarlane
> http://www.alanjmcf.me.uk/
> Please follow-up in the newsgroup for the benefit of all.
>
date: Thu, 9 Jun 2005 10:44:39 -0400   author:   Dave

Re: With multiple ethernet adapters, programmatically find current one?   
You can  use less metric to see which adapter's route preffered by TCP stack 
only. E.g. if you have few adapters with the same route ( 
destination/mask/gateway ) the one with less metric will be used but all are 
installed for sure
Arkady

"Dave"  wrote in message 
news:eggwRZ1aFHA.2496@TK2MSFTNGP14.phx.gbl...
> Alan,
>
> I had given up on this thread, but stopped back by and saw your response.
> Thanks for the reply.
>
> I am a Visual Basic (VB6) programmer, and maintain software for an NT 4.0
> product that we build.
> Soon, we may be changing NIC providers, and I would like to have my 
> software
> capable of determining which NIC is installed.
> Currently, I can have my software "look" at the first metric (1) to get 
> the
> adapter name, but, I don't know if this will always be true.
>
> Thanks again,
>
> DrBarkley
>
> "Alan J. McFarlane" <alanjmcf@yahoo.com.INVALID> wrote in message
> news:4294d2f5$2$2369$ed2619ec@ptn-nntp-reader02.plus.net...
>> In article news:OObZR9RYFHA.4024@TK2MSFTNGP10.phx.gbl, DrBarkley wrote:
>> > I didn't realize that there could be more than one in use.
>> >
>> I've just happened across this thread and this is the first useful
>> 'answer' in it.  When you initially asked "which of the listed adapters
>> is the one currently being used?", the answer you should have been given
>> is: there is no such thing, there is no such concept.
>>
>> Unfortunately you were given misleading answers, including the
>> identification of the list of indexes for your adaptors as their TCP/IP
>> metrics...  :-(
>>
>> The only valid response to your question is: Why do you want to know
>> this, what will you use the information for?  Are you using IP, IPX,
>> NetBIOS over LLC, or raw Ethernet frames...
>>
>>
>>
>> > Thanks very much for your replies,
>> >
>> > DrBarkley
>> >
>> > "Arkady Frenkel"  wrote in message
>> > news:u7kpnrRYFHA.612@TK2MSFTNGP12.phx.gbl...
>> >> I don't know what you mean current , because if you have few and
>> >> each one connect to different LAN each one is current.And all those
>> >> you can enumerate with GetAdaptersInfo() ( from W2K ) or
>> >> GetIfTable/GetIfEntry from NT and older
>> >> Arkady
>> >>
>> >> "DR Barkley"  wrote in message
>> >> news:eiaVkdHYFHA.2520@TK2MSFTNGP09.phx.gbl...
>> >>> So, is there any way to find out the current adapter name?
>> >>>
>> >>> "Arkady Frenkel"  wrote in message
>> >>> news:uLmmr3pXFHA.2684@TK2MSFTNGP09.phx.gbl...
>> >>>> No , e.g. in the case you have dial-up and ethernet OS set lowest
>> >>>> to dial-up IIRC, but route of lowest one will be tried first for
>> >>>> sure
>> >>>> Arkady
>> >>>>
>> >>>> "DR Barkley"  wrote in message
>> >>>> news:ume$S%23SXFHA.1468@tk2msftngp13.phx.gbl...
>> >>>>> Hi Arkady,
>> >>>>>
>> >>>>> Thanks for your reply!
>> >>>>>
>> >>>>> I see that the metrics are as follows, now (they may change
>> >>>>> later):
>> >>>>>
>> >>>>> [1] The RTL8139 Fast Ethernet Adapters
>> >>>>> [2] Remote Access WAN Wrapper
>> >>>>> [3] Remote Access Mac
>> >>>>> [4] Remote Access WAN Wrapper
>> >>>>>
>> >>>>> Are you saying that the lowest metric will always be the current
>> >>>>> Ethernet adapter?
>> >>>>>
>> >>>>> Thanks again for your time,
>> >>>>>
>> >>>>> DRBarkley
>> >>>>>
>> >>>>> "Arkady Frenkel"  wrote in message
>> >>>>> news:%23E$JOeSXFHA.2740@TK2MSFTNGP14.phx.gbl...
>> >>>>>> You choose adapter to use with metric , look at
>> >>>>>> "route print" command , the route ( so NIC )  with less metric
>> >>>>>> have higher
>> >>>>>> priority.
>> >>>>>> Arkady
>> >>>>>>
>> >>>>>>
>> >>>>>> "DR Barkley"  wrote in message
>> >>>>>> news:OlewP7JXFHA.2768@tk2msftngp13.phx.gbl...
>> >>>>>>> On multiple-adapter Win NT 4.0 machines, is there a key that
>> >>>>>>> denotes which of the listed adapters is the one currently being
>> >>>>>>> used?
>> >>>>>>>
>> >>>>>>> There are several numbers under
>> >>>>>>> HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
>> >>>>>>> NT\CurrentVersion\NetworkCards\, and they are not all NIC cards.
>> >>>>>>>
>> >>>>>>> I have no way of knowing which one to use (programmatically).
>> >>>>>>>
>> >>>>>>> FYI: I have a program that is currently hard-coded with the
>> >>>>>>> name of our NIC
>> >>>>>>> card ("RTL8139" by RealTek).
>> >>>>>>> Since future revs of the our product may receive a different
>> >>>>>>> NIC(s), I hope
>> >>>>>>> to have the program do the work.
>> >>>>>>>
>> >>>>>>> Thanks, in advance,
>> >>>>>>>
>> >>>>>>> DRBarkley
>> >>>>>>>
>> >>>>>>> p.s.  I hope I have posted this correctly, I believe this is
>> >>>>>>> Cross-Posting,
>> >>>>>>> not Multi-Posting?
>> >>>>>>> (I'm sure I will hear about it, if wrong ;-))
>>
>> -- 
>> Alan J. McFarlane
>> http://www.alanjmcf.me.uk/
>> Please follow-up in the newsgroup for the benefit of all.
>>
>>
>>
>
>
date: Tue, 14 Jun 2005 15:25:27 +0200   author:   Arkady Frenkel

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us