Anant said:
It doesn't work. Because lots of wifi adapter register itself as a
eathernet Adapter and they show their AdapterId 0 rather then 9.
Is their some other property, which will be unique to WIFI adapter. Or
some other class, which i can query for WIFI adapters.
Anant
To distinguish between differnet types of network cards you can query
the MSNdis_PhysicalMediumType class.
It will return the following classification (taken from ntddndis.h):
typedef enum _NDIS_PHYSICAL_MEDIUM
{
NdisPhysicalMediumUnspecified,
NdisPhysicalMediumWirelessLan,
NdisPhysicalMediumCableModem,
NdisPhysicalMediumPhoneLine,
NdisPhysicalMediumPowerLine,
NdisPhysicalMediumDSL, // includes ADSL and UADSL (G.Lite)
NdisPhysicalMediumFibreChannel,
NdisPhysicalMedium1394,
NdisPhysicalMediumWirelessWan,
NdisPhysicalMediumNative802_11,
NdisPhysicalMediumBluetooth,
NdisPhysicalMediumMax // Not a real physical type, defined as
an upper-bound
} NDIS_PHYSICAL_MEDIUM, *PNDIS_PHYSICAL_MEDIUM;
Please notice that regular LAN cards do not appear in the list.
So I guess the right way to use it is to find all the 802.3 cards from
Win32_NetworkAdapter and then find their real type using this class. If
they don't have a class here, then they are regular 802.3 adapters.
BTW, more interesting information for WiFi cards can be found in
MSNdis_LinkSpeed, MSNdis_80211_ReceivedSignalStrength and
Win32_NetworkAdapterConfiguration (which is also for regular adapters).
You should investigate all the MSNdis_80211_* classes for more
information.
Hope this helps,
Joe.