[Winpcap-users] Retireving MAC Address
Bryan Kadzban
bryan at kadzban.is-a-geek.net
Tue Jan 3 17:33:32 GMT 2006
On Tue, Jan 03, 2006 at 03:36:49PM +0100, Alessandro Baldisserri wrote:
> Hi!
>
> I'm using winpcap version 3.0.0.18
> I want to retrieve MAC Address from my net adapter. I use this code:
>
> res = PacketGetAdapterNames(adNameptstr,&nameSize);
> if (res==0) {
> // -----------------> MY ERROR IS THIS!!!!
> printf("ERROR in PacketGetAdapterNames\n");
> goto ip;
> }
What error are you getting? (See GetLastError().)
It may be related to PTSTR being a pointer-to-TCHAR (either Unicode or
ANSI character, depending on the setting of the UNICODE define when you
include the header file). Is nameSize maybe supposed to be the number
of TCHARs in the array, instead of the number of bytes?
I don't know whether that's the issue (it would depend on what error
number GetLastError() returns), but it's my first guess.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.winpcap.org/pipermail/winpcap-users/attachments/20060103/9dbaa16a/attachment.pgp
More information about the Winpcap-users
mailing list