00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043 #ifndef _PSAPI_H_
00044 #define _PSAPI_H_
00045
00046 #if _MSC_VER > 1000
00047 #pragma once
00048 #endif
00049
00050 #ifdef __cplusplus
00051 extern "C" {
00052 #endif
00053
00054 BOOL
00055 WINAPI
00056 EnumProcesses(
00057 DWORD * lpidProcess,
00058 DWORD cb,
00059 DWORD * cbNeeded
00060 );
00061
00062 BOOL
00063 WINAPI
00064 EnumProcessModules(
00065 HANDLE hProcess,
00066 HMODULE *lphModule,
00067 DWORD cb,
00068 LPDWORD lpcbNeeded
00069 );
00070
00071 DWORD
00072 WINAPI
00073 GetModuleBaseNameA(
00074 HANDLE hProcess,
00075 HMODULE hModule,
00076 LPSTR lpBaseName,
00077 DWORD nSize
00078 );
00079
00080 DWORD
00081 WINAPI
00082 GetModuleBaseNameW(
00083 HANDLE hProcess,
00084 HMODULE hModule,
00085 LPWSTR lpBaseName,
00086 DWORD nSize
00087 );
00088
00089 #ifdef UNICODE
00090 #define GetModuleBaseName GetModuleBaseNameW
00091 #else
00092 #define GetModuleBaseName GetModuleBaseNameA
00093 #endif // !UNICODE
00094
00095
00096 DWORD
00097 WINAPI
00098 GetModuleFileNameExA(
00099 HANDLE hProcess,
00100 HMODULE hModule,
00101 LPSTR lpFilename,
00102 DWORD nSize
00103 );
00104
00105 DWORD
00106 WINAPI
00107 GetModuleFileNameExW(
00108 HANDLE hProcess,
00109 HMODULE hModule,
00110 LPWSTR lpFilename,
00111 DWORD nSize
00112 );
00113
00114 #ifdef UNICODE
00115 #define GetModuleFileNameEx GetModuleFileNameExW
00116 #else
00117 #define GetModuleFileNameEx GetModuleFileNameExA
00118 #endif // !UNICODE
00119
00120
00121 typedef struct _MODULEINFO {
00122 LPVOID lpBaseOfDll;
00123 DWORD SizeOfImage;
00124 LPVOID EntryPoint;
00125 } MODULEINFO, *LPMODULEINFO;
00126
00127
00128 BOOL
00129 WINAPI
00130 GetModuleInformation(
00131 HANDLE hProcess,
00132 HMODULE hModule,
00133 LPMODULEINFO lpmodinfo,
00134 DWORD cb
00135 );
00136
00137
00138 BOOL
00139 WINAPI
00140 EmptyWorkingSet(
00141 HANDLE hProcess
00142 );
00143
00144
00145 BOOL
00146 WINAPI
00147 QueryWorkingSet(
00148 HANDLE hProcess,
00149 PVOID pv,
00150 DWORD cb
00151 );
00152
00153 BOOL
00154 WINAPI
00155 InitializeProcessForWsWatch(
00156 HANDLE hProcess
00157 );
00158
00159
00160 typedef struct _PSAPI_WS_WATCH_INFORMATION {
00161 LPVOID FaultingPc;
00162 LPVOID FaultingVa;
00163 } PSAPI_WS_WATCH_INFORMATION, *PPSAPI_WS_WATCH_INFORMATION;
00164
00165 BOOL
00166 WINAPI
00167 GetWsChanges(
00168 HANDLE hProcess,
00169 PPSAPI_WS_WATCH_INFORMATION lpWatchInfo,
00170 DWORD cb
00171 );
00172
00173 DWORD
00174 WINAPI
00175 GetMappedFileNameW(
00176 HANDLE hProcess,
00177 LPVOID lpv,
00178 LPWSTR lpFilename,
00179 DWORD nSize
00180 );
00181
00182 DWORD
00183 WINAPI
00184 GetMappedFileNameA(
00185 HANDLE hProcess,
00186 LPVOID lpv,
00187 LPSTR lpFilename,
00188 DWORD nSize
00189 );
00190
00191 #ifdef UNICODE
00192 #define GetMappedFileName GetMappedFileNameW
00193 #else
00194 #define GetMappedFileName GetMappedFileNameA
00195 #endif // !UNICODE
00196
00197 BOOL
00198 WINAPI
00199 EnumDeviceDrivers(
00200 LPVOID *lpImageBase,
00201 DWORD cb,
00202 LPDWORD lpcbNeeded
00203 );
00204
00205
00206 DWORD
00207 WINAPI
00208 GetDeviceDriverBaseNameA(
00209 LPVOID ImageBase,
00210 LPSTR lpBaseName,
00211 DWORD nSize
00212 );
00213
00214 DWORD
00215 WINAPI
00216 GetDeviceDriverBaseNameW(
00217 LPVOID ImageBase,
00218 LPWSTR lpBaseName,
00219 DWORD nSize
00220 );
00221
00222 #ifdef UNICODE
00223 #define GetDeviceDriverBaseName GetDeviceDriverBaseNameW
00224 #else
00225 #define GetDeviceDriverBaseName GetDeviceDriverBaseNameA
00226 #endif // !UNICODE
00227
00228
00229 DWORD
00230 WINAPI
00231 GetDeviceDriverFileNameA(
00232 LPVOID ImageBase,
00233 LPSTR lpFilename,
00234 DWORD nSize
00235 );
00236
00237 DWORD
00238 WINAPI
00239 GetDeviceDriverFileNameW(
00240 LPVOID ImageBase,
00241 LPWSTR lpFilename,
00242 DWORD nSize
00243 );
00244
00245 #ifdef UNICODE
00246 #define GetDeviceDriverFileName GetDeviceDriverFileNameW
00247 #else
00248 #define GetDeviceDriverFileName GetDeviceDriverFileNameA
00249 #endif // !UNICODE
00250
00251
00252
00253 typedef struct _PROCESS_MEMORY_COUNTERS {
00254 DWORD cb;
00255 DWORD PageFaultCount;
00256 SIZE_T PeakWorkingSetSize;
00257 SIZE_T WorkingSetSize;
00258 SIZE_T QuotaPeakPagedPoolUsage;
00259 SIZE_T QuotaPagedPoolUsage;
00260 SIZE_T QuotaPeakNonPagedPoolUsage;
00261 SIZE_T QuotaNonPagedPoolUsage;
00262 SIZE_T PagefileUsage;
00263 SIZE_T PeakPagefileUsage;
00264 } PROCESS_MEMORY_COUNTERS;
00265 typedef PROCESS_MEMORY_COUNTERS *PPROCESS_MEMORY_COUNTERS;
00266
00267 BOOL
00268 WINAPI
00269 GetProcessMemoryInfo(
00270 HANDLE Process,
00271 PPROCESS_MEMORY_COUNTERS ppsmemCounters,
00272 DWORD cb
00273 );
00274
00275 typedef struct _PERFORMANCE_INFORMATION {
00276 DWORD cb;
00277 SIZE_T CommitTotal;
00278 SIZE_T CommitLimit;
00279 SIZE_T CommitPeak;
00280 SIZE_T PhysicalTotal;
00281 SIZE_T PhysicalAvailable;
00282 SIZE_T SystemCache;
00283 SIZE_T KernelTotal;
00284 SIZE_T KernelPaged;
00285 SIZE_T KernelNonpaged;
00286 SIZE_T PageSize;
00287 DWORD HandleCount;
00288 DWORD ProcessCount;
00289 DWORD ThreadCount;
00290 } PERFORMANCE_INFORMATION, *PPERFORMANCE_INFORMATION, PERFORMACE_INFORMATION, *PPERFORMACE_INFORMATION;
00291
00292 BOOL
00293 WINAPI
00294 GetPerformanceInfo (
00295 PPERFORMACE_INFORMATION pPerformanceInformation,
00296 DWORD cb
00297 );
00298
00299 typedef struct _ENUM_PAGE_FILE_INFORMATION {
00300 DWORD cb;
00301 DWORD Reserved;
00302 SIZE_T TotalSize;
00303 SIZE_T TotalInUse;
00304 SIZE_T PeakUsage;
00305 } ENUM_PAGE_FILE_INFORMATION, *PENUM_PAGE_FILE_INFORMATION;
00306
00307 typedef BOOL (*PENUM_PAGE_FILE_CALLBACKW) (LPVOID pContext, PENUM_PAGE_FILE_INFORMATION pPageFileInfo, LPCWSTR lpFilename);
00308
00309 typedef BOOL (*PENUM_PAGE_FILE_CALLBACKA) (LPVOID pContext, PENUM_PAGE_FILE_INFORMATION pPageFileInfo, LPCSTR lpFilename);
00310
00311 BOOL
00312 WINAPI
00313 EnumPageFilesW (
00314 PENUM_PAGE_FILE_CALLBACKW pCallBackRoutine,
00315 LPVOID pContext
00316 );
00317
00318 BOOL
00319 WINAPI
00320 EnumPageFilesA (
00321 PENUM_PAGE_FILE_CALLBACKA pCallBackRoutine,
00322 LPVOID pContext
00323 );
00324
00325 #ifdef UNICODE
00326 #define PENUM_PAGE_FILE_CALLBACK PENUM_PAGE_FILE_CALLBACKW
00327 #define EnumPageFiles EnumPageFilesW
00328 #else
00329 #define PENUM_PAGE_FILE_CALLBACK PENUM_PAGE_FILE_CALLBACKA
00330 #define EnumPageFiles EnumPageFilesA
00331 #endif // !UNICODE
00332
00333 DWORD
00334 WINAPI
00335 GetProcessImageFileNameA(
00336 HANDLE hProcess,
00337 LPSTR lpImageFileName,
00338 DWORD nSize
00339 );
00340
00341 DWORD
00342 WINAPI
00343 GetProcessImageFileNameW(
00344 HANDLE hProcess,
00345 LPWSTR lpImageFileName,
00346 DWORD nSize
00347 );
00348
00349 #ifdef UNICODE
00350 #define GetProcessImageFileName GetProcessImageFileNameW
00351 #else
00352 #define GetProcessImageFileName GetProcessImageFileNameA
00353 #endif // !UNICODE
00354
00355 #ifdef __cplusplus
00356 }
00357 #endif
00358
00359 #endif