home *** CD-ROM | disk | FTP | other *** search
- {*******************************************************}
- { }
- { MiTeC System Information Component }
- { Memory Detection Part }
- { version 8.3 for Delphi 5,6,7 }
- { }
- { Copyright ⌐ 1997,2003 Michal Mutl }
- { }
- {*******************************************************}
-
- {$INCLUDE MITEC_DEF.INC}
-
- unit MSI_Memory;
-
- interface
-
- uses
- SysUtils, Windows, Classes, MSI_Common;
-
- type
- TMemoryStatusEx = record
- dwLength,
- dwMemoryLoad: DWORD;
- ullTotalPhys,
- ullAvailPhys,
- ullTotalPageFile,
- ullAvailPageFile,
- ullTotalVirtual,
- ullAvailVirtual,
- ullAvailExtendedVirtual: int64;
- end;
-
- PMemoryStatusEx = ^TMemoryStatusEx;
-
- TResources = class(TPersistent)
- private
- {$IFNDEF D6PLUS}
- FDummy: Byte;
- {$ENDIF}
- FGDI: Byte;
- FUser: Byte;
- FSystem: Byte;
- public
- constructor Create;
- procedure GetInfo;
- published
- property System: Byte read FSystem {$IFNDEF D6PLUS} Write FDummy {$ENDIF} stored false;
- property GDI: Byte read FGDI {$IFNDEF D6PLUS} write FDummy {$ENDIF} stored false;
- property User: Byte read FUser {$IFNDEF D6PLUS} write FDummy {$ENDIF} stored False;
- end;
-
- TMemory = class(TPersistent)
- private
- FMaxAppAddress: integer;
- FVirtualTotal: int64;
- FPageFileFree: Int64;
- FVirtualFree: int64;
- FPhysicalFree: int64;
- FAllocGranularity: integer;
- FMinAppAddress: integer;
- FMemoryLoad: integer;
- FPhysicalTotal: int64;
- FPageFileTotal: int64;
- FPageSize: integer;
- FResources: TResources;
- FMode: TExceptionMode;
- public
- constructor Create;
- destructor Destroy; override;
- procedure GetInfo;
- procedure Report(var sl :TStringList; Standalone: Boolean = True); virtual;
- published
- property ExceptionMode: TExceptionMode read FMode write FMode;
- property PhysicalTotal :int64 read FPhysicalTotal {$IFNDEF D6PLUS} write FPhysicalTotal {$ENDIF} stored false;
- property PhysicalFree :int64 read FPhysicalFree {$IFNDEF D6PLUS} write FPhysicalFree {$ENDIF} stored false;
- property VirtualTotal :int64 read FVirtualTotal {$IFNDEF D6PLUS} write FVirtualTotal {$ENDIF} stored false;
- property VirtualFree :int64 read FVirtualFree {$IFNDEF D6PLUS} write FVirtualFree {$ENDIF} stored false;
- property PageFileTotal :int64 read FPageFileTotal {$IFNDEF D6PLUS} write FPageFileTotal {$ENDIF} stored false;
- property PageFileFree :int64 read FPageFileFree {$IFNDEF D6PLUS} write FPageFileFree {$ENDIF} stored false;
- property MemoryLoad :integer read FMemoryLoad {$IFNDEF D6PLUS} write FMemoryLoad {$ENDIF} stored false;
- property AllocGranularity :integer read FAllocGranularity {$IFNDEF D6PLUS} write FAllocGranularity {$ENDIF} stored false;
- property MaxAppAddress :integer read FMaxAppAddress {$IFNDEF D6PLUS} write FMaxAppAddress {$ENDIF} stored false;
- property MinAppAddress :integer read FMinAppAddress {$IFNDEF D6PLUS} write FMinAppAddress {$ENDIF} stored false;
- property PageSize :integer read FPageSize {$IFNDEF D6PLUS} write FPageSize {$ENDIF} stored false;
- property Resources :TResources read FResources {$IFNDEF D6PLUS} write FResources {$ENDIF} stored False;
- end;
-
- type
- TGlobalMemoryStatusEx = function(lpBuffer: PMEMORYSTATUSEX): BOOL; stdcall;
- TQT_Thunk = procedure cdecl;
-
- function GlobalMemoryStatusEx(lpBuffer: PMEMORYSTATUSEX): BOOL; stdcall;
- procedure QT_Thunk; cdecl;
-
- implementation
-
-