About the MAC address of ethernet cards
Do any of you know how to get the MAC address of an ethernet card?
I'm developing a network app that needs to identify machines of a
network, not relying on their network name nor IP address.
Currently I'm using NetBIOS calls to get the MAC, but it seems that
sometimes (in some user sessions) the Netbios function returns junk in
the Netbios_AdapterStatus record.
This message can be considered as a warning for any of you using this
call: I think that the 30 names table is not enough big to hold the
response,
even when you set accordingly the ncb.bufferLength field.
I have converted the Win32.hlp's example 'Getting the MAC address for
an Ethernet Adapter' to Delphi 2, if you are interested.
Also, another warning: before using NetBIOS, I used the registry,
getting the MAC from the 'NetworkAddress' key. Do not rely on its contents,
as system administrators may use the 'Ghost' utility to backup entire
harddrives, or even change the network card without Windows 95 noticing.
In both cases, the registry key is not updated.
I'm also interested in the use of the NetSessionEnum call. I'm having
trouble trying to obtain a list of all the sessions opened by the users of
the network. I only need to know which user is using what computer. Please
give me advise about this, or if you know where can I find more information.
Thank you for your interest.
----------------
Manuel Gonzalez.
BRiNDYS Software.
http://www.eui.upv.es/brindys/default.htm