Re: Get MAC address

Tech-Archive recommends: Fix windows errors by optimizing your registry



Arkady,

Obviously that should work even on Vista, but MSFT for years warning about
near deprecation of IOCTL_NDIS_QUERY_GLOBAL_STATS for security reasons.

Well, taking into consideration the fact that it is miniport driver and not
TCPIP.SYS who handles this request (which is optional anyway), as well as the
one that this IOCTL gets submitted to the standalone device that is not on
any stack, there is not that much that they can do about it, apart from
removing NdisMRegisterDevice(), i.e. dropping the support for standalone
devices. I don't think they want to go that far....

OTOH that give option to check MAC on local host only ( in addition to
GetIfTable()/GetIfEntry and GetAdaptersInfo )and that no what OP mean if I
understood him correctly.

The way I understood it, the OP was asking about the local host. Maybe I
just got it wrong.....

Anton Bassov


"Arkady Frenkel" wrote:

Obviously that should work even on Vista, but MSFT for years warning about
near deprecation of IOCTL_NDIS_QUERY_GLOBAL_STATS for security reasons.
OTOH that give option to check MAC on local host only ( in addition to
GetIfTable()/GetIfEntry and GetAdaptersInfo )and that no what OP mean if I
understood him correctly.
In that case in addition to Netbios ( may not work if it disabled ) and
SendARP() possible to use WMI's MACAddress property of Win32_NetworkAdapter
interface .

Arkady

"Anton Bassov" <AntonBassov@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:634A9F45-589A-410B-A3B2-A0651F90A19E@xxxxxxxxxxxxxxxx
I would rather open a handle to the target adapter with CreateFile(), and
then
send OID_XXX_PERMANENT_ADDRESS request to it with
IOCTL_NDIS_QUERY_GLOBAL_STATS .....

Names of all adapters TCPIP is bound to (i.e. the ones that can be passed
to
CreateFile() call) can be found under
HKLM \\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Adapters
key in the registry. First I would send OID_GEN_SUPPORTED_LIST request in
order to find all OIDs that adapter supports, and locate
OID_XXX_PERMANENT_ADDRESS
( OID!= OID_GEN_SUPPORTED_LIST && OID&0xffffff== OID_GEN_SUPPORTED_LIST).
At this point I would be able to send OID_XXX_PERMANENT_ADDRESS, and
obtain
the sought info....

Anton Bassov

"Andrew Chalk" wrote:

Is there a SDK or Platform API call that will return the MAC address(es)
in
a host?

Many thanks.






.



Relevant Pages

  • Re: Get MAC address
    ... reasons. ... TCPIP.SYS who handles this request, ... the OP was asking about the local host. ... Names of all adapters TCPIP is bound to (i.e. the ones that can be ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Get MAC address
    ... OTOH that give option to check MAC on local host only (in addition to ... Names of all adapters TCPIP is bound to (i.e. the ones that can be passed ... First I would send OID_GEN_SUPPORTED_LIST request in ...
    (microsoft.public.win32.programmer.kernel)