In the WinAPI, getSystemInfo is a subroutine rather than a function, how can i retireve say the CPU speed with the getSystemInfo?
Thanks
Cecil
getSystemInfo
-
cecilcheah
- Enthusiast

- Posts: 168
- Joined: Wed Jun 04, 2003 8:44 am
- Location: Switzerland
You just pass the pointer to a SYSTEM_INFO Structure to the GetSystemInfo_()
function, and it fills the structure with information.
GetSystemInfo_(@info.SYSTEM_INFO)
now the info structure contains all information.
However, i don't see how you want to get the CPU speed out of this.
As far a I can see, this structure doesn't contain information about this.
Timo
function, and it fills the structure with information.
GetSystemInfo_(@info.SYSTEM_INFO)
now the info structure contains all information.
However, i don't see how you want to get the CPU speed out of this.
As far a I can see, this structure doesn't contain information about this.
Timo
quidquid Latine dictum sit altum videtur
What am I doing wrong here?
I also tried thisbut it doesn't return anything.
Code: Select all
Structure SysInfo
dwOemId.w
wProcessorArchitecture.w
wReserved.w
dwPageSize.w
lpMinimumApplicationAddress.l
lpMaximumApplicationAddress.l
dwActiveProcessorMask.w
dwNumberOfProcessors.w
dwProcessorType.w
dwAllocationGranularity.w
wProcessorLevel.w
wProcessorRevision.w
EndStructure
GetSystemInfo_(@wProcessorArchitecture.SysInfo)
Debug PeekS(@wProcessorArchitecture)Code: Select all
*Result = GetSystemInfo_(@wProcessorArchitecture.SysInfo)
Debug PeekS(*Result)I Stepped On A Cornflake!!! Now I'm A Cereal Killer!
My take on it would be something like this...
If running on a PC, wProcessorArchitecture would return 0 since #PROCESSOR_ARCHITECTURE_INTEL=0
Warning: don't use PB's built in structure for SYSTEM_INFO since it contains spelling errors and is missing the union.
And as Freak said, there is no processor speed info available in this.
Code: Select all
Structure SysInfo
StructureUnion
dwOemId.l
wProcessorArchitecture.w
wReserved.w
EndStructureUnion
dwPageSize.l
lpMinimumApplicationAddress.l
lpMaximumApplicationAddress.l
dwActiveProcessorMask.l
dwNumberOfProcessors.l
dwProcessorType.l
dwAllocationGranularity.l
wProcessorLevel.w
wProcessorRevision.w
EndStructure
GetSystemInfo_(@si.SysInfo)
Debug si\wProcessorArchitecture
Debug "---"
Debug si\dwPageSize
Debug si\dwActiveProcessorMask
Debug si\dwNumberOfProcessors
Debug si\dwProcessorType
Debug si\wProcessorLevel
Warning: don't use PB's built in structure for SYSTEM_INFO since it contains spelling errors and is missing the union.
And as Freak said, there is no processor speed info available in this.


