I am trying to write a notify object for a network card. In my notify
object, I would like to list all of the currently installed network
adapters. I am using the INetCfg interface to get an enumeration of the
network devices. I use EnumComponents to get this enumeration. The
problem I have is that this enumeration gives me every network adapter that
has ever been installed in the machine. I want to know what devices are
currently installed.
Am I going about this in the wrong way? How can I get a list of the
currently installed network adapters?
Thanks,
John
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
Take a look at the SetupDi API. An example is in the Windows 2000 DDK at
‘…\src\network\config\netcfg’.
Most of the Microsoft APIs actually seem weak on the topic of simply
“enumerating adapters”. Even worse when you say that you want to list both
“real” adapters as well as “virtual” adapters (from a NDIS IM). Even with
the SetupDi API I haven’t found a way to view “true” adapter bindings (i.e.,
including NDIS IM filter drivers…)
Good luck,
Thomas F. Divine
PCAUSA - Toolkits & Resources For Network Software Developers
NDIS Protocol - NDIS Intermediate - TDI Client
http: - http:
----- Original Message -----
From:
To: NT Developers Interest List
Sent: Friday, January 26, 2001 4:14 PM
Subject: [ntdev] EnumComponents problem
> I am trying to write a notify object for a network card. In my notify
> object, I would like to list all of the currently installed network
> adapters. I am using the INetCfg interface to get an enumeration of the
> network devices. I use EnumComponents to get this enumeration. The
> problem I have is that this enumeration gives me every network adapter
that
> has ever been installed in the machine. I want to know what devices are
> currently installed.
>
> Am I going about this in the wrong way? How can I get a list of the
> currently installed network adapters?
>
> Thanks,
> John
—
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com</http:></http:>
Thanks for the answer, Thomas. But I am using the netcfg example. In
fact, I copy and pasted most of the code from the HrShowNetComponents
function in snetcfg.cpp, with some slight modifications. It enumerates
every device ever installed. I just want to see the ones currently
installed. I’m guessing that the INetCfg interface is just a clean
interface to see into the network part of the registry. Is that true?
Even if it is, the registry should still be aware of what is installed and
what is not.
I guess I’m trying to avoid going through the PCI bus and seeing what is
plugged in. Is there an easy interface to that, or am I just going to
complicate things.
Thanks for talking to the newbie.
John
“Thomas F. Divine”
To: “NT Developers Interest List”
Sent by:
xxxxx@lis cc:
ts.osr.com Subject: [ntdev] Re: EnumComponents
problem
01/26/2001 03:58 PM
Please respond to “NT
Developers Interest
List”
Take a look at the SetupDi API. An example is in the Windows 2000 DDK at
‘…\src\network\config\netcfg’.
Most of the Microsoft APIs actually seem weak on the topic of simply
“enumerating adapters”. Even worse when you say that you want to list both
“real” adapters as well as “virtual” adapters (from a NDIS IM). Even with
the SetupDi API I haven’t found a way to view “true” adapter bindings
(i.e.,
including NDIS IM filter drivers…)
Good luck,
Thomas F. Divine
PCAUSA - Toolkits & Resources For Network Software Developers
NDIS Protocol - NDIS Intermediate - TDI Client
http: - http:
----- Original Message -----
From:
To: NT Developers Interest List
Sent: Friday, January 26, 2001 4:14 PM
Subject: [ntdev] EnumComponents problem
> I am trying to write a notify object for a network card. In my notify
> object, I would like to list all of the currently installed network
> adapters. I am using the INetCfg interface to get an enumeration of the
> network devices. I use EnumComponents to get this enumeration. The
> problem I have is that this enumeration gives me every network adapter
that
> has ever been installed in the machine. I want to know what devices are
> currently installed.
>
> Am I going about this in the wrong way? How can I get a list of the
> currently installed network adapters?
>
> Thanks,
> John
—
You are currently subscribed to ntdev as: xxxxx@phobos.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
—
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com</http:></http:>
Try to examine device status using CM_Get_DevNode_Status() function. It
should be possible to distinguish working adapters from others. I’m not
quite sure now, but think that DN_DRIVER_LOADED with DN_HAS_PROBLEM and
actual problem value should be enough to find if adapter is working or not.
Best regards,
Michal Vodicka
Veridicom
(RKK - Skytale)
[WWW: http://www.veridicom.com , http://www.skytale.com]
From: xxxxx@phobos.com[SMTP:xxxxx@phobos.com]
Reply To: NT Developers Interest List
Sent: Saturday, January 27, 2001 12:46 AM
To: NT Developers Interest List
Subject: [ntdev] Re: EnumComponents problem
Thanks for the answer, Thomas. But I am using the netcfg example. In
fact, I copy and pasted most of the code from the HrShowNetComponents
function in snetcfg.cpp, with some slight modifications. It enumerates
every device ever installed. I just want to see the ones currently
installed. I’m guessing that the INetCfg interface is just a clean
interface to see into the network part of the registry. Is that true?
Even if it is, the registry should still be aware of what is installed and
what is not.
I guess I’m trying to avoid going through the PCI bus and seeing what is
plugged in. Is there an easy interface to that, or am I just going to
complicate things.
Thanks for talking to the newbie.
John
“Thomas F. Divine”
To: “NT Developers
> Interest List”
> Sent by:
>
> xxxxx@lis cc:
>
> ts.osr.com Subject: [ntdev] Re:
> EnumComponents
> problem
>
>
>
> 01/26/2001 03:58 PM
>
> Please respond to “NT
>
> Developers Interest
>
> List”
>
>
>
>
>
>
>
>
>
> Take a look at the SetupDi API. An example is in the Windows 2000 DDK at
> ‘…\src\network\config\netcfg’.
>
> Most of the Microsoft APIs actually seem weak on the topic of simply
> “enumerating adapters”. Even worse when you say that you want to list both
> “real” adapters as well as “virtual” adapters (from a NDIS IM). Even with
> the SetupDi API I haven’t found a way to view “true” adapter bindings
> (i.e.,
> including NDIS IM filter drivers…)
>
> Good luck,
>
> Thomas F. Divine
>
> PCAUSA - Toolkits & Resources For Network Software Developers
> NDIS Protocol - NDIS Intermediate - TDI Client
> http: - http:
>
> ----- Original Message -----
> From:
> To: NT Developers Interest List
> Sent: Friday, January 26, 2001 4:14 PM
> Subject: [ntdev] EnumComponents problem
>
>
> > I am trying to write a notify object for a network card. In my notify
> > object, I would like to list all of the currently installed network
> > adapters. I am using the INetCfg interface to get an enumeration of the
> > network devices. I use EnumComponents to get this enumeration. The
> > problem I have is that this enumeration gives me every network adapter
> that
> > has ever been installed in the machine. I want to know what devices are
> > currently installed.
> >
> > Am I going about this in the wrong way? How can I get a list of the
> > currently installed network adapters?
> >
> > Thanks,
> > John
>
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@phobos.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
>
>
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@rkk.cz
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
—
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com</http:></http:>
Michal,
Thanks! You put me on the right path. In order to use the
CM_Get_DevNode_Status() function, I had to use the CM_Locate_DevNode()
function. The results of CM_Locate_DevNode() gave me what I needed.
Thanks again,
John
“Vodicka, Michal”
To: “NT Developers Interest List”
Sent by:
xxxxx@lis cc:
ts.osr.com Subject: [ntdev] Re: EnumComponents problem
01/26/2001 04:58 PM
Please respond to “NT
Developers Interest
List”
Try to examine device status using CM_Get_DevNode_Status() function. It
should be possible to distinguish working adapters from others. I’m not
quite sure now, but think that DN_DRIVER_LOADED with DN_HAS_PROBLEM and
actual problem value should be enough to find if adapter is working or not.
Best regards,
Michal Vodicka
Veridicom
(RKK - Skytale)
[WWW: http://www.veridicom.com , http://www.skytale.com]
> ----------
> From: xxxxx@phobos.com[SMTP:xxxxx@phobos.com]
> Reply To: NT Developers Interest List
> Sent: Saturday, January 27, 2001 12:46 AM
> To: NT Developers Interest List
> Subject: [ntdev] Re: EnumComponents problem
>
>
> Thanks for the answer, Thomas. But I am using the netcfg example. In
> fact, I copy and pasted most of the code from the HrShowNetComponents
> function in snetcfg.cpp, with some slight modifications. It enumerates
> every device ever installed. I just want to see the ones currently
> installed. I’m guessing that the INetCfg interface is just a clean
> interface to see into the network part of the registry. Is that true?
> Even if it is, the registry should still be aware of what is installed
and
> what is not.
>
> I guess I’m trying to avoid going through the PCI bus and seeing what is
> plugged in. Is there an easy interface to that, or am I just going to
> complicate things.
>
> Thanks for talking to the newbie.
>
> John
>
>
>
>
> “Thomas F. Divine”
>
> To: “NT Developers
> Interest List”
> Sent by:
>
> xxxxx@lis cc:
>
> ts.osr.com Subject: [ntdev] Re:
> EnumComponents
> problem
>
>
>
> 01/26/2001 03:58 PM
>
> Please respond to “NT
>
> Developers Interest
>
> List”
>
>
>
>
>
>
>
>
>
> Take a look at the SetupDi API. An example is in the Windows 2000 DDK at
> ‘…\src\network\config\netcfg’.
>
> Most of the Microsoft APIs actually seem weak on the topic of simply
> “enumerating adapters”. Even worse when you say that you want to list
both
> “real” adapters as well as “virtual” adapters (from a NDIS IM). Even with
> the SetupDi API I haven’t found a way to view “true” adapter bindings
> (i.e.,
> including NDIS IM filter drivers…)
>
> Good luck,
>
> Thomas F. Divine
>
> PCAUSA - Toolkits & Resources For Network Software Developers
> NDIS Protocol - NDIS Intermediate - TDI Client
> http: - http:
>
> ----- Original Message -----
> From:
> To: NT Developers Interest List
> Sent: Friday, January 26, 2001 4:14 PM
> Subject: [ntdev] EnumComponents problem
>
>
> > I am trying to write a notify object for a network card. In my notify
> > object, I would like to list all of the currently installed network
> > adapters. I am using the INetCfg interface to get an enumeration of
the
> > network devices. I use EnumComponents to get this enumeration. The
> > problem I have is that this enumeration gives me every network adapter
> that
> > has ever been installed in the machine. I want to know what devices
are
> > currently installed.
> >
> > Am I going about this in the wrong way? How can I get a list of the
> > currently installed network adapters?
> >
> > Thanks,
> > John
>
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@phobos.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
>
>
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@rkk.cz
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
—
You are currently subscribed to ntdev as: xxxxx@phobos.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
—
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com</http:></http:>
John,
good to know. I’m not quite sure if CM_Locate_DevNode() should be used, some
CM functions are marked obsolete. I’m using series of SetupDi functions for
this purpose. SetupDiGetClassDevs() -> SetupDiEnumDeviceInfo() ->
PSP_DEVINFO_DATA and DevInst member can be used as a parameter for
CM_Get_DevNode_Status(). I read misc device properties using
SetupDiGetDeviceRegistryProperty() to filter and find necessary devices.
Anyway, results are probably equal
Michal
Best regards,
Michal Vodicka
Veridicom
(RKK - Skytale)
[WWW: http://www.veridicom.com , http://www.skytale.com]
From: xxxxx@phobos.com[SMTP:xxxxx@phobos.com]
Reply To: NT Developers Interest List
Sent: Tuesday, January 30, 2001 9:41 PM
To: NT Developers Interest List
Subject: [ntdev] Re: EnumComponents problem
Michal,
Thanks! You put me on the right path. In order to use the
CM_Get_DevNode_Status() function, I had to use the CM_Locate_DevNode()
function. The results of CM_Locate_DevNode() gave me what I needed.
Thanks again,
John
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com