🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #5445

Re: MAC address of network adapter

#5445
From: JF Jolin
Date: Mon, 15 Aug 2005 19:59
36 lines
1769 bytes
Berlani <jc.berlani@vacotec.ch> wrote:

> I already write a program which use the function GetAdaptersInfo()  and I
> used it on many computers. But on one new computer type which use Windows 
> XP
> too, this
> function give me a wrong MAC address . Then I look on microsoft site at 
> the
> following address :
>
>
> http://msdn.microsoft.com/library/default.asp?url=/library/en- 
> us/iphlp/iphlp/getadaptersinfo.asp
>

The code snippet from that page may not be accurate.

Replace:

printf("\tAdapter Addr: \t%ld\n", pAdapter->Address);


With:

printf("\tAdapter Addr: \t");
for (int i = 0; i < (int) pAdapter->AddressLength; i++)
   printf("%02X ", (BYTE) pAdapter->Address[i]);
printf("\n");


The web site where i saw that adjustment is:
http://www.voidnish.com/FreeTools.aspx


-- 
JF Jolin
Technical Details
Message-ID: <opsvke5wenz6rw7b@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <42ff3a2c$1@newsgroups.borland.com> <42ff6b2e@newsgroups.borland.com> <430047fb$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,d63a53bd7cd0d405
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: MAC address of network adapter
References: <42ff3a2c$1@newsgroups.borland.com> <42ff6b2e@newsgroups.borland.com> <430047fb$1@newsgroups.borland.com>
Message-ID: <opsvke5wenz6rw7b@newsgroups.borland.com>
Content-Type: text/plain; charset=iso-8859-15; format=flowed
From: JF Jolin <jfj@nospam.com>
MIME-Version: 1.0
Date: Mon, 15 Aug 2005 15:59:46 -0400
User-Agent: Opera7.11/Win32 M2 build 2887
NNTP-Posting-Host: 66.158.141.146
X-Trace: newsgroups.borland.com 1124136000 66.158.141.146 (15 Aug 2005 13:00:00 -0700)
Lines: 36
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail