Article ID: 124207
Article Last Modified on 11/21/2006
BOOL IsCoProcessorPresent(void)
{
#define MY_ERROR_WRONG_OS 0x20000000
HKEY hKey;
SYSTEM_INFO SystemInfo;
// return FALSE if we are not running under Windows NT
// this should be expanded to cover alternative Win32 platforms
if(!(GetVersion() & 0x7FFFFFFF))
{
SetLastError(MY_ERROR_WRONG_OS);
return(FALSE);
}
// we return TRUE if we're not running on x86
// other CPUs have built in floating-point, with no registry entry
GetSystemInfo(&SystemInfo);
if((SystemInfo.dwProcessorType != PROCESSOR_INTEL_386) &&
(SystemInfo.dwProcessorType != PROCESSOR_INTEL_486) &&
(SystemInfo.dwProcessorType != PROCESSOR_INTEL_PENTIUM))
{
return(TRUE);
}
if(RegOpenKeyEx(HKEY_LOCAL_MACHINE,
"HARDWARE\\DESCRIPTION\\System\\FloatingPointProcessor",
0,
KEY_EXECUTE,
&hKey) != ERROR_SUCCESS)
{
// GetLastError() will indicate ERROR_RESOURCE_DATA_NOT_FOUND
// if we can't find the key. This indicates no coprocessor present
return(FALSE);
}
RegCloseKey(hKey);
return(TRUE);
}
Additional query words: 3.10 3.50 4.00 x87 math co-processor coprocessor
Keywords: kbcode kbfloatpoint kbinfo kbkernbase kbregistry KB124207