Article View: borland.public.cppbuilder.nativeapi
Article #9315Follow-up - Get MAC address + Netbios
From: Mike Collins
Date: Thu, 15 Jul 2004 12:58
Date: Thu, 15 Jul 2004 12:58
22 lines
2091 bytes
2091 bytes
I all, posted a couple of days ago regarding getting a MAC address using Netbios and GetAdapterInfo. Decided against using GetAdapterInfo as I don't like statically linking in DLL's and I couldn't be fashed with dynamically loading etc. Anyway, re-read the MSDN documentation and re-coded the function and all seems well. But.... When I instanciate an occurance of the structure LANA_ENUM, called AdapterList and check it's length, - which should indicate the number of valid adapter entries, I get the value of 8 returned. I then call Netbios for each value. The first four values seem to make the Netbios return an error indicating invalid values. The next three value all return the same MAC address and finally the last value returns the MAC address of my WiFi card (which is what I want). I assume the previous value must be pusodo-adapter / MAC address for things such as dial-ups and VPN's etc. What I need to do is get the MAC address of the first or default NIC in the list - so basically is there anyway to test what kind of adapter Netbios is returning? Many thanks in advance, Mikec
Technical Details
Message-ID:
<40f67d04@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news2.google.com!news.maxwell.syr.edu!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,a91e1e6bea0334ae,start X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit Reply-To: "Mike Collins" <mikec@kr8.co.uk> From: "Mike Collins" <mikec@kr8.co.uk> Newsgroups: borland.public.cppbuilder.nativeapi Subject: Follow-up - Get MAC address + Netbios Date: Thu, 15 Jul 2004 13:58:00 +0100 Lines: 25 Organization: kr8 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 NNTP-Posting-Host: 82.39.123.106 Message-ID: <40f67d04@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1089895684 82.39.123.106 (15 Jul 2004 05:48:04 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news2.google.com!news.maxwell.syr.edu!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail