|
-
May 22nd, 2002, 06:12 PM
#2
Code
I can't help with the timers try looking at the INTEL web site.... or ask there support team about it..
now the CPU ID i can do..
bool CMyClass::HasCpuSeiralNumber()
{
#if _DEBUG
return true;
#else
DWORD Flag=0l;
DWORD Test=0x20000;
__asm
{
MOV EAX,01H
CPUID
MOV Flag,EDX
}
if((Flag & Test)==Test) // CPUID Supported
return true;
return false;
#endif
}
CString CMyClass::GetCpuSeiralNumber()
{
DWORD _Hi,_Mid,_Low;
_Hi=_Mid=_Low=0x0;
__asm
{
MOV EAX, 01H
CPUID
MOV _Hi, EAX
MOV EAX, 03H
CPUID
MOV _Low, ECX
MOV _Mid, EDX
}
DWORD H1,H2,M1,M2,L1,L2;
H1=H2=M1=M2=L1=L2=0x0;
H1=HIWORD(_Hi);
H2=LOWORD(_Hi);
M1=HIWORD(_Mid);
M2=LOWORD(_Mid);
L1=HIWORD(_Low);
L2=LOWORD(_Low);
CString Temp;
Temp.Format("%04X-%04X-%04X-%04X-%04X-%04X",H1,H2,M1,M2,L1,L2);
return Temp;
}
Have fun
Tony
Programming better that Sex? Well dose depend on who with!!
If you found this item to be useful please rate it.....
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|