[4] | 1 | /*++ BUILD Version: 0001 // Increment this if a change has global effects
|
---|
| 2 |
|
---|
| 3 | Copyright (c) 1994-1999 Microsoft Corporation
|
---|
| 4 |
|
---|
| 5 | Module Name:
|
---|
| 6 |
|
---|
| 7 | psapi.h
|
---|
| 8 |
|
---|
| 9 | Abstract:
|
---|
| 10 |
|
---|
| 11 | Include file for APIs provided by PSAPI.DLL
|
---|
| 12 |
|
---|
| 13 | Author:
|
---|
| 14 |
|
---|
| 15 | Richard Shupak [richards] 06-Jan-1994
|
---|
| 16 |
|
---|
| 17 | Revision History:
|
---|
| 18 |
|
---|
| 19 | --*/
|
---|
| 20 |
|
---|
| 21 | #ifndef _PSAPI_H_
|
---|
| 22 | #define _PSAPI_H_
|
---|
| 23 |
|
---|
| 24 | #if _MSC_VER > 1000
|
---|
| 25 | #pragma once
|
---|
| 26 | #endif
|
---|
| 27 |
|
---|
| 28 | #ifdef __cplusplus
|
---|
| 29 | extern "C" {
|
---|
| 30 | #endif
|
---|
| 31 |
|
---|
| 32 | BOOL
|
---|
| 33 | WINAPI
|
---|
| 34 | EnumProcesses(
|
---|
| 35 | DWORD * lpidProcess,
|
---|
| 36 | DWORD cb,
|
---|
| 37 | DWORD * cbNeeded
|
---|
| 38 | );
|
---|
| 39 |
|
---|
| 40 | BOOL
|
---|
| 41 | WINAPI
|
---|
| 42 | EnumProcessModules(
|
---|
| 43 | HANDLE hProcess,
|
---|
| 44 | HMODULE *lphModule,
|
---|
| 45 | DWORD cb,
|
---|
| 46 | LPDWORD lpcbNeeded
|
---|
| 47 | );
|
---|
| 48 |
|
---|
| 49 | DWORD
|
---|
| 50 | WINAPI
|
---|
| 51 | GetModuleBaseNameA(
|
---|
| 52 | HANDLE hProcess,
|
---|
| 53 | HMODULE hModule,
|
---|
| 54 | LPSTR lpBaseName,
|
---|
| 55 | DWORD nSize
|
---|
| 56 | );
|
---|
| 57 |
|
---|
| 58 | DWORD
|
---|
| 59 | WINAPI
|
---|
| 60 | GetModuleBaseNameW(
|
---|
| 61 | HANDLE hProcess,
|
---|
| 62 | HMODULE hModule,
|
---|
| 63 | LPWSTR lpBaseName,
|
---|
| 64 | DWORD nSize
|
---|
| 65 | );
|
---|
| 66 |
|
---|
| 67 | #ifdef UNICODE
|
---|
| 68 | #define GetModuleBaseName GetModuleBaseNameW
|
---|
| 69 | #else
|
---|
| 70 | #define GetModuleBaseName GetModuleBaseNameA
|
---|
| 71 | #endif // !UNICODE
|
---|
| 72 |
|
---|
| 73 |
|
---|
| 74 | DWORD
|
---|
| 75 | WINAPI
|
---|
| 76 | GetModuleFileNameExA(
|
---|
| 77 | HANDLE hProcess,
|
---|
| 78 | HMODULE hModule,
|
---|
| 79 | LPSTR lpFilename,
|
---|
| 80 | DWORD nSize
|
---|
| 81 | );
|
---|
| 82 |
|
---|
| 83 | DWORD
|
---|
| 84 | WINAPI
|
---|
| 85 | GetModuleFileNameExW(
|
---|
| 86 | HANDLE hProcess,
|
---|
| 87 | HMODULE hModule,
|
---|
| 88 | LPWSTR lpFilename,
|
---|
| 89 | DWORD nSize
|
---|
| 90 | );
|
---|
| 91 |
|
---|
| 92 | #ifdef UNICODE
|
---|
| 93 | #define GetModuleFileNameEx GetModuleFileNameExW
|
---|
| 94 | #else
|
---|
| 95 | #define GetModuleFileNameEx GetModuleFileNameExA
|
---|
| 96 | #endif // !UNICODE
|
---|
| 97 |
|
---|
| 98 |
|
---|
| 99 | typedef struct _MODULEINFO {
|
---|
| 100 | LPVOID lpBaseOfDll;
|
---|
| 101 | DWORD SizeOfImage;
|
---|
| 102 | LPVOID EntryPoint;
|
---|
| 103 | } MODULEINFO, *LPMODULEINFO;
|
---|
| 104 |
|
---|
| 105 |
|
---|
| 106 | BOOL
|
---|
| 107 | WINAPI
|
---|
| 108 | GetModuleInformation(
|
---|
| 109 | HANDLE hProcess,
|
---|
| 110 | HMODULE hModule,
|
---|
| 111 | LPMODULEINFO lpmodinfo,
|
---|
| 112 | DWORD cb
|
---|
| 113 | );
|
---|
| 114 |
|
---|
| 115 |
|
---|
| 116 | BOOL
|
---|
| 117 | WINAPI
|
---|
| 118 | EmptyWorkingSet(
|
---|
| 119 | HANDLE hProcess
|
---|
| 120 | );
|
---|
| 121 |
|
---|
| 122 |
|
---|
| 123 | BOOL
|
---|
| 124 | WINAPI
|
---|
| 125 | QueryWorkingSet(
|
---|
| 126 | HANDLE hProcess,
|
---|
| 127 | PVOID pv,
|
---|
| 128 | DWORD cb
|
---|
| 129 | );
|
---|
| 130 |
|
---|
| 131 | BOOL
|
---|
| 132 | WINAPI
|
---|
| 133 | QueryWorkingSetEx(
|
---|
| 134 | HANDLE hProcess,
|
---|
| 135 | PVOID pv,
|
---|
| 136 | DWORD cb
|
---|
| 137 | );
|
---|
| 138 |
|
---|
| 139 | BOOL
|
---|
| 140 | WINAPI
|
---|
| 141 | InitializeProcessForWsWatch(
|
---|
| 142 | HANDLE hProcess
|
---|
| 143 | );
|
---|
| 144 |
|
---|
| 145 |
|
---|
| 146 | typedef struct _PSAPI_WS_WATCH_INFORMATION {
|
---|
| 147 | LPVOID FaultingPc;
|
---|
| 148 | LPVOID FaultingVa;
|
---|
| 149 | } PSAPI_WS_WATCH_INFORMATION, *PPSAPI_WS_WATCH_INFORMATION;
|
---|
| 150 |
|
---|
| 151 | BOOL
|
---|
| 152 | WINAPI
|
---|
| 153 | GetWsChanges(
|
---|
| 154 | HANDLE hProcess,
|
---|
| 155 | PPSAPI_WS_WATCH_INFORMATION lpWatchInfo,
|
---|
| 156 | DWORD cb
|
---|
| 157 | );
|
---|
| 158 |
|
---|
| 159 | DWORD
|
---|
| 160 | WINAPI
|
---|
| 161 | GetMappedFileNameW(
|
---|
| 162 | HANDLE hProcess,
|
---|
| 163 | LPVOID lpv,
|
---|
| 164 | LPWSTR lpFilename,
|
---|
| 165 | DWORD nSize
|
---|
| 166 | );
|
---|
| 167 |
|
---|
| 168 | DWORD
|
---|
| 169 | WINAPI
|
---|
| 170 | GetMappedFileNameA(
|
---|
| 171 | HANDLE hProcess,
|
---|
| 172 | LPVOID lpv,
|
---|
| 173 | LPSTR lpFilename,
|
---|
| 174 | DWORD nSize
|
---|
| 175 | );
|
---|
| 176 |
|
---|
| 177 | #ifdef UNICODE
|
---|
| 178 | #define GetMappedFileName GetMappedFileNameW
|
---|
| 179 | #else
|
---|
| 180 | #define GetMappedFileName GetMappedFileNameA
|
---|
| 181 | #endif // !UNICODE
|
---|
| 182 |
|
---|
| 183 | BOOL
|
---|
| 184 | WINAPI
|
---|
| 185 | EnumDeviceDrivers(
|
---|
| 186 | LPVOID *lpImageBase,
|
---|
| 187 | DWORD cb,
|
---|
| 188 | LPDWORD lpcbNeeded
|
---|
| 189 | );
|
---|
| 190 |
|
---|
| 191 |
|
---|
| 192 | DWORD
|
---|
| 193 | WINAPI
|
---|
| 194 | GetDeviceDriverBaseNameA(
|
---|
| 195 | LPVOID ImageBase,
|
---|
| 196 | LPSTR lpBaseName,
|
---|
| 197 | DWORD nSize
|
---|
| 198 | );
|
---|
| 199 |
|
---|
| 200 | DWORD
|
---|
| 201 | WINAPI
|
---|
| 202 | GetDeviceDriverBaseNameW(
|
---|
| 203 | LPVOID ImageBase,
|
---|
| 204 | LPWSTR lpBaseName,
|
---|
| 205 | DWORD nSize
|
---|
| 206 | );
|
---|
| 207 |
|
---|
| 208 | #ifdef UNICODE
|
---|
| 209 | #define GetDeviceDriverBaseName GetDeviceDriverBaseNameW
|
---|
| 210 | #else
|
---|
| 211 | #define GetDeviceDriverBaseName GetDeviceDriverBaseNameA
|
---|
| 212 | #endif // !UNICODE
|
---|
| 213 |
|
---|
| 214 |
|
---|
| 215 | DWORD
|
---|
| 216 | WINAPI
|
---|
| 217 | GetDeviceDriverFileNameA(
|
---|
| 218 | LPVOID ImageBase,
|
---|
| 219 | LPSTR lpFilename,
|
---|
| 220 | DWORD nSize
|
---|
| 221 | );
|
---|
| 222 |
|
---|
| 223 | DWORD
|
---|
| 224 | WINAPI
|
---|
| 225 | GetDeviceDriverFileNameW(
|
---|
| 226 | LPVOID ImageBase,
|
---|
| 227 | LPWSTR lpFilename,
|
---|
| 228 | DWORD nSize
|
---|
| 229 | );
|
---|
| 230 |
|
---|
| 231 | #ifdef UNICODE
|
---|
| 232 | #define GetDeviceDriverFileName GetDeviceDriverFileNameW
|
---|
| 233 | #else
|
---|
| 234 | #define GetDeviceDriverFileName GetDeviceDriverFileNameA
|
---|
| 235 | #endif // !UNICODE
|
---|
| 236 |
|
---|
| 237 | // Structure for GetProcessMemoryInfo()
|
---|
| 238 |
|
---|
| 239 | typedef struct _PROCESS_MEMORY_COUNTERS {
|
---|
| 240 | DWORD cb;
|
---|
| 241 | DWORD PageFaultCount;
|
---|
| 242 | SIZE_T PeakWorkingSetSize;
|
---|
| 243 | SIZE_T WorkingSetSize;
|
---|
| 244 | SIZE_T QuotaPeakPagedPoolUsage;
|
---|
| 245 | SIZE_T QuotaPagedPoolUsage;
|
---|
| 246 | SIZE_T QuotaPeakNonPagedPoolUsage;
|
---|
| 247 | SIZE_T QuotaNonPagedPoolUsage;
|
---|
| 248 | SIZE_T PagefileUsage;
|
---|
| 249 | SIZE_T PeakPagefileUsage;
|
---|
| 250 | } PROCESS_MEMORY_COUNTERS;
|
---|
| 251 | typedef PROCESS_MEMORY_COUNTERS *PPROCESS_MEMORY_COUNTERS;
|
---|
| 252 |
|
---|
| 253 | #if (_WIN32_WINNT >= 0x0501)
|
---|
| 254 |
|
---|
| 255 | typedef struct _PROCESS_MEMORY_COUNTERS_EX {
|
---|
| 256 | DWORD cb;
|
---|
| 257 | DWORD PageFaultCount;
|
---|
| 258 | SIZE_T PeakWorkingSetSize;
|
---|
| 259 | SIZE_T WorkingSetSize;
|
---|
| 260 | SIZE_T QuotaPeakPagedPoolUsage;
|
---|
| 261 | SIZE_T QuotaPagedPoolUsage;
|
---|
| 262 | SIZE_T QuotaPeakNonPagedPoolUsage;
|
---|
| 263 | SIZE_T QuotaNonPagedPoolUsage;
|
---|
| 264 | SIZE_T PagefileUsage;
|
---|
| 265 | SIZE_T PeakPagefileUsage;
|
---|
| 266 | SIZE_T PrivateUsage;
|
---|
| 267 | } PROCESS_MEMORY_COUNTERS_EX;
|
---|
| 268 | typedef PROCESS_MEMORY_COUNTERS_EX *PPROCESS_MEMORY_COUNTERS_EX;
|
---|
| 269 |
|
---|
| 270 | #endif
|
---|
| 271 |
|
---|
| 272 | BOOL
|
---|
| 273 | WINAPI
|
---|
| 274 | GetProcessMemoryInfo(
|
---|
| 275 | HANDLE Process,
|
---|
| 276 | PPROCESS_MEMORY_COUNTERS ppsmemCounters,
|
---|
| 277 | DWORD cb
|
---|
| 278 | );
|
---|
| 279 |
|
---|
| 280 | typedef struct _PERFORMANCE_INFORMATION {
|
---|
| 281 | DWORD cb;
|
---|
| 282 | SIZE_T CommitTotal;
|
---|
| 283 | SIZE_T CommitLimit;
|
---|
| 284 | SIZE_T CommitPeak;
|
---|
| 285 | SIZE_T PhysicalTotal;
|
---|
| 286 | SIZE_T PhysicalAvailable;
|
---|
| 287 | SIZE_T SystemCache;
|
---|
| 288 | SIZE_T KernelTotal;
|
---|
| 289 | SIZE_T KernelPaged;
|
---|
| 290 | SIZE_T KernelNonpaged;
|
---|
| 291 | SIZE_T PageSize;
|
---|
| 292 | DWORD HandleCount;
|
---|
| 293 | DWORD ProcessCount;
|
---|
| 294 | DWORD ThreadCount;
|
---|
| 295 | } PERFORMANCE_INFORMATION, *PPERFORMANCE_INFORMATION, PERFORMACE_INFORMATION, *PPERFORMACE_INFORMATION;
|
---|
| 296 |
|
---|
| 297 | BOOL
|
---|
| 298 | WINAPI
|
---|
| 299 | GetPerformanceInfo (
|
---|
| 300 | PPERFORMACE_INFORMATION pPerformanceInformation,
|
---|
| 301 | DWORD cb
|
---|
| 302 | );
|
---|
| 303 |
|
---|
| 304 | typedef struct _ENUM_PAGE_FILE_INFORMATION {
|
---|
| 305 | DWORD cb;
|
---|
| 306 | DWORD Reserved;
|
---|
| 307 | SIZE_T TotalSize;
|
---|
| 308 | SIZE_T TotalInUse;
|
---|
| 309 | SIZE_T PeakUsage;
|
---|
| 310 | } ENUM_PAGE_FILE_INFORMATION, *PENUM_PAGE_FILE_INFORMATION;
|
---|
| 311 |
|
---|
| 312 | typedef BOOL (*PENUM_PAGE_FILE_CALLBACKW) (LPVOID pContext, PENUM_PAGE_FILE_INFORMATION pPageFileInfo, LPCWSTR lpFilename);
|
---|
| 313 |
|
---|
| 314 | typedef BOOL (*PENUM_PAGE_FILE_CALLBACKA) (LPVOID pContext, PENUM_PAGE_FILE_INFORMATION pPageFileInfo, LPCSTR lpFilename);
|
---|
| 315 |
|
---|
| 316 | BOOL
|
---|
| 317 | WINAPI
|
---|
| 318 | EnumPageFilesW (
|
---|
| 319 | PENUM_PAGE_FILE_CALLBACKW pCallBackRoutine,
|
---|
| 320 | LPVOID pContext
|
---|
| 321 | );
|
---|
| 322 |
|
---|
| 323 | BOOL
|
---|
| 324 | WINAPI
|
---|
| 325 | EnumPageFilesA (
|
---|
| 326 | PENUM_PAGE_FILE_CALLBACKA pCallBackRoutine,
|
---|
| 327 | LPVOID pContext
|
---|
| 328 | );
|
---|
| 329 |
|
---|
| 330 | #ifdef UNICODE
|
---|
| 331 | #define PENUM_PAGE_FILE_CALLBACK PENUM_PAGE_FILE_CALLBACKW
|
---|
| 332 | #define EnumPageFiles EnumPageFilesW
|
---|
| 333 | #else
|
---|
| 334 | #define PENUM_PAGE_FILE_CALLBACK PENUM_PAGE_FILE_CALLBACKA
|
---|
| 335 | #define EnumPageFiles EnumPageFilesA
|
---|
| 336 | #endif // !UNICODE
|
---|
| 337 |
|
---|
| 338 | DWORD
|
---|
| 339 | WINAPI
|
---|
| 340 | GetProcessImageFileNameA(
|
---|
| 341 | HANDLE hProcess,
|
---|
| 342 | LPSTR lpImageFileName,
|
---|
| 343 | DWORD nSize
|
---|
| 344 | );
|
---|
| 345 |
|
---|
| 346 | DWORD
|
---|
| 347 | WINAPI
|
---|
| 348 | GetProcessImageFileNameW(
|
---|
| 349 | HANDLE hProcess,
|
---|
| 350 | LPWSTR lpImageFileName,
|
---|
| 351 | DWORD nSize
|
---|
| 352 | );
|
---|
| 353 |
|
---|
| 354 | #ifdef UNICODE
|
---|
| 355 | #define GetProcessImageFileName GetProcessImageFileNameW
|
---|
| 356 | #else
|
---|
| 357 | #define GetProcessImageFileName GetProcessImageFileNameA
|
---|
| 358 | #endif // !UNICODE
|
---|
| 359 |
|
---|
| 360 | #ifdef __cplusplus
|
---|
| 361 | }
|
---|
| 362 | #endif
|
---|
| 363 |
|
---|
| 364 | #endif
|
---|