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

  1. {*******************************************************}
  2. {                                                       }
  3. {       MiTeC System Information Component              }
  4. {         Windows Process Status Helper                 }
  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 MiTeC_PSAPI;
  14.  
  15. interface
  16.  
  17. uses Classes, Windows, ShellAPI, SysUtils;
  18.  
  19. type
  20.   PHInst = ^HInst;
  21.   TModuleInfo = record
  22.     lpBaseOfDll : pointer;
  23.     SizeOfImage : Integer;
  24.     EntryPoint : pointer
  25.   end;
  26.  
  27.   TPSAPIWsWatchInformation = record
  28.     FaultingPc : pointer;
  29.     FaultingVa : pointer
  30.   end;
  31.  
  32.   TProcessMemoryCounters = record
  33.     cb : Integer;
  34.     PageFaultCount : Integer;
  35.     PeakWorkingSetSize : Integer;
  36.     WorkingSetSize : Integer;
  37.     QuotaPeakPagedPoolUsage : Integer;
  38.     QuotaPagedPoolUsage : Integer;
  39.     QuotaPeakNonPagedPoolUsage : Integer;
  40.     QuotaNonPagedPoolUsage : Integer;
  41.     PagefileUsage : Integer;
  42.     PeakPagefileUsage : Integer
  43.   end;
  44.  
  45.   TaskEnumProcEx = function(threadID : DWORD; hMod16 : WORD; hTask16 : WORD; modName : PChar; fileName : PChar; param : DWORD) : BOOL; stdcall;
  46.  
  47.   function InitPSAPI: Boolean;
  48.   function FreePSAPI: Boolean;
  49.   function EnumProcesses(pidList : PInteger; cb : Integer; var cbNeeded : DWORD): boolean; stdcall;
  50.   function EnumProcessModules(hProcess : THandle; moduleList : PHInst; cb : Integer; var cbNeeded : DWORD) : boolean; stdcall;
  51.   function GetModuleBaseName(hProcess : THandle; module : HInst; BaseName : Pchar; size : Integer) : Integer; stdcall;
  52.   function GetModuleFileNameEx(hProcess : THandle; module : HInst; FileName : PChar; size : Integer) : Integer; stdcall;
  53.   function GetModuleInformation(hProcess : THandle; module : HInst; var info : TModuleInfo; size : Integer) : boolean; stdcall;
  54.   function EmptyWorkingSet(hProcess : THandle) : boolean; stdcall;
  55.   function QueryWorkingSet(hProcess : THandle; var pv; size : Integer) : boolean; stdcall;
  56.   function InitializeProcessForWsWatch(hProcess : THandle) : boolean; stdcall;
  57.   function GetWsChanges(hProcess : THandle; var WatchInfo : TPSAPIWsWatchInformation; size : Integer) : boolean; stdcall;
  58.   function GetMappedFileName(hProcess : THandle; pv : pointer; FileName : PChar; size : Integer) : Integer; stdcall;
  59.   function EnumDeviceDrivers(ImageBase : PInteger; cb : dword; var cbNeeded : dword) : boolean; stdcall;
  60.   function GetDeviceDriverBaseName(ImageBase : Integer; BaseName : PChar; size : dword) : Integer; stdcall;
  61.   function GetDeviceDriverFileName(ImageBase : Integer; FileName : PChar; size : dword) : Integer; stdcall;
  62.   function GetProcessMemoryInfo(hProcess : THandle; var ProcessMemoryCounters : TProcessMemoryCounters; size : Integer) : boolean; stdcall;
  63.  
  64.   function InitVDM: Boolean;
  65.   function FreeVDM: Boolean;
  66.   function VDMEnumTaskWOWEx(pid : DWORD; callback : TaskEnumProcEx; param : DWORD) : Integer; stdcall;
  67.  
  68. type
  69.   TVDMEnumTaskWOWEx = function (pid : DWORD; callback : TaskEnumProcEx; param : DWORD) : Integer; stdcall;
  70.  
  71.   TEnumProcesses = function (pidList : PInteger; cb : Integer; var cbNeeded : DWORD): boolean; stdcall;
  72.   TEnumProcessModules = function (hProcess : THandle; moduleList : PHInst; cb : Integer; var cbNeeded : DWORD) : boolean; stdcall;
  73.   TGetModuleBaseName = function (hProcess : THandle; module : HInst; BaseName : Pchar; size : Integer) : Integer; stdcall;
  74.   TGetModuleFileNameEx = function (hProcess : THandle; module : HInst; FileName : PChar; size : Integer) : Integer; stdcall;
  75.   TGetModuleInformation = function (hProcess : THandle; module : HInst; var info : TModuleInfo; size : Integer) : boolean; stdcall;
  76.   TEmptyWorkingSet = function (hProcess : THandle) : boolean; stdcall;
  77.   TQueryWorkingSet = function (hProcess : THandle; var pv; size : Integer) : boolean; stdcall;
  78.   TInitializeProcessForWsWatch = function (hProcess : THandle) : boolean; stdcall;
  79.   TGetWsChanges = function (hProcess : THandle; var WatchInfo : TPSAPIWsWatchInformation; size : Integer) : boolean; stdcall;
  80.   TGetMappedFileName = function (hProcess : THandle; pv : pointer; FileName : PChar; size : Integer) : Integer; stdcall;
  81.   TEnumDeviceDrivers = function (ImageBase : PInteger; cb : dword; var cbNeeded : dword) : boolean; stdcall;
  82.   TGetDeviceDriverBaseName = function (ImageBase : Integer; BaseName : PChar; size : dword) : Integer; stdcall;
  83.   TGetDeviceDriverFileName = function (ImageBase : Integer; FileName : PChar; size : dword) : Integer; stdcall;
  84.   TGetProcessMemoryInfo = function (hProcess : THandle; var ProcessMemoryCounters : TProcessMemoryCounters; size : Integer) : boolean; stdcall;
  85.  
  86. var
  87.   modulelist :PHInst;
  88.   PSAPILoaded :Boolean;
  89.  
  90. implementation
  91.  
  92.