Mail Archives: djgpp/2002/08/31/14:30:05
Hello.
Alex Vinokur wrote:
>
> "Richard Dawe" <rich AT phekda DOT freeserve DOT co DOT uk> wrote in message news:3D706C40 DOT 1C7B6085 AT phekda DOT freeserve DOT co DOT uk...
[snip]
> > You can use RegDos to read the registry on Windows '95, '98 and ME. Then
> > you can obtain the MAC address. See:
> >
> > http://www.phekda.freeserve.co.uk/richdawe/dl/winnetip.htm
>
> Here is a fragment of that file :
>
> ====== BEGIN ======
> Windows 2000
[snip]
> Network Cards
> Like Windows NT, Windows 2000 stores its configuration data in the registry. A list of network cards is stored under this key:
>
> HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkCards
>
> Each network card has a subkey with values. The "Description" value contains a human-friendly description. The "ServiceName" value
> contains a GUID (globally-unique identifier?) (cf. Windows NT, which has a name here).
>
> The IP data for the network card is then found off this key:
>
> HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces
>
> Each network has a key of the form "{GUID}", e.g. "{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}", where each "x" represents a hexidecimal
> digit. Each of the GUID keys has values for lease times, subnet masks and IP addresses. For IP addresses there are two possible
> values:
[snip]
> From where can I get MAC Address within my C/C++ program ?
It is possible that there is a MAC address under each {GUID}. I don't know - I
don't have Windows 2000.
Have you looked in the registry using regedit?
But I strongly suggest that you avoid using the registry.
> >
> > There are other methods, but they are for Windows programs. The Winsock
> > Programmer's FAQ details how.
> >
> > You could write a small helper Windows program to return the MAC address.
>
> The same question : From where can I get MAC Address within my C/C++ program ?
Read the Windows Programmer's FAQ. There is a FAQ on how to obtain MACs.
Regards,
--
Richard Dawe [ http://www.phekda.freeserve.co.uk/richdawe/ ]
- Raw text -