Re: How to find actual media type of adapter?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



With pleasure, btw in Windows CE you can use
IOCTL_NDISUIO_QUERY_OID_VALUE because
IOCTL_NDIS_QUERY_GLOBAL_STATS absent there
Arkady

"Norman Diamond" <ndiamond@xxxxxxxxxxxxxxxx> wrote in message
news:Ozu$4pJeGHA.2456@xxxxxxxxxxxxxxxxxxxxxxx
Thank you. Yesterday the closest thing I found was
IOCTL_NDISUIO_NIC_STATISTICS. Either way, this brings us halfway to the
information that we need. Thank you.

"Arkady Frenkel" <arkadyf@xxxxxxxxxxxxxxxx> wrote in message
news:eWny3RAeGHA.3888@xxxxxxxxxxxxxxxxxxxxxxx
Use DeviceIOControl() with IOCTL_NDIS_QUERY_GLOBAL_STATS to retrieve OID
data
Arkady

"Norman Diamond" <ndiamond@xxxxxxxxxxxxxxxx> wrote in message
news:OiCz7R9dGHA.5016@xxxxxxxxxxxxxxxxxxxxxxx
"Pavel A." <pavel_a@xxxxxxxxxxxxxxx> wrote in message
news:BC96E651-51B6-4740-BFF6-5E349EA21F24@xxxxxxxxxxxxxxxx
"Norman Diamond" wrote:
As far as I can tell, in page
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/win32_networkadapter.asp
the AdapterTypeID member has the same meaning as in some of the APIs.
Possible values include 9 for wireless and 10 for infrared wireless.
I
don't see any distinct value for Bluetooth.

The values you're talking about here, are NDIS_MEDIUM enum defined in
ntddndis.h.
NdisMediumWirelessWan = 9 ( 0-based)
NdisMediumIrda = 10 ( 0-based)
Now, in this enum, NdisMediumWirelessWan does not mean wi-fi (802.11);
also there is no value for bluetooth.

So that MSDN page was really useless for me. Thank you for confirming
that,
and let's continue.

The next enum, NDIS_PHYSICAL_MEDIUM is used to distinguish the real
physical medium for all netcards that use 802.3 data frame, or are - as
you call it - "simulated Ethernet".
NdisPhysicalMediumUnspecified = 0 (true ethernet or unknown)
NdisPhysicalMediumWirelessLan = 1 (this stands for wi-fi)
NdisPhysicalMediumBluetooth = 10 ( bluetooth)
This enum corresponds to OID_GEN_PHYSICAL_MEDIUM

Yes, that's what I need! In MSDN I couldn't find NDIS_PHYSICAL_MEDIUM
but
could find OID_GEN_PHYSICAL_MEDIUM. But OID_GEN_PHYSICAL_MEDIUM
seems to be available only at the driver level and only in Windows CE.
I need to get this information at the application level and get it in
both Windows CE and Windows XP.

and WMI class MSNdis_PhysicalMediumType.

That will take some studying, to see how WMI gets it from the driver.

I don't see any reasonable value for the simulated Ethernet adapter
which ActiveSync creates for a connection to a Windows CE device.

This is yet another driver type called "Remote NDIS". Currently AFAIK
MSFT
supports only USB version of RNDIS. The NdisPhysicalMedium of such
driver
probably depends on it's real medium type - that can very well be
"unspecified". In this case there is no generic way to detect physical
medium on the *network* side.

However detecting if the *computer* side connection is USB it is quite
easy when you know the PNPDeviceID of the adapter (for example from
enumarating instances of Win32_NetworkAdapter or SetupDi)

I'll have to think about that. If there's a USB cable running all the
way
to the device then there's no physical medium on the network side, and
we
want to recognize this as a USB connection. If there's a USB connection
to
a WiFi or Bluetooth adapter then we want to recognize that the physical
medium is WiFi or Bluetooth. ActiveSync 4.1 no longer operates over
WiFi
but it still operates over Bluetooth, and we want to know if Bluetooth
is
being used, even though the endpoint on the computer side is a USB port.

Your other message asked why we want to know. I don't think I'm allowed
to
answer that, but but can give a hint. ActiveSync 3.8 operated over WiFi
but
4.1 doesn't. The top-level basic reason is for security, but at the
next
level the reason is by administrative decision. Even though it's
technically possible to make an ActiveSync program that will continue
operating over WiFi, the administrative decision was not to do it.






.



Relevant Pages

  • Re: How to find actual media type of adapter?
    ... don't see any distinct value for Bluetooth. ... physical medium for all netcards that use 802.3 data frame, ... However detecting if the *computer* side connection is USB it is quite ... medium is WiFi or Bluetooth. ...
    (microsoft.public.win32.programmer.networks)
  • Re: How to find actual media type of adapter?
    ... don't see any distinct value for Bluetooth. ... physical medium for all netcards that use 802.3 data frame, ... However detecting if the *computer* side connection is USB it is quite ... medium is WiFi or Bluetooth. ...
    (microsoft.public.win32.programmer.networks)
  • Re: How to find actual media type of adapter?
    ... don't see any distinct value for Bluetooth. ... physical medium for all netcards that use 802.3 data frame, ... However detecting if the *computer* side connection is USB it is quite ... medium is WiFi or Bluetooth. ...
    (microsoft.public.win32.programmer.networks)
  • ACM modem.
    ... into the USB connector, the respective message was appeared in ... The same phone works via "bluetooth" under Windows-98 as GPRS modem. ... Is it a trouble with Linux, with USB or with some secret feature of the phone? ... The respective driver suggests newer Windows. ...
    (comp.os.linux.hardware)
  • Re: How to find actual media type of adapter?
    ... Hmm now I don't understand how ActiveSync 4.1+ works over BT ... don't see any distinct value for Bluetooth. ... However detecting if the *computer* side connection is USB it is quite ... medium is WiFi or Bluetooth. ...
    (microsoft.public.win32.programmer.networks)