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.

253 lines
4.1 KiB

  1. /*++ BUILD Version: 0001 // Increment this if a change has global effects
  2. Copyright (c) 1994-1996 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. #ifdef __cplusplus
  14. extern "C" {
  15. #endif
  16. BOOL
  17. WINAPI
  18. EnumProcesses(
  19. DWORD * lpidProcess,
  20. DWORD cb,
  21. DWORD * cbNeeded
  22. );
  23. BOOL
  24. WINAPI
  25. EnumProcessModules(
  26. HANDLE hProcess,
  27. HMODULE *lphModule,
  28. DWORD cb,
  29. LPDWORD lpcbNeeded
  30. );
  31. DWORD
  32. WINAPI
  33. GetModuleBaseNameA(
  34. HANDLE hProcess,
  35. HMODULE hModule,
  36. LPSTR lpBaseName,
  37. DWORD nSize
  38. );
  39. DWORD
  40. WINAPI
  41. GetModuleBaseNameW(
  42. HANDLE hProcess,
  43. HMODULE hModule,
  44. LPWSTR lpBaseName,
  45. DWORD nSize
  46. );
  47. #ifdef UNICODE
  48. #define GetModuleBaseName GetModuleBaseNameW
  49. #else
  50. #define GetModuleBaseName GetModuleBaseNameA
  51. #endif // !UNICODE
  52. DWORD
  53. WINAPI
  54. GetModuleFileNameExA(
  55. HANDLE hProcess,
  56. HMODULE hModule,
  57. LPSTR lpFilename,
  58. DWORD nSize
  59. );
  60. DWORD
  61. WINAPI
  62. GetModuleFileNameExW(
  63. HANDLE hProcess,
  64. HMODULE hModule,
  65. LPWSTR lpFilename,
  66. DWORD nSize
  67. );
  68. #ifdef UNICODE
  69. #define GetModuleFileNameEx GetModuleFileNameExW
  70. #else
  71. #define GetModuleFileNameEx GetModuleFileNameExA
  72. #endif // !UNICODE
  73. typedef struct _MODULEINFO {
  74. LPVOID lpBaseOfDll;
  75. DWORD SizeOfImage;
  76. LPVOID EntryPoint;
  77. } MODULEINFO, *LPMODULEINFO;
  78. BOOL
  79. WINAPI
  80. GetModuleInformation(
  81. HANDLE hProcess,
  82. HMODULE hModule,
  83. LPMODULEINFO lpmodinfo,
  84. DWORD cb
  85. );
  86. BOOL
  87. WINAPI
  88. EmptyWorkingSet(
  89. HANDLE hProcess
  90. );
  91. BOOL
  92. WINAPI
  93. QueryWorkingSet(
  94. HANDLE hProcess,
  95. PVOID pv,
  96. DWORD cb
  97. );
  98. BOOL
  99. WINAPI
  100. InitializeProcessForWsWatch(
  101. HANDLE hProcess
  102. );
  103. typedef struct _PSAPI_WS_WATCH_INFORMATION {
  104. LPVOID FaultingPc;
  105. LPVOID FaultingVa;
  106. } PSAPI_WS_WATCH_INFORMATION, *PPSAPI_WS_WATCH_INFORMATION;
  107. BOOL
  108. WINAPI
  109. GetWsChanges(
  110. HANDLE hProcess,
  111. PPSAPI_WS_WATCH_INFORMATION lpWatchInfo,
  112. DWORD cb
  113. );
  114. DWORD
  115. WINAPI
  116. GetMappedFileNameW(
  117. HANDLE hProcess,
  118. LPVOID lpv,
  119. LPWSTR lpFilename,
  120. DWORD nSize
  121. );
  122. DWORD
  123. WINAPI
  124. GetMappedFileNameA(
  125. HANDLE hProcess,
  126. LPVOID lpv,
  127. LPSTR lpFilename,
  128. DWORD nSize
  129. );
  130. #ifdef UNICODE
  131. #define GetMappedFilenameEx GetMappedFilenameExW
  132. #else
  133. #define GetMappedFilenameEx GetMappedFilenameExA
  134. #endif // !UNICODE
  135. BOOL
  136. WINAPI
  137. EnumDeviceDrivers(
  138. LPVOID *lpImageBase,
  139. DWORD cb,
  140. LPDWORD lpcbNeeded
  141. );
  142. DWORD
  143. WINAPI
  144. GetDeviceDriverBaseNameA(
  145. LPVOID ImageBase,
  146. LPSTR lpBaseName,
  147. DWORD nSize
  148. );
  149. DWORD
  150. WINAPI
  151. GetDeviceDriverBaseNameW(
  152. LPVOID ImageBase,
  153. LPWSTR lpBaseName,
  154. DWORD nSize
  155. );
  156. #ifdef UNICODE
  157. #define GetDeviceDriverBaseName GetDeviceDriverBaseNameW
  158. #else
  159. #define GetDeviceDriverBaseName GetDeviceDriverBaseNameA
  160. #endif // !UNICODE
  161. DWORD
  162. WINAPI
  163. GetDeviceDriverFileNameA(
  164. LPVOID ImageBase,
  165. LPSTR lpFilename,
  166. DWORD nSize
  167. );
  168. DWORD
  169. WINAPI
  170. GetDeviceDriverFileNameW(
  171. LPVOID ImageBase,
  172. LPWSTR lpFilename,
  173. DWORD nSize
  174. );
  175. #ifdef UNICODE
  176. #define GetDeviceDriverFileName GetDeviceDriverFileNameW
  177. #else
  178. #define GetDeviceDriverFileName GetDeviceDriverFileNameA
  179. #endif // !UNICODE
  180. // Structure for GetProcessMemoryInfo()
  181. typedef struct _PROCESS_MEMORY_COUNTERS {
  182. DWORD cb;
  183. DWORD PageFaultCount;
  184. DWORD PeakWorkingSetSize;
  185. DWORD WorkingSetSize;
  186. DWORD QuotaPeakPagedPoolUsage;
  187. DWORD QuotaPagedPoolUsage;
  188. DWORD QuotaPeakNonPagedPoolUsage;
  189. DWORD QuotaNonPagedPoolUsage;
  190. DWORD PagefileUsage;
  191. DWORD PeakPagefileUsage;
  192. } PROCESS_MEMORY_COUNTERS;
  193. typedef PROCESS_MEMORY_COUNTERS *PPROCESS_MEMORY_COUNTERS;
  194. BOOL
  195. WINAPI
  196. GetProcessMemoryInfo(
  197. HANDLE Process,
  198. PPROCESS_MEMORY_COUNTERS ppsmemCounters,
  199. DWORD cb
  200. );
  201. #ifdef __cplusplus
  202. }
  203. #endif
  204. #endif