Constants:
CONST
{ OS MemType }
MemoryLoad = 1; { Total memory used in percents (%) }
TotalPhys = 2; { Total physical memory in bytes }
AvailPhys = 3; { Available physical memory (bytes) }
TotalPageFile = 4; { Total page file in (bytes) }
AvailPageFile = 5; { Available page file (bytes) }
TotalVirtual = 6; { Total virtual memory in bytes }
AvailVirtual = 7; { Available virtual memory (bytes) }
{ ProcMemType }
WorkingSetSize =1; {- the current working set size, in bytes. }
PageFaultCount =2; {- the number of page faults.}
PeakWorkingSetSize =3; {- the peak working set size, in bytes.}
QuotaPeakPagedPoolUsage =4; {- The peak paged pool usage, in bytes.}
QuotaPagedPoolUsage =5; {- The current paged pool usage, in bytes.}
QuotaPeakNonPagedPoolUsg =6; {- The peak nonpaged pool usage, in bytes.}
QuotaNonPagedPoolUsg =7; {- The current nonpaged pool usage, in bytes.}
PagefileUsage =8; {- The current space allocated for the pagefile, in bytes. Those pages may or may not be in memory.}
PeakPagefileUsage =9; {- The peak space allocated for the pagefile, in bytes.}
Exported functions:
{ CPU }
function GetCPUSpeed : Double; stdcall;
function CPUFamily : String; stdcall; { Get cpu identifier from the windows registry }
function GetCpuTheoreticSpeed: Integer; stdcall; { Get cpu speed (in MHz) }
function IsCPUIDAvailable : Boolean; stdcall;
function GetCPUID (CoreMask: Word): String; stdcall; { Get the ID of the specified logical CPU }
function GetCpuIdNow: string; stdcall; { Get the ID of the first available logical CPU }
function GetCPUCount: Integer; { The number of LOGICAL processors in the current group }
function IsIntel64BitCPU: Boolean; { Detects IA64 processors }
function GetCPUVendor: string; { New GetCPUVendor function. Reported to work with D7 and D2009. Needs more testing. }
function MemStatWindows (CONST OSMemType : Byte): Cardinal; stdcall; { in Bytes }
function MemStatWindows_KB (CONST OSMemType : Byte): String; stdcall; { in KB }
function MemStatWindows_MB (CONST OSMemType : Byte): String; stdcall; { in MB }
function MemStatCurrProc (CONST ProcMemType: Byte= 1): Cardinal; stdcall; { Returns data about the memory used of the current process }
function MemStatPeak: Cardinal; { Peak memory used by current program }
{ RAM - Advanced stuff }
function GetPageSize: Cardinal; { The page size and the granularity of page protection and commitment. This is the page size used by the VirtualAlloc function. }
function GetMemGranularity: Integer; { Granularity with which virtual memory is allocated (in KB) }
function GetLowAddr: Cardinal; { Lowest RAM memory address accessible to applications (this is the RAM address, not virtual memory address) }
function GetHiAddr: Cardinal; { Lowest RAM memory address accessible to applications }
{ HDD }
function GetPartitionID (Partition : PChar): String; stdcall; { Get the ID of the specified patition. Example of parameter: 'C:' }
function GetIDESerialNumber(DriveNumber: Byte ): PChar; stdcall; { DriveNr is from 0 to 4 }
{ Utils }
function BinToInt(Value: string): Integer; stdcall;
function IntToBin(valor,digitos: integer): string; stdcall;
function CoreNumber2CoreMask(CoreNo: integer): integer; stdcall;
procedure ChangeByteOrder(VAR Data; Size : Integer); stdcall;
This library can be used to create licensing systems, where the user can get a unique serial number based on its hardware ID combined with its name - serial which will work only
in his computer. Please discuss on our forum how you intend to implement your own registration system. Other programmers may give you valuable feedback.
The library was tested under Windows 98, Windows XP, Windows Vista, Windows 7. Under Windows Vista and 7, the program may temporary need elevated rights to
access the harddrive.
Related words: Get disk serial, real hard drive serial number, hardware ID number, programming code, DLL library, extract hardware info, get CPU producer frequency and producer |