1 | ' api_psapi.sbp
|
---|
2 |
|
---|
3 | #ifdef UNICODE
|
---|
4 | Const _FuncName_GetModuleBaseName = "GetModuleBaseNameW"
|
---|
5 | Const _FuncName_GetModuleFileNameEx = "GetModuleFileNameExW"
|
---|
6 | Const _FuncName_GetMappedFileName = "GetMappedFileNameW"
|
---|
7 | Const _FuncName_GetDeviceDriverBaseName = "GetDeviceDriverBaseNameW"
|
---|
8 | Const _FuncName_GetDeviceDriverFileName = "GetDeviceDriverFileNameW"
|
---|
9 | Const _FuncName_GetProcessImageFileName = "GetProcessImageFileNameW"
|
---|
10 | Const _FuncName_EnumPageFiles = "EnumPageFilesW"
|
---|
11 | #else
|
---|
12 | Const _FuncName_GetModuleBaseName = "GetModuleBaseNameA"
|
---|
13 | Const _FuncName_GetModuleFileNameEx = "GetModuleFileNameExA"
|
---|
14 | Const _FuncName_GetMappedFileName = "GetMappedFileNameA"
|
---|
15 | Const _FuncName_GetDeviceDriverBaseName = "GetDeviceDriverBaseNameA"
|
---|
16 | Const _FuncName_GetDeviceDriverFileName = "GetDeviceDriverFileNameA"
|
---|
17 | Const _FuncName_GetProcessImageFileName = "GetProcessImageFileNameA"
|
---|
18 | Const _FuncName_EnumPageFiles = "EnumPageFilesA"
|
---|
19 | #endif
|
---|
20 |
|
---|
21 | Declare Function EnumProcesses Lib "psapi" (lpidProcess As *DWord, cb As DWord, ByRef cbNeeded As DWord) As BOOL
|
---|
22 | Declare Function EnumProcessModules Lib "psapi" (hProcess As HANDLE, lphModule As *HANDLE, cb As DWord, ByRef lpcbNeeded As DWord) As BOOL
|
---|
23 | Declare Function GetModuleBaseName Lib "psapi" Alias _FuncName_GetModuleBaseName (hProcess As HANDLE, hModule As HANDLE, lpBaseName As LPTSTR, nSize As DWord) As DWORD
|
---|
24 | Declare Function GetModuleFileNameEx Lib "psapi" Alias _FuncName_GetModuleFileNameEx (hProcess As HANDLE, hModule As HANDLE, lpFilename As LPTSTR, nSize As DWord) As DWORD
|
---|
25 |
|
---|
26 | Type MODULEINFO
|
---|
27 | lpBaseOfDll As VoidPtr
|
---|
28 | SizeOfImage As DWORD
|
---|
29 | EntryPoint As VoidPtr
|
---|
30 | End Type
|
---|
31 | TypeDef LPMODULEINFO = *MODULEINFO
|
---|
32 |
|
---|
33 | Declare Function GetModuleInformation Lib "psapi" (hProcess As HANDLE, hModule As HANDLE, lpmodinfo As LPMODULEINFO, cb As DWord) As BOOL
|
---|
34 | Declare Function EmptyWorkingSet Lib "psapi" (hProcess As HANDLE) As BOOL
|
---|
35 | Declare Function QueryWorkingSet Lib "psapi" (hProcess As HANDLE, pv As VoidPtr, cb As DWord) As BOOL
|
---|
36 | Declare Function QueryWorkingSetEx Lib "psapi" (hProcess As HANDLE, pv As VoidPtr, cb As DWord) As BOOL
|
---|
37 | Declare Function InitializeProcessForWsWatch Lib "psapi" (hProcess As HANDLE) As BOOL
|
---|
38 |
|
---|
39 | Type PSAPI_WS_WATCH_INFORMATION
|
---|
40 | FaultingPc As VoidPtr
|
---|
41 | FaultingVa As VoidPtr
|
---|
42 | End Type
|
---|
43 | TypeDef PPSAPI_WS_WATCH_INFORMATION = *PSAPI_WS_WATCH_INFORMATION
|
---|
44 |
|
---|
45 | Declare Function GetWsChanges Lib "psapi" (hProcess As HANDLE, lpWatchInfo As PPSAPI_WS_WATCH_INFORMATION, cb As DWord) As BOOL
|
---|
46 | Declare Function GetMappedFileName Lib "psapi" Alias _FuncName_GetMappedFileName (hProcess As HANDLE, lpv As VoidPtr, lpFilename As LPTSTR, nSize As DWord) As DWORD
|
---|
47 | Declare Function EnumDeviceDrivers Lib "psapi" (ByRef lpImageBase As VoidPtr, cb As DWord, ByRef lpcbNeeded As DWord) As BOOL
|
---|
48 | Declare Function GetDeviceDriverBaseName Lib "psapi" Alias _FuncName_GetDeviceDriverBaseName (ImageBase As VoidPtr, lpBaseName As LPTSTR, nSize As DWord) As DWORD
|
---|
49 | Declare Function GetDeviceDriverFileName Lib "psapi" Alias _FuncName_GetDeviceDriverFileName (ImageBase As VoidPtr, lpFilename As LPTSTR, nSize As DWord) As DWORD
|
---|
50 |
|
---|
51 | ' Structure for GetProcessMemoryInfo()
|
---|
52 | Type PROCESS_MEMORY_COUNTERS
|
---|
53 | cb As DWORD
|
---|
54 | PageFaultCount As DWORD
|
---|
55 | PeakWorkingSetSize As SIZE_T
|
---|
56 | WorkingSetSize As SIZE_T
|
---|
57 | QuotaPeakPagedPoolUsage As SIZE_T
|
---|
58 | QuotaPagedPoolUsage As SIZE_T
|
---|
59 | QuotaPeakNonPagedPoolUsage As SIZE_T
|
---|
60 | QuotaNonPagedPoolUsage As SIZE_T
|
---|
61 | PagefileUsage As SIZE_T
|
---|
62 | PeakPagefileUsage As SIZE_T
|
---|
63 | End Type
|
---|
64 |
|
---|
65 | TypeDef PPROCESS_MEMORY_COUNTERS = *PROCESS_MEMORY_COUNTERS
|
---|
66 |
|
---|
67 | #ifdef _WIN32_WINNT
|
---|
68 | Type PROCESS_MEMORY_COUNTERS_EX
|
---|
69 | cb As DWORD
|
---|
70 | PageFaultCount As DWORD
|
---|
71 | PeakWorkingSetSize As SIZE_T
|
---|
72 | WorkingSetSize As SIZE_T
|
---|
73 | QuotaPeakPagedPoolUsage As SIZE_T
|
---|
74 | QuotaPagedPoolUsage As SIZE_T
|
---|
75 | QuotaPeakNonPagedPoolUsage As SIZE_T
|
---|
76 | QuotaNonPagedPoolUsage As SIZE_T
|
---|
77 | PagefileUsage As SIZE_T
|
---|
78 | PeakPagefileUsage As SIZE_T
|
---|
79 | PrivateUsage As SIZE_T
|
---|
80 | End Type
|
---|
81 | TypeDef PPROCESS_MEMORY_COUNTERS_EX = *PROCESS_MEMORY_COUNTERS_EX
|
---|
82 | #endif
|
---|
83 |
|
---|
84 | Declare Function GetProcessMemoryInfo Lib "psapi" (Process As HANDLE, ppsmemCounters As PPROCESS_MEMORY_COUNTERS, cb As DWord) As BOOL
|
---|
85 |
|
---|
86 | Type PERFORMANCE_INFORMATION
|
---|
87 | cb As DWORD
|
---|
88 | CommitTotal As SIZE_T
|
---|
89 | CommitLimit As SIZE_T
|
---|
90 | CommitPeak As SIZE_T
|
---|
91 | PhysicalTotal As SIZE_T
|
---|
92 | PhysicalAvailable As SIZE_T
|
---|
93 | SystemCache As SIZE_T
|
---|
94 | KernelTotal As SIZE_T
|
---|
95 | KernelPaged As SIZE_T
|
---|
96 | KernelNonpaged As SIZE_T
|
---|
97 | PageSize As SIZE_T
|
---|
98 | HandleCount As DWORD
|
---|
99 | ProcessCount As DWORD
|
---|
100 | ThreadCount As DWORD
|
---|
101 | End Type
|
---|
102 | TypeDef PPERFORMANCE_INFORMATION = *PERFORMANCE_INFORMATION
|
---|
103 | TypeDef PERFORMACE_INFORMATION = PERFORMANCE_INFORMATION
|
---|
104 | TypeDef PPERFORMACE_INFORMATION = *PERFORMANCE_INFORMATION
|
---|
105 |
|
---|
106 | Declare Function GetPerformanceInfo Lib "psapi" (pPerformanceInformation As PPERFORMACE_INFORMATION, cb As DWord) As BOOL
|
---|
107 |
|
---|
108 | Type ENUM_PAGE_FILE_INFORMATION
|
---|
109 | cb As DWORD
|
---|
110 | Reserved As DWORD
|
---|
111 | TotalSize As SIZE_T
|
---|
112 | TotalInUse As SIZE_T
|
---|
113 | PeakUsage As SIZE_T
|
---|
114 | End Type
|
---|
115 | TypeDef PENUM_PAGE_FILE_INFORMATION = *ENUM_PAGE_FILE_INFORMATION
|
---|
116 |
|
---|
117 | TypeDef PENUM_PAGE_FILE_CALLBACKW = *Function(pContext As VoidPtr, pPageFileInfo As PENUM_PAGE_FILE_INFORMATION, lpFilename As LPCWSTR) As BOOL
|
---|
118 | TypeDef PENUM_PAGE_FILE_CALLBACKA = *Function(pContext As VoidPtr, pPageFileInfo As PENUM_PAGE_FILE_INFORMATION, lpFilename As LPCSTR) As BOOL
|
---|
119 | #ifdef UNICODE
|
---|
120 | TypeDef PENUM_PAGE_FILE_CALLBACK = PENUM_PAGE_FILE_CALLBACKW
|
---|
121 | #else
|
---|
122 | TypeDef PENUM_PAGE_FILE_CALLBACK = PENUM_PAGE_FILE_CALLBACKA
|
---|
123 | #endif
|
---|
124 |
|
---|
125 | Declare Function EnumPageFiles Lib "psapi" Alias _FuncName_EnumPageFiles (pCallBackRoutine As PENUM_PAGE_FILE_CALLBACK, pContext As VoidPtr) As BOOL
|
---|
126 | Declare Function GetProcessImageFileName Lib "psapi" Alias _FuncName_GetProcessImageFileName (hProcess As HANDLE, lpImageFileName As LPTSTR, nSize As DWord) As DWORD
|
---|