[cw-discuss] Obtaining MAC Address while in xover office
Dan Phillips
wasilla at gmail.com
Wed Mar 7 11:12:00 CST 2007
Ok, I know this is a wierd routine to do but I have a program that grabs the
MAC address of a local network card. Actually, as long as the network card
is on the same subnet, you just tell the program the IP of that card and it
will get its MAC address.
I have a vmware session running XP and the program will obtain the vmware's
MAC address, the SuSE 9.2 Linux host eth0's MAC address, and it'll even get
the MAC address of my laptop's wireless card as long as the program runs
from within the vmware session. The problem comes in when trying to run the
program from the linux host through xover v6.0. The SendARP command reports
an error when run regardless of which IP address I use to lookup the MAC
address.
Here's a code snippet and the declaration showing where the routine is
stored, possibly this is an API call not yet implemented in xover or maybe
its implemented wrong or something (not trying to tell anyone else how to
program, I'm definitely not a programmer on a day to day basis, just trying
to get this working).
Oh, I failed to mention this is done in Visual Basic 6.x (patched)
Private Declare Function inet_addr Lib "wsock32.dll" _
(ByVal s As String) As Long
Private Declare Function SendARP Lib "iphlpapi.dll" _
(ByVal DestIP As Long, _
ByVal SrcIP As Long, _
pMacAddr As Long, _
PhyAddrLen As Long) As Long
Here is the command that generates the error:
If SendARP(dwRemoteIP, 0&, pMacAddr, PhyAddrLen) = NO_ERROR Then
Again, no code change, the program works perfectly within the vmware session
using XP.
Hints, Ideas, Gripes, shotty comments? :)
--
Thanks, Dan Phillips
Registered Linux User #373395
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://crossover.codeweavers.com/pipermail/discuss/attachments/20070307/5cac9c39/attachment-0001.htm
More information about the discuss
mailing list