Log in

View Full Version : Obtaining MAC address


paulzazzarino
03-16-2004, 04:54 PM
Anyone know of a f(x) to fetch the mac address of a mobile device
like ioctlsocket(sock, SIOCGIFHWADDR,...)

paulzazzarino
03-17-2004, 10:45 PM
got this from another forum, had to post it here as this will do it!

DWORD SendARP(IPAddr DestIP, IPAddr SrcIP, PULONG pMacAddr, PUONG PhyAddrLen);

use iphlpapi.h and iphlpapi.lib

pass in f("192.168.xxx.xxx", NULL, buf, buflen)
This f(x) pulled over from the platform SDK is only in some of the later versions of the SDKs (like HPC2000, smartphone and Mobile 4.0 and above)