diff options
Diffstat (limited to 'rtl/win/sysos.inc')
-rw-r--r-- | rtl/win/sysos.inc | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/rtl/win/sysos.inc b/rtl/win/sysos.inc index e0966c949d..a63a850bc8 100644 --- a/rtl/win/sysos.inc +++ b/rtl/win/sysos.inc @@ -191,6 +191,26 @@ type ExceptionInformation : array[0..EXCEPTION_MAXIMUM_PARAMETERS-1] of Pointer; end; + TSystemInfo = record + case LongInt of + 0 : ( dwOemId : DWord; + dwPageSize : DWord; + lpMinimumApplicationAddress : Pointer; + lpMaximumApplicationAddress : Pointer; + dwActiveProcessorMask : PDWord; + dwNumberOfProcessors : DWord; + dwProcessorType : DWord; + dwAllocationGranularity : DWord; + wProcessorLevel : Word; + wProcessorRevision : Word; + ); + 1 : ( + wProcessorArchitecture : Word; + wReserved : Word; + ); + end; + PSystemInfo = ^TSystemInfo; + { misc. functions } function GetLastError : DWORD; @@ -270,6 +290,8 @@ type {$ifdef wince}cdecl{$else}stdcall{$endif};external KernelDLL name 'SetEndOfFile'; function FreeLibrary(hLibModule:THandle):ByteBool; {$ifdef wince}cdecl{$else}stdcall{$endif};external KernelDLL name 'FreeLibrary'; + procedure GetSystemInfo(lpSystemInfo: PSystemInfo); {$ifdef wince}cdecl{$else}stdcall{$endif};external KernelDLL name 'GetSystemInfo'; + {$ifndef WINCE} function LoadLibrary(lpLibFileName:pchar):THandle; stdcall; external KernelDLL name 'LoadLibraryA'; function GetFileType(Handle:thandle):DWord; @@ -395,3 +417,13 @@ begin end; end; {$endif not WINCE} + +{$define HAS_GETCPUCOUNT} +function GetCPUCount: LongWord; +var + info: TSystemInfo; +begin + FillChar(info, SizeOf(info), 0); + GetSystemInfo(@info); + Result := info.dwNumberOfProcessors; +end; |