Exemplo n.º 1
0
CString GetCPUName()
{
	CString Response;
	CPUInfo cpu;
	if (cpu.DoesCPUSupportCPUID())
	{
		Response = cpu.GetExtendedProcessorName();
	}
	
	if(Response.GetLength() == 0) {
		Response = "Not Detected";
	}
	Response.TrimLeft();
	Response.TrimRight();

	return "\nProcessor:\n" + Response + "\n";
}
Exemplo n.º 2
0
DWORD WINAPI GetProcessorInformation (LPVOID lpParameter)
{
	PPROCESSORINFO pProcessorInfo = (PPROCESSORINFO) lpParameter;
	CPUInfo * CPU = new CPUInfo ();
				
	if (!CPU->DoesCPUSupportCPUID ()) 
	{			
		delete CPU;			
		return 0;
	}
		
	//the processor serial number.
	if (CPU->DoesCPUSupportFeature (SERIALNUMBER_FEATURE)) 
	{
		sprintf_s(pProcessorInfo->szSerialNumber, CPU->GetProcessorSerialNumber());
	}
			
	// Add the hardware specification node.		
	// State the APIC ID if one is present.
	if (CPU->DoesCPUSupportFeature (APIC_FEATURE)) 
	{				
		pProcessorInfo->bAPICPresent = true;		
		// Attempt to display the ID of the APIC.
		pProcessorInfo->APICID = CPU->GetProcessorAPICID ();
	}

	// State if the processor supports the Advanced Configuration and Power Interface [ACPI].
	if (CPU->DoesCPUSupportFeature (ACPI_FEATURE)) 
	{
		pProcessorInfo->bACPICapable = true;
	}
			
	// State if the processor supports a thermal monitor.
	if (CPU->DoesCPUSupportFeature (THERMALMONITOR_FEATURE))
	{
		pProcessorInfo->bOnChipThermalMonitor = true;
	}

	
	if (CPU->DoesCPUSupportFeature (L1CACHE_FEATURE)) 
	{
		pProcessorInfo->bL1Cache = true;
		pProcessorInfo->L1CacheSize = CPU->GetProcessorCacheXSize (L1CACHE_FEATURE);
	}

	// State the size of the L2 cache if present.
	if (CPU->DoesCPUSupportFeature (L2CACHE_FEATURE)) 
	{
		pProcessorInfo->bL2Cache = true;
		pProcessorInfo->L2CacheSize = CPU->GetProcessorCacheXSize (L2CACHE_FEATURE);
	}

	// State the size of the L3 cache if present.
	if (CPU->DoesCPUSupportFeature (L3CACHE_FEATURE)) 
	{
		pProcessorInfo->bL3Cache = true;
		pProcessorInfo->L3CacheSize = CPU->GetProcessorCacheXSize (L3CACHE_FEATURE);
	}
							
	// State if a temperature sensing diode is present.
	if (CPU->DoesCPUSupportFeature (TEMPSENSEDIODE_FEATURE)) 
	{
		pProcessorInfo->bTemperatureSensingDiode = true;
	}

	// State if a frequency ID control is present.
	if (CPU->DoesCPUSupportFeature (FREQUENCYID_FEATURE)) 
	{				
		pProcessorInfo->bFrequencyIDControl = true;	
	}

	// State if a voltage ID control is present.
	if (CPU->DoesCPUSupportFeature (VOLTAGEID_FREQUENCY)) 
	{
		pProcessorInfo->bVoltageIDControl = true;
	}
	
//Supported Features
	
	// State if CMOV instructions are present.
	if (CPU->DoesCPUSupportFeature (CMOV_FEATURE)) 
	{
		pProcessorInfo->bCMOVInstructions = true;
	}

	// State if MTRR instructions are present.
	if (CPU->DoesCPUSupportFeature (MTRR_FEATURE)) 
	{	
		pProcessorInfo->bMTRRInstructions = true;
	}

	// State if MMX instructions are present.
	if (CPU->DoesCPUSupportFeature (MMX_FEATURE)) 
	{
		pProcessorInfo->bMMXInstructions = true;
	}

	// State if MMX+ instructions are present.
	if (CPU->DoesCPUSupportFeature (MMX_PLUS_FEATURE)) 
	{		
		pProcessorInfo->bMMXPlusInstructions = true;
	}

	// State if SSE instructions are present.
	if (CPU->DoesCPUSupportFeature (SSE_FEATURE)) 
	{
		pProcessorInfo->bSSEInstructions = true;
	}

	// State if SSE FP instructions are present.
	if (CPU->DoesCPUSupportFeature (SSE_FP_FEATURE)) 
	{
		pProcessorInfo->bSSEFPInstructions = true;
	}

	// State if SSE MMX instructions are present.
	if (CPU->DoesCPUSupportFeature (SSE_MMX_FEATURE)) 
	{
		pProcessorInfo->bMMXInstructions = true;
	}

	// State if SSE2 instructions are present.
	if (CPU->DoesCPUSupportFeature (SSE2_FEATURE)) 
	{
		pProcessorInfo->bSSE2Instructions = true;
	}

	// State if 3DNow! instructions are present.
	if (CPU->DoesCPUSupportFeature (AMD_3DNOW_FEATURE)) 
	{
		pProcessorInfo->bAMD3DNowInstructions = true;
	}

	// State if 3DNow!+ instructions are present.
	if (CPU->DoesCPUSupportFeature (AMD_3DNOW_PLUS_FEATURE)) 
	{
		pProcessorInfo->bAMD3DNowPlusInstructions = true;
	}

	// State if Hyperthreading instructions are present.
	if (CPU->DoesCPUSupportFeature (HYPERTHREAD_FEATURE)) 
	{
		pProcessorInfo->bHyperthreadingInstructions = true;
		pProcessorInfo->LogicalProcessorsPerPhysical = CPU->GetLogicalProcessorsPerPhysical ();
	}

	// State if the processor is MP capable.
	if (CPU->DoesCPUSupportFeature (MP_CAPABLE)) 
	{
		pProcessorInfo->bMultiprocessorCapable = true;
	}

	// State if IA64 instructions are present.
	if (CPU->DoesCPUSupportFeature (IA64_FEATURE)) 
	{
		pProcessorInfo->bIA64Instructions = true;
	}	
	
	delete CPU;

	return 0;	
}