// This code is based on the sysinfo.src program written by Vincent Oorsprong // and was put into the DAW forums here: // http://support.dataaccess.com/forums/showthread.php?t=42786 // // As per MSDN there have been a changes like using the GetNativeSystemInfo call. // Use Windows.Pkg Use Dferror.Pkg Type SYSTEM_INFO Field SYSTEM_INFO.wProcessorArchitecture as Word Field SYSTEM_INFO.wReserved as Word Field SYSTEM_INFO.dwPageSize as DWord Field SYSTEM_INFO.lpMinimumApplicationAddress as Pointer Field SYSTEM_INFO.lpMaximumApplicationAddress as Pointer Field SYSTEM_INFO.dwActiveProcessorMask as DWord Field SYSTEM_INFO.dwNumberOfProcessors as DWord Field SYSTEM_INFO.dwProcessorType as DWord Field SYSTEM_INFO.dwAllocationGranularity as DWord Field SYSTEM_INFO.wProcessorLevel as Word Field SYSTEM_INFO.wProcessorRevision as Word End_Type #IFNDEF Get_GetNativeSystemInfoEf External_Function GetNativeSystemInfoEf "GetNativeSystemInfo" Kernel32.Dll ; Pointer lpSystemInfo Returns Integer #ENDIF #IFNDEF PROCESSOR_INTEL_386 Define PROCESSOR_INTEL_386 for 386 Define PROCESSOR_INTEL_486 for 486 Define PROCESSOR_INTEL_PENTIUM for 586 Define PROCESSOR_MIPS_R4000 for 4000 // incl R4101 & R3910 for Windows CE Define PROCESSOR_ALPHA_21064 for 21064 Define PROCESSOR_PPC_601 for 601 Define PROCESSOR_PPC_603 for 603 Define PROCESSOR_PPC_604 for 604 Define PROCESSOR_PPC_620 for 620 Define PROCESSOR_HITACHI_SH3 for 10003 // Windows CE Define PROCESSOR_HITACHI_SH3E for 10004 // Windows CE Define PROCESSOR_HITACHI_SH4 for 10005 // Windows CE Define PROCESSOR_MOTOROLA_821 for 821 // Windows CE Define PROCESSOR_SHx_SH3 for 103 // Windows CE Define PROCESSOR_SHx_SH4 for 104 // Windows CE Define PROCESSOR_STRONGARM for 2577 // Windows CE - 0xA11 Define PROCESSOR_ARM720 for 1824 // Windows CE - 0x720 Define PROCESSOR_ARM820 for 2080 // Windows CE - 0x820 Define PROCESSOR_ARM920 for 2336 // Windows CE - 0x920 Define PROCESSOR_ARM_7TDMI for 70001 // Windows CE Define PROCESSOR_ARCHITECTURE_INTEL for 0 Define PROCESSOR_ARCHITECTURE_MIPS for 1 Define PROCESSOR_ARCHITECTURE_ALPHA for 2 Define PROCESSOR_ARCHITECTURE_PPC for 3 Define PROCESSOR_ARCHITECTURE_SHX for 4 Define PROCESSOR_ARCHITECTURE_ARM for 5 Define PROCESSOR_ARCHITECTURE_IA64 for 6 Define PROCESSOR_ARCHITECTURE_ALPHA64 for 7 Define PROCESSOR_ARCHITECTURE_AMD64 for 9 // x64 (AMD or Intel) Define PROCESSOR_ARCHITECTURE_UNKNOWN for |CI$FFFF #ENDIF Class cSystemInfo is a cObject Procedure Construct_Object Forward Send Construct_Object Property Integer piProcessorArchitecture PROCESSOR_ARCHITECTURE_UNKNOWN Property Integer piProcessorCount 0 Property Integer piProcessorType 0 Property Integer piProcessorLevel 0 Property Integer piProcessorRevision 0 End_Procedure Procedure DoGetSystemInfo String sSystemInfo Integer iVoid iProcessorArchitecture iProcessorType iProcessorLevel iProcessorRevision iProcessorCount ZeroType SYSTEM_INFO to sSystemInfo Move (GetNativeSystemInfoEf (AddressOf (sSystemInfo))) to iVoid GetBuff from sSystemInfo At SYSTEM_INFO.wProcessorArchitecture to iProcessorArchitecture GetBuff from sSystemInfo At SYSTEM_INFO.dwNumberOfProcessors to iProcessorCount GetBuff from sSystemInfo At SYSTEM_INFO.dwProcessorType to iProcessorType GetBuff from sSystemInfo At SYSTEM_INFO.wProcessorLevel to iProcessorLevel Case Begin Case (iProcessorArchitecture = PROCESSOR_ARCHITECTURE_INTEL) Case Begin Case (iProcessorLevel = 3) //Showln "Intel 80386" Case Break Case (iProcessorLevel = 4) //Showln "Intel 80486" Case Break Case (iProcessorLevel = 5) //Showln "Intel Pentium" Case Break Case (iProcessorLevel = 6) //Showln "Intel Pentium Pro or Pentium II" Case Break Case Else //Showln "Intel MSDN unspecified " iProcessorLevel Case Break Case End Case Break Case (iProcessorArchitecture = PROCESSOR_ARCHITECTURE_IA64) //Showln "Intel 64 bits" Case Break Case (iProcessorArchitecture = PROCESSOR_ARCHITECTURE_MIPS) If ((iProcessorLevel iand $FF) = 4) Begin //Showln "MIPS R4000" End Else Begin //Showln "MIPS MSDN unspecified " iProcessorLevel End Case Break Case (iProcessorArchitecture = PROCESSOR_ARCHITECTURE_ALPHA) Case Begin Case (iProcessorLevel = 21064) //Showln "Alpha 21064" Case Break Case (iProcessorLevel = 21066) //Showln "Alpha 21066" Case Break Case (iProcessorLevel = 21164) //Showln "Alpha 21164" Case Break Case Else //Showln "Alpha MSDN unspecified" Case Break Case End Case Break Case (iProcessorArchitecture = PROCESSOR_ARCHITECTURE_PPC) Case Begin Case (iProcessorLevel = 1) //Showln "PPC 601" Case Break Case (iProcessorLevel = 3) //Showln "PPC 603" Case Break Case (iProcessorLevel = 4) //Showln "PPC 604" Case Break Case (iProcessorLevel = 6) //Showln "PPC 603+" Case Break Case (iProcessorLevel = 9) //Showln "PPC 604+" Case Break Case (iProcessorLevel = 20) //Showln "PPC 620" Case Break Case Else //Showln "PPC MSDN unspecified" Case Break Case End Case Break Case Else //Showln "Architecture MSDN unspecified, processor level " iProcessorLevel Case Break Case End GetBuff from sSystemInfo At SYSTEM_INFO.wProcessorRevision to iProcessorRevision //Show "ProcessorRevision; " Case Begin Case (iProcessorType = PROCESSOR_INTEL_386) Case (iProcessorType = PROCESSOR_INTEL_486) If ((iProcessorRevision / $000000FF) = $FF) Begin //Showln "Model " ((iProcessorRevision iAnd $000000FF) - $0A) ", stepping " (iProcessorRevision iAnd $0000000F) End Else Begin //Showln "Model " (iProcessorRevision / $000000FF) "A, minor stepping " (iProcessorRevision iAnd $000000FF) End Case Break Case (iProcessorType = PROCESSOR_INTEL_PENTIUM) //Showln "Model " (iProcessorRevision / $000000FF) ", stepping " (iProcessorRevision iAnd $000000FF) Case Break Case (iProcessorType = PROCESSOR_MIPS_R4000) //Showln "Processor revision " (iProcessorRevision iAnd $000000FF) Case Break Case (iProcessorType = PROCESSOR_ALPHA_21064) //Showln "Model A+" (iProcessorRevision / $000000FF) ", Pass " (iProcessorRevision iAnd $000000FF) Case Break Case (iProcessorType = PROCESSOR_PPC_601) Case (iProcessorType = PROCESSOR_PPC_603) Case (iProcessorType = PROCESSOR_PPC_604) Case (iProcessorType = PROCESSOR_PPC_620) //Showln (iProcessorRevision / $000000FF) "." (iProcessorRevision iAnd $000000FF) Case Break Case Else //Showln "Unkown type: " iProcessorRevision Case Break Case End Set piProcessorArchitecture to iProcessorArchitecture Set piProcessorCount to iProcessorCount Set piProcessorType to iProcessorType Set piProcessorLevel to iProcessorLevel Set piProcessorRevision to iProcessorRevision End_Procedure Procedure End_Construct_Object Send DoGetSystemInfo Forward Send End_Construct_Object End_Procedure End_Class