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