home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 February / Chip_2004-02_cd1.bin / zkuste / konfig / download / msic / Help / Int / MSI_Memory.int < prev    next >
Text File  |  2003-08-26  |  4KB  |  97 lines

  1. {*******************************************************}
  2. {                                                       }
  3. {       MiTeC System Information Component              }
  4. {              Memory Detection Part                    }
  5. {           version 8.3 for Delphi 5,6,7                }
  6. {                                                       }
  7. {       Copyright ⌐ 1997,2003 Michal Mutl               }
  8. {                                                       }
  9. {*******************************************************}
  10.  
  11. {$INCLUDE MITEC_DEF.INC}
  12.  
  13. unit MSI_Memory;
  14.  
  15. interface
  16.  
  17. uses
  18.   SysUtils, Windows, Classes, MSI_Common;
  19.  
  20. type
  21.   TMemoryStatusEx = record
  22.     dwLength,
  23.     dwMemoryLoad: DWORD;
  24.     ullTotalPhys,
  25.     ullAvailPhys,
  26.     ullTotalPageFile,
  27.     ullAvailPageFile,
  28.     ullTotalVirtual,
  29.     ullAvailVirtual,
  30.     ullAvailExtendedVirtual: int64;
  31.   end;
  32.  
  33.   PMemoryStatusEx = ^TMemoryStatusEx;
  34.  
  35.   TResources = class(TPersistent)
  36.   private
  37.     {$IFNDEF D6PLUS}
  38.     FDummy: Byte;
  39.     {$ENDIF}
  40.     FGDI: Byte;
  41.     FUser: Byte;
  42.     FSystem: Byte;
  43.   public
  44.     constructor Create;
  45.     procedure GetInfo;
  46.   published
  47.     property System: Byte read FSystem {$IFNDEF D6PLUS} Write FDummy {$ENDIF} stored false;
  48.     property GDI: Byte read FGDI {$IFNDEF D6PLUS} write FDummy {$ENDIF} stored false;
  49.     property User: Byte read FUser {$IFNDEF D6PLUS} write FDummy {$ENDIF} stored False;
  50.   end;
  51.  
  52.   TMemory = class(TPersistent)
  53.   private
  54.     FMaxAppAddress: integer;
  55.     FVirtualTotal: int64;
  56.     FPageFileFree: Int64;
  57.     FVirtualFree: int64;
  58.     FPhysicalFree: int64;
  59.     FAllocGranularity: integer;
  60.     FMinAppAddress: integer;
  61.     FMemoryLoad: integer;
  62.     FPhysicalTotal: int64;
  63.     FPageFileTotal: int64;
  64.     FPageSize: integer;
  65.     FResources: TResources;
  66.     FMode: TExceptionMode;
  67.   public
  68.     constructor Create;
  69.     destructor Destroy; override;
  70.     procedure GetInfo;
  71.     procedure Report(var sl :TStringList; Standalone: Boolean = True); virtual;
  72.   published
  73.     property ExceptionMode: TExceptionMode read FMode write FMode;
  74.     property PhysicalTotal :int64 read FPhysicalTotal {$IFNDEF D6PLUS} write FPhysicalTotal {$ENDIF} stored false;
  75.     property PhysicalFree :int64 read FPhysicalFree {$IFNDEF D6PLUS} write FPhysicalFree {$ENDIF} stored false;
  76.     property VirtualTotal :int64 read FVirtualTotal {$IFNDEF D6PLUS} write FVirtualTotal {$ENDIF} stored false;
  77.     property VirtualFree :int64 read FVirtualFree {$IFNDEF D6PLUS} write FVirtualFree {$ENDIF} stored false;
  78.     property PageFileTotal :int64 read FPageFileTotal {$IFNDEF D6PLUS} write FPageFileTotal {$ENDIF} stored false;
  79.     property PageFileFree :int64 read FPageFileFree {$IFNDEF D6PLUS} write FPageFileFree {$ENDIF} stored false;
  80.     property MemoryLoad :integer read FMemoryLoad {$IFNDEF D6PLUS} write FMemoryLoad {$ENDIF} stored false;
  81.     property AllocGranularity :integer read FAllocGranularity {$IFNDEF D6PLUS} write FAllocGranularity {$ENDIF} stored false;
  82.     property MaxAppAddress :integer read FMaxAppAddress {$IFNDEF D6PLUS} write FMaxAppAddress {$ENDIF} stored false;
  83.     property MinAppAddress :integer read FMinAppAddress {$IFNDEF D6PLUS} write FMinAppAddress {$ENDIF} stored false;
  84.     property PageSize :integer read FPageSize {$IFNDEF D6PLUS} write FPageSize {$ENDIF} stored false;
  85.     property Resources :TResources read FResources {$IFNDEF D6PLUS} write FResources {$ENDIF} stored False;
  86.   end;
  87.  
  88. type
  89.   TGlobalMemoryStatusEx = function(lpBuffer: PMEMORYSTATUSEX): BOOL; stdcall;
  90.   TQT_Thunk = procedure cdecl;
  91.  
  92. function GlobalMemoryStatusEx(lpBuffer: PMEMORYSTATUSEX): BOOL; stdcall;
  93. procedure QT_Thunk; cdecl;
  94.  
  95. implementation
  96.  
  97.