Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

356 lines
6.5 KiB

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