MAC address

Hi. How can I get MAC address of my NIC from user application without
NetBios? I guess I should use one of NDIS device control codes such as
IOCTL_NDIS_ENUMERATE_INTERFACES and send it to NDIS driver. Is that
possible?
Thanks

  • MB

> Hi. How can I get MAC address of my NIC from user application without

NetBios? I guess I should use one of NDIS device control codes such as
IOCTL_NDIS_ENUMERATE_INTERFACES and send it to NDIS driver. Is that
possible?
Thanks

GetIfTable/GetIfEntry from the IP helper API should do what you want.
You’ll need something to key off – perhaps the NIC description.

The bPhysAddr attribute of the MIB_IFROW structure will hold the MAC
address.

Enumerate by using SetupDiGetClassDevs, then
DeviceIoControl/IOCTL_NDIS_QUERY_GLOBAL_STATS/OID_802_3_CURRENT_ADDDRESS.

WMI is also a way.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

----- Original Message -----
From: “Stanislav Kraev”
To: “Windows System Software Devs Interest List”
Sent: Tuesday, November 18, 2003 7:39 PM
Subject: [ntdev] MAC address

> Hi. How can I get MAC address of my NIC from user application without
> NetBios? I guess I should use one of NDIS device control codes such as
> IOCTL_NDIS_ENUMERATE_INTERFACES and send it to NDIS driver. Is that
> possible?
> Thanks
>
> - MB
>
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com

Have a look at the IP Helper APIs, specifically GetAdaptersInfo().

Mark.

At 05:48 PM 11/18/2003, Maxim S. Shatskih wrote:

Enumerate by using SetupDiGetClassDevs, then
DeviceIoControl/IOCTL_NDIS_QUERY_GLOBAL_STATS/OID_802_3_CURRENT_ADDDRESS.

WMI is also a way.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

----- Original Message -----
From: “Stanislav Kraev”
>To: “Windows System Software Devs Interest List”
>Sent: Tuesday, November 18, 2003 7:39 PM
>Subject: [ntdev] MAC address
>
>
> > Hi. How can I get MAC address of my NIC from user application without
> > NetBios? I guess I should use one of NDIS device control codes such as
> > IOCTL_NDIS_ENUMERATE_INTERFACES and send it to NDIS driver. Is that
> > possible?
> > Thanks
> >
> > - MB
> >
> >