Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting MAC address 2

Status
Not open for further replies.

Eguy

Programmer
Dec 22, 2000
566
0
0
US
Hi all;

I need to create a UUID (Universal Unique ID) that will withstand 'Ghosting'. I currently generate a 36 byte UUID during install and store it in the registry and in a dbf for comparison at startup. This is fairly secure copy protection until you put Norton Ghost into the mix. My primitive ape brain thinks that using the MAC address of the network card would be more secure. However, I'll be dipped in @#$% if I can find a way to get it in VFP.

===> Note to rgbean <===
Rick;
I did a search in this forum and saw your thread from about a year ago. Unfortunatly some of the links mentioned are broken now. Did you ever solve your problem?

TIA
Ed Please let me know if the suggestion(s) I provide are helpful to you.
Sometimes you're the windshield... Sometimes you're the bug.
smallbug.gif
 
Ed,
Yes, I not only solved it, but have been successfully using the solution for over a year in hundreds of locations! While it uses a (free) 3rd party .OCX, I've shared it with 8-10 others on the newsgroups, and haven't heard any negative feedback. If you want it, I'll send it to you, just provide a e-mail address (feel free to make it so that the automated page scanners can pick it up for use SPAM use - e.g. ed AT somewhere NOSPAM DOT com).

Rick
 
Ed,
I'd be interested in seeing this one as well. I need to ping machines through VFP. Email to Ron_Getgen at westpharma . com.

Thanks
Ron
 
Thanks Rick;

Pls send to edwardATmicrotimeDOTcom

Ed Please let me know if the suggestion(s) I provide are helpful to you.
Sometimes you're the windshield... Sometimes you're the bug.
smallbug.gif
 
Ron and Ed,
Your copies of my GETMAC routine have been sent. Let me knmow if you have any questions or problems.

Rick
 
Hi guys! Just a mere conincidence, I also in need of that. If you don't mind, pls. email it to bongrobles@yahoo.com.

Thanks in advance,

VFP602
 
Dear sir,
I am interested in GETMAC routine. Can you send it to me at
nlok888 AT sinaman DOT com

Thanks a lot.
Norman
 
Dear Rick and Edward,

I received the zip files.
Thank you for your prompt reply.

Norman
 
Hey Guys,
I am interested in GETMAC routine and ocx file. Can you send it to me at aarauz@sinfo.net

TIA.
 
Could someone send me a copy of the getmac routeine and ocx as well. Please send to jmcfarlane@globalbeveragegroup.com

Thanks

Jason
 
Please send to Greywalk@yahoo.com as well.

Thanks,
Paul Dancing is easy. Now dancing on a floating raft in the middle of an October storm in the middle of the North Atlantic, that is hard.
 
Jason, Paul,
It's on it's way - I hope you find it useful too.

Rick
 
How about a solution that doesn't require anything Third-Party (except for certain MS stuff...): See faq184-3356
 
wgcs,
You'll note that this thread was started last year, so you &quot;snuck&quot; your code in since then! :)

While your code works OK on my XP Pro system, it fails to return anything on my Win98 SE system. I know it says it's suppose to work under 98, but is there anything that may cause problems?

Rick

Note: The OCX I use works under Win95 -> XP and VFP 5.0 -> 8.0.
 
Hi Rick,
I just added the FAQ because of seeing the recent post on this thread.

I really wish the FAQ's could be sorted by Creation Date/ Last edited date so we could easily see all the most recently added/changed FAQ's at a glance...

To figure out what's going wrong, just call the function with no parameters... it should create a cursor with all the contents of the IP info structure. BROWSE it to see how it differs from what the function is looking for.

I don't really know much about the IPHLPAPI.DLL ... probably installs with some service pack, or IE or something; the Comment Win98/2000 was in the original code from Rob444
 
It never gets to the cursor building code - It quit's on the 2nd GetAdaptersInfo() call. The version of iphlpapi.dll I have on 98 is 5.00.1952.1, where on XP it's 5.1.2600.2. The first comes with IE 5.0 and VS 6.0 SP4, and the 2nd only comes with XP according to the MS DLL Database - (The couple in between versions come with W2K and it's SPs.)

Rick
 
I didn't know that service existed! It's certaintly useful...

MSDN says the requirements for this function are:
Windows NT/2000 or later: Requires Windows 2000 or later.
Windows 95/98/Me: Requires Windows 98 or later.

What error code does the second call return?

The possible return values are, ERROR_SUCCESS (0) and:

(111) ERROR_BUFFER_OVERFLOW The buffer size indicated by the pOutBufLen parameter is too small to hold the adapter information. The pOutBufLen parameter points to the required size.

(87) ERROR_INVALID_PARAMETER The pOutBufLen parameter is NULL, or the calling process does not have read/write access to the memory pointed to by pOutBufLen, or the calling process does not have write access to the memory pointed to by the pAdapterInfo parameter.

(232) ERROR_NO_DATA No adapter information exists for the local computer.

(50) ERROR_NOT_SUPPORTED GetAdaptersInfo is not supported by the operating system running on the local computer.

Other If the function fails, use FormatMessage to obtain the message string for the returned error.

 
I just knew you were going to ask (it's the first thing I would have done, but I didn't have that system up earlier!). Well I'm getting back a 50 and the buffer size returned is 0 both times. Again, it's 98 SE with all the current patches and updates and I'm even running IE 6.0 with SP1 and all the security patches.

When I run Dependency Walker on that DLL, it shows 9 different functions all with the same Entry point - I'd bet none of them are supported in this 'old' version. An aside - the old one is just 27KB, where the latest one is 81KB and all those 9 functions have unique entry points here (not to mention there are quite a few more functions - 96 vs. 152!).

Maybe tommorow I'll try moving a copy of the XP .DLL over to the Win98SE system and see if that &quot;works&quot;.

Rick
 
Really strange! This was one of the reasons I posted the code: I wanted to see how reliable it was on different systems.

It's really frustrating when a function is defined in the DLL but not implemented!!

I was first thinking that there would likely be problems if TCP/IP wasn't installed on the computer: a NIC used with Token Ring or Netbeui still have MAC addresses to get, but their drivers might not implement a function like this that seems focused on (and defined just for) IP protocol.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top