dxgi: Use CRT allocation functions.
[wine.git] / include / psapi.h
blob6dcb783934e702bdfb266f0a84a576aee05657aa
1 /*
2 * Declarations for PSAPI
4 * Copyright (C) 1998 Patrik Stridvall
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #ifndef __WINE_PSAPI_H
22 #define __WINE_PSAPI_H
24 #ifndef PSAPI_VERSION
25 #define PSAPI_VERSION 2
26 #endif
28 typedef struct _MODULEINFO {
29 LPVOID lpBaseOfDll;
30 DWORD SizeOfImage;
31 LPVOID EntryPoint;
32 } MODULEINFO, *LPMODULEINFO;
34 typedef struct _PROCESS_MEMORY_COUNTERS {
35 DWORD cb;
36 DWORD PageFaultCount;
37 SIZE_T PeakWorkingSetSize;
38 SIZE_T WorkingSetSize;
39 SIZE_T QuotaPeakPagedPoolUsage;
40 SIZE_T QuotaPagedPoolUsage;
41 SIZE_T QuotaPeakNonPagedPoolUsage;
42 SIZE_T QuotaNonPagedPoolUsage;
43 SIZE_T PagefileUsage;
44 SIZE_T PeakPagefileUsage;
45 } PROCESS_MEMORY_COUNTERS;
46 typedef PROCESS_MEMORY_COUNTERS *PPROCESS_MEMORY_COUNTERS;
48 typedef union _PSAPI_WORKING_SET_EX_BLOCK {
49 ULONG_PTR Flags;
50 struct {
51 ULONG_PTR Valid :1;
52 ULONG_PTR ShareCount :3;
53 ULONG_PTR Win32Protection :11;
54 ULONG_PTR Shared :1;
55 ULONG_PTR Node :6;
56 ULONG_PTR Locked :1;
57 ULONG_PTR LargePage :1;
58 } DUMMYSTRUCTNAME;
59 } PSAPI_WORKING_SET_EX_BLOCK, *PPSAPI_WORKING_SET_EX_BLOCK;
61 typedef struct _PSAPI_WORKING_SET_EX_INFORMATION {
62 PVOID VirtualAddress;
63 PSAPI_WORKING_SET_EX_BLOCK VirtualAttributes;
64 } PSAPI_WORKING_SET_EX_INFORMATION, *PPSAPI_WORKING_SET_EX_INFORMATION;
66 typedef struct _PSAPI_WS_WATCH_INFORMATION {
67 LPVOID FaultingPc;
68 LPVOID FaultingVa;
69 } PSAPI_WS_WATCH_INFORMATION, *PPSAPI_WS_WATCH_INFORMATION;
71 typedef struct _PSAPI_WS_WATCH_INFORMATION_EX {
72 PSAPI_WS_WATCH_INFORMATION BasicInfo;
73 ULONG_PTR FaultingThreadId;
74 ULONG_PTR Flags;
75 } PSAPI_WS_WATCH_INFORMATION_EX, *PPSAPI_WS_WATCH_INFORMATION_EX;
77 typedef struct _PERFORMANCE_INFORMATION {
78 DWORD cb;
79 SIZE_T CommitTotal;
80 SIZE_T CommitLimit;
81 SIZE_T CommitPeak;
82 SIZE_T PhysicalTotal;
83 SIZE_T PhysicalAvailable;
84 SIZE_T SystemCache;
85 SIZE_T KernelTotal;
86 SIZE_T KernelPaged;
87 SIZE_T KernelNonpaged;
88 SIZE_T PageSize;
89 DWORD HandleCount;
90 DWORD ProcessCount;
91 DWORD ThreadCount;
92 } PERFORMANCE_INFORMATION, *PPERFORMANCE_INFORMATION;
94 typedef struct _ENUM_PAGE_FILE_INFORMATION {
95 DWORD cb;
96 DWORD Reserved;
97 SIZE_T TotalSize;
98 SIZE_T TotalInUse;
99 SIZE_T PeakUsage;
100 } ENUM_PAGE_FILE_INFORMATION, *PENUM_PAGE_FILE_INFORMATION;
102 typedef BOOL (*PENUM_PAGE_FILE_CALLBACKA) (LPVOID, PENUM_PAGE_FILE_INFORMATION, LPCSTR);
103 typedef BOOL (*PENUM_PAGE_FILE_CALLBACKW) (LPVOID, PENUM_PAGE_FILE_INFORMATION, LPCWSTR);
104 #define PENUM_PAGE_FILE_CALLBACK WINELIB_NAME_AW(PENUM_PAGE_FILE_CALLBACK)
106 #ifdef __cplusplus
107 extern "C" {
108 #endif
110 #if PSAPI_VERSION > 1
111 #define EnumProcesses K32EnumProcesses
112 #define EnumProcessModules K32EnumProcessModules
113 #define EnumProcessModulesEx K32EnumProcessModulesEx
114 #define GetModuleBaseNameA K32GetModuleBaseNameA
115 #define GetModuleBaseNameW K32GetModuleBaseNameW
116 #define GetModuleFileNameExA K32GetModuleFileNameExA
117 #define GetModuleFileNameExW K32GetModuleFileNameExW
118 #define GetModuleInformation K32GetModuleInformation
119 #define EmptyWorkingSet K32EmptyWorkingSet
120 #define QueryWorkingSet K32QueryWorkingSet
121 #define QueryWorkingSetEx K32QueryWorkingSetEx
122 #define InitializeProcessForWsWatch K32InitializeProcessForWsWatch
123 #define GetWsChanges K32GetWsChanges
124 #define GetWsChangesEx K32GetWsChangesEx
125 #define GetMappedFileNameW K32GetMappedFileNameW
126 #define GetMappedFileNameA K32GetMappedFileNameA
127 #define EnumDeviceDrivers K32EnumDeviceDrivers
128 #define GetDeviceDriverBaseNameA K32GetDeviceDriverBaseNameA
129 #define GetDeviceDriverBaseNameW K32GetDeviceDriverBaseNameW
130 #define GetDeviceDriverFileNameA K32GetDeviceDriverFileNameA
131 #define GetDeviceDriverFileNameW K32GetDeviceDriverFileNameW
132 #define GetProcessMemoryInfo K32GetProcessMemoryInfo
133 #define GetPerformanceInfo K32GetPerformanceInfo
134 #define EnumPageFilesW K32EnumPageFilesW
135 #define EnumPageFilesA K32EnumPageFilesA
136 #define GetProcessImageFileNameA K32GetProcessImageFileNameA
137 #define GetProcessImageFileNameW K32GetProcessImageFileNameW
138 #endif
140 /* filter flags for EnumProcessModulesEx */
141 #define LIST_MODULES_32BIT 0x01
142 #define LIST_MODULES_64BIT 0x02
143 #define LIST_MODULES_ALL 0x03
144 #define LIST_MODULES_DEFAULT 0x00
146 BOOL WINAPI EnumProcesses(DWORD*, DWORD, DWORD*);
147 BOOL WINAPI EnumProcessModules(HANDLE, HMODULE*, DWORD, LPDWORD);
148 BOOL WINAPI EnumProcessModulesEx(HANDLE, HMODULE*, DWORD, LPDWORD, DWORD);
149 DWORD WINAPI GetModuleBaseNameA(HANDLE, HMODULE, LPSTR, DWORD);
150 DWORD WINAPI GetModuleBaseNameW(HANDLE, HMODULE, LPWSTR, DWORD);
151 #define GetModuleBaseName WINELIB_NAME_AW(GetModuleBaseName)
152 DWORD WINAPI GetModuleFileNameExA(HANDLE, HMODULE, LPSTR, DWORD);
153 DWORD WINAPI GetModuleFileNameExW(HANDLE, HMODULE, LPWSTR, DWORD);
154 #define GetModuleFileNameEx WINELIB_NAME_AW(GetModuleFileNameEx)
155 BOOL WINAPI GetModuleInformation(HANDLE, HMODULE, LPMODULEINFO, DWORD);
156 BOOL WINAPI EmptyWorkingSet(HANDLE);
157 BOOL WINAPI QueryWorkingSet(HANDLE, PVOID, DWORD);
158 BOOL WINAPI QueryWorkingSetEx(HANDLE, PVOID, DWORD);
159 BOOL WINAPI InitializeProcessForWsWatch(HANDLE);
160 BOOL WINAPI GetWsChanges(HANDLE, PPSAPI_WS_WATCH_INFORMATION, DWORD);
161 BOOL WINAPI GetWsChangesEx(HANDLE, PSAPI_WS_WATCH_INFORMATION_EX*, DWORD*);
162 DWORD WINAPI GetMappedFileNameW(HANDLE, LPVOID, LPWSTR, DWORD);
163 DWORD WINAPI GetMappedFileNameA(HANDLE, LPVOID, LPSTR, DWORD);
164 #define GetMappedFileName WINELIB_NAME_AW(GetMappedFileName)
165 BOOL WINAPI EnumDeviceDrivers(LPVOID*, DWORD, LPDWORD);
166 DWORD WINAPI GetDeviceDriverBaseNameA(LPVOID, LPSTR, DWORD);
167 DWORD WINAPI GetDeviceDriverBaseNameW(LPVOID, LPWSTR, DWORD);
168 #define GetDeviceDriverBaseName WINELIB_NAME_AW(GetDeviceDriverBaseName)
169 DWORD WINAPI GetDeviceDriverFileNameA(LPVOID, LPSTR, DWORD);
170 DWORD WINAPI GetDeviceDriverFileNameW(LPVOID, LPWSTR, DWORD);
171 #define GetDeviceDriverFileName WINELIB_NAME_AW(GetDeviceDriverFileName)
172 BOOL WINAPI GetProcessMemoryInfo(HANDLE, PPROCESS_MEMORY_COUNTERS, DWORD);
173 BOOL WINAPI GetPerformanceInfo(PPERFORMANCE_INFORMATION, DWORD);
174 BOOL WINAPI EnumPageFilesA(PENUM_PAGE_FILE_CALLBACKA, LPVOID);
175 BOOL WINAPI EnumPageFilesW(PENUM_PAGE_FILE_CALLBACKW, LPVOID);
176 #define EnumPageFiles WINELIB_NAME_AW(EnumPageFiles)
177 DWORD WINAPI GetProcessImageFileNameA(HANDLE, LPSTR, DWORD);
178 DWORD WINAPI GetProcessImageFileNameW(HANDLE, LPWSTR, DWORD);
179 #define GetProcessImageFileName WINELIB_NAME_AW(GetProcessImageFileName)
181 #ifdef __cplusplus
183 #endif
185 #endif /* __WINE_PSAPI_H */