Fix for SetAbortProc16, stub for SetAbortProc32 and tidy up some other
[wine/multimedia.git] / include / toolhelp.h
blobbb0a572f79fc96a1ab963ce33f9a8083e12875c3
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 );
163 /* Local 32-bit heap */
165 typedef struct
167 DWORD dwSize; /* 00 */
168 DWORD dwMemReserved; /* 04 */
169 DWORD dwMemCommitted; /* 08 */
170 DWORD dwTotalFree; /* 0C */
171 DWORD dwLargestFreeBlock; /* 10 */
172 DWORD dwcFreeHandles; /* 14 */
173 } LOCAL32INFO;
175 typedef struct
177 DWORD dwSize; /* 00 */
178 WORD hHandle; /* 04 */
179 DWORD dwAddress; /* 06 */
180 DWORD dwSizeBlock; /* 0A */
181 WORD wFlags; /* 0E */
182 WORD wType; /* 10 */
183 WORD hHeap; /* 12 */
184 WORD wHeapType; /* 14 */
185 DWORD dwNext; /* 16 */
186 DWORD dwNextAlt; /* 1A */
187 } LOCAL32ENTRY;
189 /* LOCAL32ENTRY.wHeapType flags same as LOCALENTRY.wHeapType flags */
190 /* LOCAL32ENTRY.wFlags same as LOCALENTRY.wFlags */
191 /* LOCAL32ENTRY.wType same as LOCALENTRY.wType */
193 BOOL16 WINAPI Local32Info( LOCAL32INFO *pLocal32Info, HGLOBAL16 handle );
194 BOOL16 WINAPI Local32First( LOCAL32ENTRY *pLocal32Entry, HGLOBAL16 handle );
195 BOOL16 WINAPI Local32Next( LOCAL32ENTRY *pLocal32Entry );
198 /* modules */
200 typedef struct
202 DWORD dwSize;
203 char szModule[MAX_MODULE_NAME + 1];
204 HMODULE16 hModule;
205 WORD wcUsage;
206 char szExePath[MAX_PATH + 1];
207 HANDLE16 wNext;
208 } MODULEENTRY, *LPMODULEENTRY;
210 BOOL16 WINAPI ModuleFirst(MODULEENTRY *lpModule);
211 BOOL16 WINAPI ModuleNext(MODULEENTRY *lpModule);
212 BOOL16 WINAPI ModuleFindName(MODULEENTRY *lpModule, LPCSTR lpstrName);
213 BOOL16 WINAPI ModuleFindHandle(MODULEENTRY *lpModule, HMODULE16 hModule);
215 /* tasks */
217 typedef struct
219 DWORD dwSize;
220 HTASK16 hTask;
221 HTASK16 hTaskParent;
222 HINSTANCE16 hInst;
223 HMODULE16 hModule;
224 WORD wSS;
225 WORD wSP;
226 WORD wStackTop;
227 WORD wStackMinimum;
228 WORD wStackBottom;
229 WORD wcEvents;
230 HGLOBAL16 hQueue;
231 char szModule[MAX_MODULE_NAME + 1];
232 WORD wPSPOffset;
233 HANDLE16 hNext;
234 } TASKENTRY, *LPTASKENTRY;
236 BOOL16 WINAPI TaskFirst(LPTASKENTRY lpTask);
237 BOOL16 WINAPI TaskNext(LPTASKENTRY lpTask);
238 BOOL16 WINAPI TaskFindHandle(LPTASKENTRY lpTask, HTASK16 hTask);
239 DWORD WINAPI TaskSetCSIP(HTASK16 hTask, WORD wCS, WORD wIP);
240 DWORD WINAPI TaskGetCSIP(HTASK16 hTask);
241 BOOL16 WINAPI TaskSwitch(HTASK16 hTask, DWORD dwNewCSIP);
243 /* mem info */
245 typedef struct tagMEMMANINFO {
246 DWORD dwSize;
247 DWORD dwLargestFreeBlock;
248 DWORD dwMaxPagesAvailable;
249 DWORD dwMaxPagesLockable;
250 DWORD dwTotalLinearSpace;
251 DWORD dwTotalUnlockedPages;
252 DWORD dwFreePages;
253 DWORD dwTotalPages;
254 DWORD dwFreeLinearSpace;
255 DWORD dwSwapFilePages;
256 WORD wPageSize;
257 } MEMMANINFO;
258 typedef MEMMANINFO *LPMEMMANINFO;
260 typedef struct
262 DWORD dwSize;
263 WORD wUserFreePercent;
264 WORD wGDIFreePercent;
265 HGLOBAL16 hUserSegment;
266 HGLOBAL16 hGDISegment;
267 } SYSHEAPINFO;
269 BOOL16 WINAPI MemManInfo(LPMEMMANINFO lpEnhMode);
270 BOOL16 WINAPI SystemHeapInfo( SYSHEAPINFO *pHeapInfo );
272 /* timer info */
274 typedef struct tagTIMERINFO {
275 DWORD dwSize;
276 DWORD dwmsSinceStart;
277 DWORD dwmsThisVM;
278 } TIMERINFO;
280 BOOL16 WINAPI TimerCount( TIMERINFO *pTimerInfo );
282 /* Window classes */
284 typedef struct
286 DWORD dwSize;
287 HMODULE16 hInst; /* This is really an hModule */
288 char szClassName[MAX_CLASSNAME + 1];
289 HANDLE16 wNext;
290 } CLASSENTRY;
292 BOOL16 WINAPI ClassFirst( CLASSENTRY *pClassEntry );
293 BOOL16 WINAPI ClassNext( CLASSENTRY *pClassEntry );
296 /* Memory read/write */
298 DWORD WINAPI MemoryRead( WORD sel, DWORD offset, void *buffer, DWORD count );
299 DWORD WINAPI MemoryWrite( WORD sel, DWORD offset, void *buffer, DWORD count );
301 /* flags to NotifyRegister() */
302 #define NF_NORMAL 0 /* everything except taskswitches, debugerrors,
303 * debugstrings
305 #define NF_TASKSWITCH 1 /* get taskswitch information */
306 #define NF_RIP 2 /* get debugerrors of system */
308 BOOL16 WINAPI NotifyRegister(HTASK16 htask,FARPROC16 lpfnCallback,WORD wFlags);
310 #define NFY_UNKNOWN 0
311 #define NFY_LOADSEG 1
312 /* DATA is a pointer to following struct: */
313 typedef struct {
314 DWORD dwSize;
315 WORD wSelector;
316 WORD wSegNum;
317 WORD wType; /* bit 0 set if this is a code segment */
318 WORD wcInstance; /* only valid for data segment */
319 } NFYLOADSEG;
320 /* called when freeing a segment. LOWORD(dwData) is the freed selector */
321 #define NFY_FREESEG 2
323 /* called when loading/starting a DLL */
324 #define NFY_STARTDLL 3
325 typedef struct {
326 DWORD dwSize;
327 HMODULE16 hModule;
328 WORD wCS;
329 WORD wIP;
330 } NFYSTARTDLL;
332 /* called when starting a task. dwData is CS:IP */
333 #define NFY_STARTTASK 4
335 /* called when a task terminates. dwData is the return code */
336 #define NFY_EXITTASK 5
338 /* called when module is removed. LOWORD(dwData) is the handle */
339 #define NFY_DELMODULE 6
341 /* RIP? debugevent */
342 #define NFY_RIP 7
343 typedef struct {
344 DWORD dwSize;
345 WORD wIP;
346 WORD wCS;
347 WORD wSS;
348 WORD wBP;
349 WORD wExitCode;
350 } NFYRIP;
352 /* called before (after?) switching to a task
353 * no data, callback should call GetCurrentTask
355 #define NFY_TASKIN 8
357 /* called before(after?) switching from a task
358 * no data, callback should call GetCurrentTask
360 #define NFY_TASKOUT 9
362 /* returns ASCII input value, dwData not set */
363 #define NFY_INCHAR 10
365 /* output debugstring (pointed to by dwData) */
366 #define NFY_OUTSTRING 11
368 /* log errors */
369 #define NFY_LOGERROR 12
370 typedef struct {
371 DWORD dwSize;
372 UINT16 wErrCode;
373 VOID *lpInfo; /* depends on wErrCode */
374 } NFYLOGERROR;
376 /* called for parameter errors? */
377 #define NFY_LOGPARAMERROR 13
378 typedef struct {
379 DWORD dwSize;
380 UINT16 wErrCode;
381 FARPROC16 lpfnErrorAddr;
382 void **lpBadParam;
383 } NFYLOGPARAMERROR;
385 typedef struct {
386 DWORD dwSize;
387 HTASK16 hTask;
388 WORD wSS;
389 WORD wBP;
390 WORD wCS;
391 WORD wIP;
392 HMODULE16 hModule;
393 WORD wSegment;
394 WORD wFlags;
395 } STACKTRACEENTRY;
397 #pragma pack(4)
400 * Process Entry list as created by CreateToolHelp32Snapshot
403 typedef struct tagPROCESSENTRY32 {
404 DWORD dwSize;
405 DWORD cntUsage;
406 DWORD th32ProcessID;
407 DWORD th32DefaultHeapID;
408 DWORD th32ModuleID;
409 DWORD cntThreads;
410 DWORD th32ParentProcessID;
411 LONG pcPriClassBase;
412 DWORD dwFlags;
413 char szExeFile[MAX_PATH];
414 } PROCESSENTRY32;
415 typedef PROCESSENTRY32 * PPROCESSENTRY32;
416 typedef PROCESSENTRY32 * LPPROCESSENTRY32;
418 BOOL32 WINAPI Process32First(HANDLE32,LPPROCESSENTRY32);
419 BOOL32 WINAPI Process32Next(HANDLE32,LPPROCESSENTRY32);
422 #endif /* __WINE_TOOLHELP_H */