Advertisement

05.13.2008 at 11:37PM PDT, ID: 23400436
[x]
Attachment Details

Mac Address problem on Vista

Asked by UdiRaz in C++ Programming Language, Windows Vista

Tags:

Hi,
I am using a mac address as part of a license key. On activation process I take the first ethernet mac adress and create a key for the user. Each time the user opens my app, i check all possible computer's mac address and if one is match, then it is ok.

Vista users complain that their application is locked after some days, or weeks.
Is it possible that on vista the same ethernet adapter will change it mac address?

Thanks
Udi RazStart Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
CString CActivationManager::GetMACaddress(int indx)
{
	IP_ADAPTER_INFO AdapterInfo[16];       // Allocate information
	// for up to 16 NICs
	DWORD dwBufLen = sizeof(AdapterInfo);  // Save memory size of buffer
 
	DWORD dwStatus = GetAdaptersInfo(      // Call GetAdapterInfo
		AdapterInfo,                 // [out] buffer to receive data
		&dwBufLen);                  // [in] size of receive data buffer
 
	if (!dwStatus == ERROR_SUCCESS) // Verify return value is
		return _T("ERR");
 
	// valid, no buffer overflow
	PIP_ADAPTER_INFO pAdapterInfo = AdapterInfo; // Contains pointer to
	// current adapter info
	CString macAddressStr;
	int num = 0;
	do 
	{
		if  ( pAdapterInfo->Type == 6 )
		{
			macAddressStr.Format(_T("%02X-%02X-%02X-%02X-%02X-%02X"), 
				pAdapterInfo->Address[0], pAdapterInfo->Address[1], pAdapterInfo->Address[2], 
				pAdapterInfo->Address[3], pAdapterInfo->Address[4], pAdapterInfo->Address[5]);
 
			if ( pAdapterInfo->Address[1] == pAdapterInfo->Address[2] && 
				 pAdapterInfo->Address[1] == pAdapterInfo->Address[3] &&
				 pAdapterInfo->Address[1] == pAdapterInfo->Address[4] )
			{
				indx++;
			}
			else
			{
				if (num == indx)
					return macAddressStr;
			}
		}
		else
		{
			indx++;
		}
	
		pAdapterInfo = pAdapterInfo->Next;    // Progress through
		num++;
		// linked list
	}
	while(pAdapterInfo);                    // Terminate if last adapter
 
	return _T("");
}
[+][-]05.14.2008 at 06:10AM PDT, ID: 21563712

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.14.2008 at 06:14AM PDT, ID: 21563757

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.14.2008 at 06:18AM PDT, ID: 21563796

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.14.2008 at 06:26AM PDT, ID: 21563875

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.14.2008 at 06:41AM PDT, ID: 21564024

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.14.2008 at 06:47AM PDT, ID: 21564101

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.14.2008 at 06:58AM PDT, ID: 21564233

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.14.2008 at 07:08AM PDT, ID: 21564352

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.14.2008 at 07:12AM PDT, ID: 21564391

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.14.2008 at 10:21AM PDT, ID: 21566517

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: C++ Programming Language, Windows Vista
Tags: c++, MFC
Sign Up Now!
Solution Provided By: Gurudenis
Participating Experts: 2
Solution Grade: B
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628