Function Cpu_Info(Info As Long) As Dword
Local s As SYSTEM_INFO
GetSystemInfo s
' // Size = 36 bytes
'Type SYSTEM_INFO Dword Fill
' SYSTEM_INFO_UNION
' dwPageSize As Dword ' DWORD dwPageSize
' lpMinimumApplicationAddress As Dword ' LPVOID lpMinimumApplicationAddress
' lpMaximumApplicationAddress As Dword ' LPVOID lpMaximumApplicationAddress
' dwActiveProcessorMask As Dword ' DWORD_PTR dwActiveProcessorMask
' dwNumberOfProcessors As Dword ' DWORD dwNumberOfProcessors;
' dwProcessorType As Dword ' DWORD dwProcessorType
' dwAllocationGranularity As Dword ' DWORD dwAllocationGranularity
' wProcessorLevel As Word ' WORD wProcessorLevel
' wProcessorRevision As Word ' WORD wProcessorRevision
'End Type
Select Case Info
Case 0 'CPU个数
Function= s.dwNumberOfProcessors
Case 1 'CPU类型
Function = s.dwProcessorType
Case 2 'CPU等级
Function = s.wProcessorLevel
Case 3 'CPU序号
Function= s.dwOemID
Case 4 'CPU中的页面大小
Function= s.dwPageSize
Case 5 'CPU修订
Function = s.wProcessorRevision
Case 6 '最小申请地址
Function = s.lpMinimumApplicationAddress
Case 7 '最大申请地址
Function= s.lpMaximumApplicationAddress
Case 8 '分配尺寸
Function= s.dwAllocationGranularity
End Select
End Function