PSAPI所有API的声明
如题,谁能给出来,谢谢! --------------------编程问答-------------------- 参考 --------------------编程问答-------------------- Private Declare Function EnumProcesses Lib "psapi.dll" (ByRef lpidProcess As Long, ByVal cb As Long, ByRef cbNeeded As Long) As LongPrivate Declare Function EnumProcessModules Lib "psapi.dll" (ByVal hProcess As Long, ByRef lphModule As Long, ByVal cb As Long, ByRef lpcbNeeded As Long) As Long
Private Declare Function GetModuleBaseName Lib "psapi.dll" (ByVal hProcess As Long, ByVal hModule As Long, ByVal lpBaseName As String, ByVal nSize As Long) As Long
Private Declare Function GetModuleFileNameEx Lib "psapi.dll" (ByVal hProcess As Long, ByVal hModule As Long, ByVal lpFilename As String, ByVal nSize As Long) As Long
Private Declare Function GetModuleInformation Lib "psapi.dll" (ByVal hProcess As Long, ByVal hModule As Long, ByRef lpmodinfo As LPMODULEINFO, ByVal cb As Long) As Long
Private Declare Function EmptyWorkingSet Lib "psapi.dll" (ByVal hProcess As Long) As Long
Private Declare Function QueryWorkingSet Lib "psapi.dll" (ByVal hProcess As Long, pv As Any, ByVal cb As Long) As Long
Private Declare Function QueryWorkingSetEx Lib "psapi.dll" (ByVal hProcess As Long, pv As Any, ByVal cb As Long) As Long
Private Declare Function InitializeProcessForWsWatch Lib "psapi.dll" (ByVal hProcess As Long) As Long
Private Declare Function GetWsChanges Lib "psapi.dll" (ByVal hProcess As Long, ByRef lpWatchInfo As PPSAPI_WS_WATCH_INFORMATION, ByVal cb As Long) As Long
Private Declare Function GetMappedFileName Lib "psapi.dll" (ByVal hProcess As Long, lpv As Any, ByVal lpFilename As String, ByVal nSize As Long) As Long
Private Declare Function EnumDeviceDrivers Lib "psapi.dll" (lpImageBase As Any, ByVal cb As Long, ByRef lpcbNeeded As Long) As Long
Private Declare Function GetDeviceDriverBaseName Lib "psapi.dll" (ImageBase As Any, ByVal lpBaseName As String, ByVal nSize As Long) As Long
Private Declare Function GetDeviceDriverFileName Lib "psapi.dll" (ImageBase As Any, ByVal lpFilename As String, ByVal nSize As Long) As Long
Private Declare Function GetProcessMemoryInfo Lib "psapi.dll" (ByVal Process As Long, ByRef ppsmemCounters As PPROCESS_MEMORY_COUNTERS, ByVal cb As Long) As Long
--------------------编程问答-------------------- 还有一些比较新的:
Private Declare Function GetPerformanceInfo Lib "psapi.dll" ( ByRef ppsmemCounters As PPERFORMACE_INFORMATION, ByVal cb As Long) As Long
Private Declare Function EnumPageFiles Lib "psapi.dll" Alias "EnumPageFilesA"(ByRef pCallBackRoutine as PENUM_PAGE_FILE_CALLBACKA, pContext as any) as long
Private Declare Function LongGetProcessImageFileName Lib "psapi.dll" Alias "LongGetProcessImageFileNameA" (ByVal hProcess As Long, ByVal lpImageFileName as string, nSize As Long) As long
'结构体:
Private Type MODULEINFO
lpBaseOfDLL As Long
EntryPoint As Long
SizeOfImage As Long
End Type
Private Type PSAPI_WS_WATCH_INFORMATION
FaultingPc As Long
FaultingVa As Long
End Type
Private Type PROCESS_MEMORY_COUNTERS
cb As Long
PeakPagefileUsage As Long
QuotaPagedPoolUsage As Long
QuotaPeakNonPagedPoolUsage As Long
QuotaNonPagedPoolUsage As Long
PagefileUsage As Long
WorkingSetSize As Long
QuotaPeakPagedPoolUsage As Long
PeakWorkingSetSize As Long
PageFaultCount As Long
End Type
'还有一些结构体给出VC下的申明:
typedef struct _PROCESS_MEMORY_COUNTERS_EX {
DWORD cb;
DWORD PageFaultCount;
SIZE_T PeakWorkingSetSize;
SIZE_T WorkingSetSize;
SIZE_T QuotaPeakPagedPoolUsage;
SIZE_T QuotaPagedPoolUsage;
SIZE_T QuotaPeakNonPagedPoolUsage;
SIZE_T QuotaNonPagedPoolUsage;
SIZE_T PagefileUsage;
SIZE_T PeakPagefileUsage;
SIZE_T PrivateUsage;
} PROCESS_MEMORY_COUNTERS_EX;
typedef PROCESS_MEMORY_COUNTERS_EX *PPROCESS_MEMORY_COUNTERS_EX;
typedef struct _PERFORMANCE_INFORMATION {
DWORD cb;
SIZE_T CommitTotal;
SIZE_T CommitLimit;
SIZE_T CommitPeak;
SIZE_T PhysicalTotal;
SIZE_T PhysicalAvailable;
SIZE_T SystemCache;
SIZE_T KernelTotal;
SIZE_T KernelPaged;
SIZE_T KernelNonpaged;
SIZE_T PageSize;
DWORD HandleCount;
DWORD ProcessCount;
DWORD ThreadCount;
} PERFORMANCE_INFORMATION, *PPERFORMANCE_INFORMATION, PERFORMACE_INFORMATION, *PPERFORMACE_INFORMATION;
typedef struct _ENUM_PAGE_FILE_INFORMATION {
DWORD cb;
DWORD Reserved;
SIZE_T TotalSize;
SIZE_T TotalInUse;
SIZE_T PeakUsage;
} ENUM_PAGE_FILE_INFORMATION, *PENUM_PAGE_FILE_INFORMATION;
--------------------编程问答-------------------- typedef BOOL (*PENUM_PAGE_FILE_CALLBACKA) (LPVOID pContext, PENUM_PAGE_FILE_INFORMATION pPageFileInfo, LPCSTR lpFilename);
'EnumPageFiles 这个函数我不会用。。
补充:VB , API