Renamed all LPIMAGE_* types to PIMAGE_*.
[wine/multimedia.git] / include / toolhelp.h
blob1d2ddb701aa3e85b6d11ab9c4bb190a38745e62c
1 #ifndef __WINE_TOOLHELP_H
2 #define __WINE_TOOLHELP_H
4 #include "windows.h"
6 #define MAX_DATA 11
7 #define MAX_MODULE_NAME 9
8 #define MAX_PATH 255
9 #define MAX_CLASSNAME 255
11 #pragma pack(1)
13 /* Global heap */
15 typedef struct
17 DWORD dwSize;
18 WORD wcItems;
19 WORD wcItemsFree;
20 WORD wcItemsLRU;
21 } GLOBALINFO;
23 typedef struct
25 DWORD dwSize;
26 DWORD dwAddress;
27 DWORD dwBlockSize;
28 HGLOBAL16 hBlock;
29 WORD wcLock;
30 WORD wcPageLock;
31 WORD wFlags;
32 BOOL16 wHeapPresent;
33 HGLOBAL16 hOwner;
34 WORD wType;
35 WORD wData;
36 DWORD dwNext;
37 DWORD dwNextAlt;
38 } GLOBALENTRY;
40 /* GlobalFirst()/GlobalNext() flags */
41 #define GLOBAL_ALL 0
42 #define GLOBAL_LRU 1
43 #define GLOBAL_FREE 2
45 /* wType values */
46 #define GT_UNKNOWN 0
47 #define GT_DGROUP 1
48 #define GT_DATA 2
49 #define GT_CODE 3
50 #define GT_TASK 4
51 #define GT_RESOURCE 5
52 #define GT_MODULE 6
53 #define GT_FREE 7
54 #define GT_INTERNAL 8
55 #define GT_SENTINEL 9
56 #define GT_BURGERMASTER 10
58 /* wData values */
59 #define GD_USERDEFINED 0
60 #define GD_CURSORCOMPONENT 1
61 #define GD_BITMAP 2
62 #define GD_ICONCOMPONENT 3
63 #define GD_MENU 4
64 #define GD_DIALOG 5
65 #define GD_STRING 6
66 #define GD_FONTDIR 7
67 #define GD_FONT 8
68 #define GD_ACCELERATORS 9
69 #define GD_RCDATA 10
70 #define GD_ERRTABLE 11
71 #define GD_CURSOR 12
72 #define GD_ICON 14
73 #define GD_NAMETABLE 15
74 #define GD_MAX_RESOURCE 15
76 /* wFlags values */
77 #define GF_PDB_OWNER 0x0100 /* Low byte is KERNEL flags */
79 WORD WINAPI GlobalHandleToSel( HGLOBAL16 handle );
80 BOOL16 WINAPI GlobalInfo( GLOBALINFO *pInfo );
81 BOOL16 WINAPI GlobalFirst( GLOBALENTRY *pGlobal, WORD wFlags );
82 BOOL16 WINAPI GlobalNext( GLOBALENTRY *pGlobal, WORD wFlags) ;
83 BOOL16 WINAPI GlobalEntryHandle( GLOBALENTRY *pGlobal, HGLOBAL16 hItem );
84 BOOL16 WINAPI GlobalEntryModule( GLOBALENTRY *pGlobal, HMODULE16 hModule,
85 WORD wSeg );
87 /* Local heap */
89 typedef struct
91 DWORD dwSize;
92 WORD wcItems;
93 } LOCALINFO;
95 typedef struct
97 DWORD dwSize;
98 HLOCAL16 hHandle;
99 WORD wAddress;
100 WORD wSize;
101 WORD wFlags;
102 WORD wcLock;
103 WORD wType;
104 WORD hHeap;
105 WORD wHeapType;
106 WORD wNext;
107 } LOCALENTRY;
109 /* wHeapType values */
110 #define NORMAL_HEAP 0
111 #define USER_HEAP 1
112 #define GDI_HEAP 2
114 /* wFlags values */
115 #define LF_FIXED 1
116 #define LF_FREE 2
117 #define LF_MOVEABLE 4
119 /* wType values */
120 #define LT_NORMAL 0
121 #define LT_FREE 0xff
122 #define LT_GDI_PEN 1 /* LT_GDI_* is for GDI's heap */
123 #define LT_GDI_BRUSH 2
124 #define LT_GDI_FONT 3
125 #define LT_GDI_PALETTE 4
126 #define LT_GDI_BITMAP 5
127 #define LT_GDI_RGN 6
128 #define LT_GDI_DC 7
129 #define LT_GDI_DISABLED_DC 8
130 #define LT_GDI_METADC 9
131 #define LT_GDI_METAFILE 10
132 #define LT_GDI_MAX LT_GDI_METAFILE
133 #define LT_USER_CLASS 1 /* LT_USER_* is for USER's heap */
134 #define LT_USER_WND 2
135 #define LT_USER_STRING 3
136 #define LT_USER_MENU 4
137 #define LT_USER_CLIP 5
138 #define LT_USER_CBOX 6
139 #define LT_USER_PALETTE 7
140 #define LT_USER_ED 8
141 #define LT_USER_BWL 9
142 #define LT_USER_OWNERDRAW 10
143 #define LT_USER_SPB 11
144 #define LT_USER_CHECKPOINT 12
145 #define LT_USER_DCE 13
146 #define LT_USER_MWP 14
147 #define LT_USER_PROP 15
148 #define LT_USER_LBIV 16
149 #define LT_USER_MISC 17
150 #define LT_USER_ATOMS 18
151 #define LT_USER_LOCKINPUTSTATE 19
152 #define LT_USER_HOOKLIST 20
153 #define LT_USER_USERSEEUSERDOALLOC 21
154 #define LT_USER_HOTKEYLIST 22
155 #define LT_USER_POPUPMENU 23
156 #define LT_USER_HANDLETABLE 32
157 #define LT_USER_MAX LT_USER_HANDLETABLE
159 BOOL16 WINAPI LocalInfo( LOCALINFO *pLocalInfo, HGLOBAL16 handle );
160 BOOL16 WINAPI LocalFirst( LOCALENTRY *pLocalEntry, HGLOBAL16 handle );
161 BOOL16 WINAPI LocalNext( LOCALENTRY *pLocalEntry );
164 /* modules */
166 typedef struct
168 DWORD dwSize;
169 char szModule[MAX_MODULE_NAME + 1];
170 HMODULE16 hModule;
171 WORD wcUsage;
172 char szExePath[MAX_PATH + 1];
173 HANDLE16 wNext;
174 } MODULEENTRY, *LPMODULEENTRY;
176 BOOL16 WINAPI ModuleFirst(MODULEENTRY *lpModule);
177 BOOL16 WINAPI ModuleNext(MODULEENTRY *lpModule);
178 BOOL16 WINAPI ModuleFindName(MODULEENTRY *lpModule, LPCSTR lpstrName);
179 BOOL16 WINAPI ModuleFindHandle(MODULEENTRY *lpModule, HMODULE16 hModule);
181 /* tasks */
183 typedef struct
185 DWORD dwSize;
186 HTASK16 hTask;
187 HTASK16 hTaskParent;
188 HINSTANCE16 hInst;
189 HMODULE16 hModule;
190 WORD wSS;
191 WORD wSP;
192 WORD wStackTop;
193 WORD wStackMinimum;
194 WORD wStackBottom;
195 WORD wcEvents;
196 HGLOBAL16 hQueue;
197 char szModule[MAX_MODULE_NAME + 1];
198 WORD wPSPOffset;
199 HANDLE16 hNext;
200 } TASKENTRY, *LPTASKENTRY;
202 BOOL16 WINAPI TaskFirst(LPTASKENTRY lpTask);
203 BOOL16 WINAPI TaskNext(LPTASKENTRY lpTask);
204 BOOL16 WINAPI TaskFindHandle(LPTASKENTRY lpTask, HTASK16 hTask);
205 DWORD WINAPI TaskSetCSIP(HTASK16 hTask, WORD wCS, WORD wIP);
206 DWORD WINAPI TaskGetCSIP(HTASK16 hTask);
207 BOOL16 WINAPI TaskSwitch(HTASK16 hTask, DWORD dwNewCSIP);
209 /* mem info */
211 typedef struct tagMEMMANINFO {
212 DWORD dwSize;
213 DWORD dwLargestFreeBlock;
214 DWORD dwMaxPagesAvailable;
215 DWORD dwMaxPagesLockable;
216 DWORD dwTotalLinearSpace;
217 DWORD dwTotalUnlockedPages;
218 DWORD dwFreePages;
219 DWORD dwTotalPages;
220 DWORD dwFreeLinearSpace;
221 DWORD dwSwapFilePages;
222 WORD wPageSize;
223 } MEMMANINFO;
224 typedef MEMMANINFO *LPMEMMANINFO;
226 typedef struct
228 DWORD dwSize;
229 WORD wUserFreePercent;
230 WORD wGDIFreePercent;
231 HGLOBAL16 hUserSegment;
232 HGLOBAL16 hGDISegment;
233 } SYSHEAPINFO;
235 BOOL16 WINAPI MemManInfo(LPMEMMANINFO lpEnhMode);
236 BOOL16 WINAPI SystemHeapInfo( SYSHEAPINFO *pHeapInfo );
238 /* timer info */
240 typedef struct tagTIMERINFO {
241 DWORD dwSize;
242 DWORD dwmsSinceStart;
243 DWORD dwmsThisVM;
244 } TIMERINFO;
246 BOOL16 WINAPI TimerCount( TIMERINFO *pTimerInfo );
248 /* Window classes */
250 typedef struct
252 DWORD dwSize;
253 HMODULE16 hInst; /* This is really an hModule */
254 char szClassName[MAX_CLASSNAME + 1];
255 HANDLE16 wNext;
256 } CLASSENTRY;
258 BOOL16 WINAPI ClassFirst( CLASSENTRY *pClassEntry );
259 BOOL16 WINAPI ClassNext( CLASSENTRY *pClassEntry );
262 /* Memory read/write */
264 DWORD WINAPI MemoryRead( WORD sel, DWORD offset, void *buffer, DWORD count );
265 DWORD WINAPI MemoryWrite( WORD sel, DWORD offset, void *buffer, DWORD count );
267 /* flags to NotifyRegister() */
268 #define NF_NORMAL 0 /* everything except taskswitches, debugerrors,
269 * debugstrings
271 #define NF_TASKSWITCH 1 /* get taskswitch information */
272 #define NF_RIP 2 /* get debugerrors of system */
274 BOOL16 WINAPI NotifyRegister(HTASK16 htask,FARPROC16 lpfnCallback,WORD wFlags);
276 #define NFY_UNKNOWN 0
277 #define NFY_LOADSEG 1
278 /* DATA is a pointer to following struct: */
279 typedef struct {
280 DWORD dwSize;
281 WORD wSelector;
282 WORD wSegNum;
283 WORD wType; /* bit 0 set if this is a code segment */
284 WORD wcInstance; /* only valid for data segment */
285 } NFYLOADSEG;
286 /* called when freeing a segment. LOWORD(dwData) is the freed selector */
287 #define NFY_FREESEG 2
289 /* called when loading/starting a DLL */
290 #define NFY_STARTDLL 3
291 typedef struct {
292 DWORD dwSize;
293 HMODULE16 hModule;
294 WORD wCS;
295 WORD wIP;
296 } NFYSTARTDLL;
298 /* called when starting a task. dwData is CS:IP */
299 #define NFY_STARTTASK 4
301 /* called when a task terminates. dwData is the return code */
302 #define NFY_EXITTASK 5
304 /* called when module is removed. LOWORD(dwData) is the handle */
305 #define NFY_DELMODULE 6
307 /* RIP? debugevent */
308 #define NFY_RIP 7
309 typedef struct {
310 DWORD dwSize;
311 WORD wIP;
312 WORD wCS;
313 WORD wSS;
314 WORD wBP;
315 WORD wExitCode;
316 } NFYRIP;
318 /* called before (after?) switching to a task
319 * no data, callback should call GetCurrentTask
321 #define NFY_TASKIN 8
323 /* called before(after?) switching from a task
324 * no data, callback should call GetCurrentTask
326 #define NFY_TASKOUT 9
328 /* returns ASCII input value, dwData not set */
329 #define NFY_INCHAR 10
331 /* output debugstring (pointed to by dwData) */
332 #define NFY_OUTSTRING 11
334 /* log errors */
335 #define NFY_LOGERROR 12
336 typedef struct {
337 DWORD dwSize;
338 UINT16 wErrCode;
339 VOID *lpInfo; /* depends on wErrCode */
340 } NFYLOGERROR;
342 /* called for parameter errors? */
343 #define NFY_LOGPARAMERROR 13
344 typedef struct {
345 DWORD dwSize;
346 UINT16 wErrCode;
347 FARPROC16 lpfnErrorAddr;
348 void **lpBadParam;
349 } NFYLOGPARAMERROR;
351 typedef struct {
352 DWORD dwSize;
353 HTASK16 hTask;
354 WORD wSS;
355 WORD wBP;
356 WORD wCS;
357 WORD wIP;
358 HMODULE16 hModule;
359 WORD wSegment;
360 WORD wFlags;
361 } STACKTRACEENTRY;
363 #pragma pack(4)
365 #endif /* __WINE_TOOLHELP_H */