source: dev/trunk/abdev/BasicCompiler_Common/Psapi.h@ 154

Last change on this file since 154 was 4, checked in by dai_9181, 18 years ago
File size: 6.6 KB
Line 
1/*++ BUILD Version: 0001 // Increment this if a change has global effects
2
3Copyright (c) 1994-1999 Microsoft Corporation
4
5Module Name:
6
7 psapi.h
8
9Abstract:
10
11 Include file for APIs provided by PSAPI.DLL
12
13Author:
14
15 Richard Shupak [richards] 06-Jan-1994
16
17Revision 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
29extern "C" {
30#endif
31
32BOOL
33WINAPI
34EnumProcesses(
35 DWORD * lpidProcess,
36 DWORD cb,
37 DWORD * cbNeeded
38 );
39
40BOOL
41WINAPI
42EnumProcessModules(
43 HANDLE hProcess,
44 HMODULE *lphModule,
45 DWORD cb,
46 LPDWORD lpcbNeeded
47 );
48
49DWORD
50WINAPI
51GetModuleBaseNameA(
52 HANDLE hProcess,
53 HMODULE hModule,
54 LPSTR lpBaseName,
55 DWORD nSize
56 );
57
58DWORD
59WINAPI
60GetModuleBaseNameW(
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
74DWORD
75WINAPI
76GetModuleFileNameExA(
77 HANDLE hProcess,
78 HMODULE hModule,
79 LPSTR lpFilename,
80 DWORD nSize
81 );
82
83DWORD
84WINAPI
85GetModuleFileNameExW(
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
99typedef struct _MODULEINFO {
100 LPVOID lpBaseOfDll;
101 DWORD SizeOfImage;
102 LPVOID EntryPoint;
103} MODULEINFO, *LPMODULEINFO;
104
105
106BOOL
107WINAPI
108GetModuleInformation(
109 HANDLE hProcess,
110 HMODULE hModule,
111 LPMODULEINFO lpmodinfo,
112 DWORD cb
113 );
114
115
116BOOL
117WINAPI
118EmptyWorkingSet(
119 HANDLE hProcess
120 );
121
122
123BOOL
124WINAPI
125QueryWorkingSet(
126 HANDLE hProcess,
127 PVOID pv,
128 DWORD cb
129 );
130
131BOOL
132WINAPI
133QueryWorkingSetEx(
134 HANDLE hProcess,
135 PVOID pv,
136 DWORD cb
137 );
138
139BOOL
140WINAPI
141InitializeProcessForWsWatch(
142 HANDLE hProcess
143 );
144
145
146typedef struct _PSAPI_WS_WATCH_INFORMATION {
147 LPVOID FaultingPc;
148 LPVOID FaultingVa;
149} PSAPI_WS_WATCH_INFORMATION, *PPSAPI_WS_WATCH_INFORMATION;
150
151BOOL
152WINAPI
153GetWsChanges(
154 HANDLE hProcess,
155 PPSAPI_WS_WATCH_INFORMATION lpWatchInfo,
156 DWORD cb
157 );
158
159DWORD
160WINAPI
161GetMappedFileNameW(
162 HANDLE hProcess,
163 LPVOID lpv,
164 LPWSTR lpFilename,
165 DWORD nSize
166 );
167
168DWORD
169WINAPI
170GetMappedFileNameA(
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
183BOOL
184WINAPI
185EnumDeviceDrivers(
186 LPVOID *lpImageBase,
187 DWORD cb,
188 LPDWORD lpcbNeeded
189 );
190
191
192DWORD
193WINAPI
194GetDeviceDriverBaseNameA(
195 LPVOID ImageBase,
196 LPSTR lpBaseName,
197 DWORD nSize
198 );
199
200DWORD
201WINAPI
202GetDeviceDriverBaseNameW(
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
215DWORD
216WINAPI
217GetDeviceDriverFileNameA(
218 LPVOID ImageBase,
219 LPSTR lpFilename,
220 DWORD nSize
221 );
222
223DWORD
224WINAPI
225GetDeviceDriverFileNameW(
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
239typedef 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;
251typedef PROCESS_MEMORY_COUNTERS *PPROCESS_MEMORY_COUNTERS;
252
253#if (_WIN32_WINNT >= 0x0501)
254
255typedef 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;
268typedef PROCESS_MEMORY_COUNTERS_EX *PPROCESS_MEMORY_COUNTERS_EX;
269
270#endif
271
272BOOL
273WINAPI
274GetProcessMemoryInfo(
275 HANDLE Process,
276 PPROCESS_MEMORY_COUNTERS ppsmemCounters,
277 DWORD cb
278 );
279
280typedef 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
297BOOL
298WINAPI
299GetPerformanceInfo (
300 PPERFORMACE_INFORMATION pPerformanceInformation,
301 DWORD cb
302 );
303
304typedef 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
312typedef BOOL (*PENUM_PAGE_FILE_CALLBACKW) (LPVOID pContext, PENUM_PAGE_FILE_INFORMATION pPageFileInfo, LPCWSTR lpFilename);
313
314typedef BOOL (*PENUM_PAGE_FILE_CALLBACKA) (LPVOID pContext, PENUM_PAGE_FILE_INFORMATION pPageFileInfo, LPCSTR lpFilename);
315
316BOOL
317WINAPI
318EnumPageFilesW (
319 PENUM_PAGE_FILE_CALLBACKW pCallBackRoutine,
320 LPVOID pContext
321 );
322
323BOOL
324WINAPI
325EnumPageFilesA (
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
338DWORD
339WINAPI
340GetProcessImageFileNameA(
341 HANDLE hProcess,
342 LPSTR lpImageFileName,
343 DWORD nSize
344 );
345
346DWORD
347WINAPI
348GetProcessImageFileNameW(
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
Note: See TracBrowser for help on using the repository browser.