잠토의 잠망경

GetySysInfo 시스템의 정보를 얻기위한 api 본문

공부/API

GetySysInfo 시스템의 정보를 얻기위한 api

잠수함토끼 2008. 9. 6. 17:29
#include
#include

//ms-help://MS.MSDNQTR.v90.ko/sysinfo/base/system_info_str.htm


int main(void)
{
	SYSTEM_INFO wonSystem_info;
		
	GetSystemInfo(&wonSystem_info);

	printf("My System Info\n");
	//The processor architecture. This member can be one of the following values.
	printf("CPU: ");
	switch (wonSystem_info.wProcessorArchitecture)
	{
	case PROCESSOR_ARCHITECTURE_AMD64: printf("x64(AMD or Intel");break;
	case PROCESSOR_ARCHITECTURE_IA64: printf("IPF");break;
	case PROCESSOR_ARCHITECTURE_INTEL: printf("x86");break;
	case PROCESSOR_ARCHITECTURE_UNKNOWN: printf("Unknown processor");break;
	default:
		break;
	}
	printf("\n");
	//The page size and the granularity of page protection and commitment. This is the page size used by the VirtualAlloc function.
	printf("Page Size: %d", wonSystem_info.dwPageSize);	
	printf("\n");
	
	//A pointer to the lowest memory address accessible to applications and dynamic-link libraries (DLLs).
	printf("lpMinimumApplicationAddress :%d",wonSystem_info.lpMinimumApplicationAddress);
	printf("\n");
	
	//A pointer to the highest memory address accessible to applications and DLLs.
	printf("lpMaximumApplicationAddress  :%d",wonSystem_info.lpMaximumApplicationAddress);
	printf("\n");	

	//A mask representing the set of processors configured into the system. Bit 0 is processor 0; bit 31 is processor 31.
	printf("dwActiveProcessorMask   :%d",wonSystem_info.dwActiveProcessorMask );
	printf("\n");

	//The number of processors in the system.
	printf("dwNumberOfProcessors   :%d",wonSystem_info.dwNumberOfProcessors );
	printf("\n");
	
	//An obsolete member that is retained for compatibility. 
	//Use the wProcessorArchitecture, wProcessorLevel, and wProcessorRevision members to determine the type of processor. 
	printf("dwProcessorType : ");
	switch (wonSystem_info.dwProcessorType)
	{
	case PROCESSOR_INTEL_386: printf("Intel 386");break;
	case PROCESSOR_INTEL_486: printf("Intel 486");break;
	case PROCESSOR_INTEL_PENTIUM: printf("Intel Pentium");break;
	case PROCESSOR_INTEL_IA64: printf("64bit");break;
	case PROCESSOR_AMD_X8664: printf("AMD 64bit");break;
	default:
		break;
	}
	printf("\n");

	//The granularity for the starting address at which virtual memory can be allocated. For more information, see VirtualAlloc.
	printf("dwAllocationGranularity   :%d",wonSystem_info.dwAllocationGranularity );
	printf("\n");

	//The architecture-dependent processor revision. 
	//The following table shows how the revision value is assembled for each type of processor architecture. 
	printf("wProcessorRevision    :%d",wonSystem_info.wProcessorRevision  );
	printf("\n");

	return 0;
}

결과 화면

사용자 삽입 이미지
Comments