msvcrt/tests: Remove a space before a '\n'.
[wine/gsoc-2012-control.git] / dlls / kernel32 / toolhelp.h
blob6506aaeccf752fb112ef80ec00dd5ed0d705f992
1 /*
2 * Copyright (C) the Wine project
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #ifndef __WINE_TOOLHELP_H
20 #define __WINE_TOOLHELP_H
22 #include <windef.h>
23 #include <wine/windef16.h>
25 #define MAX_DATA 11
26 #define MAX_MODULE_NAME 9
27 #define MAX_PATH16 255
28 #define MAX_CLASSNAME 255
30 #include <pshpack1.h>
32 /* Global heap */
34 typedef struct
36 DWORD dwSize;
37 WORD wcItems;
38 WORD wcItemsFree;
39 WORD wcItemsLRU;
40 } GLOBALINFO;
42 typedef struct
44 DWORD dwSize;
45 DWORD dwAddress;
46 DWORD dwBlockSize;
47 HGLOBAL16 hBlock;
48 WORD wcLock;
49 WORD wcPageLock;
50 WORD wFlags;
51 BOOL16 wHeapPresent;
52 HGLOBAL16 hOwner;
53 WORD wType;
54 WORD wData;
55 DWORD dwNext;
56 DWORD dwNextAlt;
57 } GLOBALENTRY;
59 /* GlobalFirst()/GlobalNext() flags */
60 #define GLOBAL_ALL 0
61 #define GLOBAL_LRU 1
62 #define GLOBAL_FREE 2
64 /* wType values */
65 #define GT_UNKNOWN 0
66 #define GT_DGROUP 1
67 #define GT_DATA 2
68 #define GT_CODE 3
69 #define GT_TASK 4
70 #define GT_RESOURCE 5
71 #define GT_MODULE 6
72 #define GT_FREE 7
73 #define GT_INTERNAL 8
74 #define GT_SENTINEL 9
75 #define GT_BURGERMASTER 10
77 /* wData values */
78 #define GD_USERDEFINED 0
79 #define GD_CURSORCOMPONENT 1
80 #define GD_BITMAP 2
81 #define GD_ICONCOMPONENT 3
82 #define GD_MENU 4
83 #define GD_DIALOG 5
84 #define GD_STRING 6
85 #define GD_FONTDIR 7
86 #define GD_FONT 8
87 #define GD_ACCELERATORS 9
88 #define GD_RCDATA 10
89 #define GD_ERRTABLE 11
90 #define GD_CURSOR 12
91 #define GD_ICON 14
92 #define GD_NAMETABLE 15
93 #define GD_MAX_RESOURCE 15
95 /* wFlags values */
96 #define GF_PDB_OWNER 0x0100 /* Low byte is KERNEL flags */
98 BOOL16 WINAPI GlobalInfo16( GLOBALINFO *pInfo );
99 BOOL16 WINAPI GlobalFirst16( GLOBALENTRY *pGlobal, WORD wFlags );
100 BOOL16 WINAPI GlobalNext16( GLOBALENTRY *pGlobal, WORD wFlags) ;
101 BOOL16 WINAPI GlobalEntryHandle16( GLOBALENTRY *pGlobal, HGLOBAL16 hItem );
102 BOOL16 WINAPI GlobalEntryModule16( GLOBALENTRY *pGlobal, HMODULE16 hModule,
103 WORD wSeg );
105 /* FIXME: Wine internal functions */
106 extern HGLOBAL16 GLOBAL_CreateBlock( UINT16 flags, void *ptr, DWORD size,
107 HGLOBAL16 hOwner, unsigned char selflags );
108 extern BOOL16 GLOBAL_FreeBlock( HGLOBAL16 handle );
109 extern BOOL16 GLOBAL_MoveBlock( HGLOBAL16 handle, void *ptr, DWORD size );
110 extern HGLOBAL16 GLOBAL_Alloc( WORD flags, DWORD size, HGLOBAL16 hOwner, unsigned char selflags );
112 /* Local heap */
114 typedef struct
116 DWORD dwSize;
117 WORD wcItems;
118 } LOCALINFO;
120 typedef struct
122 DWORD dwSize;
123 HLOCAL16 hHandle;
124 WORD wAddress;
125 WORD wSize;
126 WORD wFlags;
127 WORD wcLock;
128 WORD wType;
129 WORD hHeap;
130 WORD wHeapType;
131 WORD wNext;
132 } LOCALENTRY;
134 /* wHeapType values */
135 #define NORMAL_HEAP 0
136 #define USER_HEAP 1
137 #define GDI_HEAP 2
139 /* wFlags values */
140 #define LF_FIXED 1
141 #define LF_FREE 2
142 #define LF_MOVEABLE 4
144 /* wType values */
145 #define LT_NORMAL 0
146 #define LT_FREE 0xff
147 #define LT_GDI_PEN 1 /* LT_GDI_* is for GDI's heap */
148 #define LT_GDI_BRUSH 2
149 #define LT_GDI_FONT 3
150 #define LT_GDI_PALETTE 4
151 #define LT_GDI_BITMAP 5
152 #define LT_GDI_RGN 6
153 #define LT_GDI_DC 7
154 #define LT_GDI_DISABLED_DC 8
155 #define LT_GDI_METADC 9
156 #define LT_GDI_METAFILE 10
157 #define LT_GDI_MAX LT_GDI_METAFILE
158 #define LT_USER_CLASS 1 /* LT_USER_* is for USER's heap */
159 #define LT_USER_WND 2
160 #define LT_USER_STRING 3
161 #define LT_USER_MENU 4
162 #define LT_USER_CLIP 5
163 #define LT_USER_CBOX 6
164 #define LT_USER_PALETTE 7
165 #define LT_USER_ED 8
166 #define LT_USER_BWL 9
167 #define LT_USER_OWNERDRAW 10
168 #define LT_USER_SPB 11
169 #define LT_USER_CHECKPOINT 12
170 #define LT_USER_DCE 13
171 #define LT_USER_MWP 14
172 #define LT_USER_PROP 15
173 #define LT_USER_LBIV 16
174 #define LT_USER_MISC 17
175 #define LT_USER_ATOMS 18
176 #define LT_USER_LOCKINPUTSTATE 19
177 #define LT_USER_HOOKLIST 20
178 #define LT_USER_USERSEEUSERDOALLOC 21
179 #define LT_USER_HOTKEYLIST 22
180 #define LT_USER_POPUPMENU 23
181 #define LT_USER_HANDLETABLE 32
182 #define LT_USER_MAX LT_USER_HANDLETABLE
184 BOOL16 WINAPI LocalInfo16( LOCALINFO *pLocalInfo, HGLOBAL16 handle );
185 BOOL16 WINAPI LocalFirst16( LOCALENTRY *pLocalEntry, HGLOBAL16 handle );
186 BOOL16 WINAPI LocalNext16( LOCALENTRY *pLocalEntry );
188 /* Local 32-bit heap */
190 typedef struct
192 DWORD dwSize; /* 00 */
193 DWORD dwMemReserved; /* 04 */
194 DWORD dwMemCommitted; /* 08 */
195 DWORD dwTotalFree; /* 0C */
196 DWORD dwLargestFreeBlock; /* 10 */
197 DWORD dwcFreeHandles; /* 14 */
198 } LOCAL32INFO;
200 typedef struct
202 DWORD dwSize; /* 00 */
203 WORD hHandle; /* 04 */
204 DWORD dwAddress; /* 06 */
205 DWORD dwSizeBlock; /* 0A */
206 WORD wFlags; /* 0E */
207 WORD wType; /* 10 */
208 WORD hHeap; /* 12 */
209 WORD wHeapType; /* 14 */
210 DWORD dwNext; /* 16 */
211 DWORD dwNextAlt; /* 1A */
212 } LOCAL32ENTRY;
214 /* LOCAL32ENTRY.wHeapType flags same as LOCALENTRY.wHeapType flags */
215 /* LOCAL32ENTRY.wFlags same as LOCALENTRY.wFlags */
216 /* LOCAL32ENTRY.wType same as LOCALENTRY.wType */
218 BOOL16 WINAPI Local32Info16( LOCAL32INFO *pLocal32Info, HGLOBAL16 handle );
219 BOOL16 WINAPI Local32First16( LOCAL32ENTRY *pLocal32Entry, HGLOBAL16 handle );
220 BOOL16 WINAPI Local32Next16( LOCAL32ENTRY *pLocal32Entry );
223 /* modules */
225 typedef struct
227 DWORD dwSize;
228 char szModule[MAX_MODULE_NAME + 1];
229 HMODULE16 hModule;
230 WORD wcUsage;
231 char szExePath[MAX_PATH16 + 1];
232 HANDLE16 wNext;
233 } MODULEENTRY, *LPMODULEENTRY;
235 BOOL16 WINAPI ModuleFirst16(MODULEENTRY *lpModule);
236 BOOL16 WINAPI ModuleNext16(MODULEENTRY *lpModule);
237 BOOL16 WINAPI ModuleFindName16(MODULEENTRY *lpModule, LPCSTR lpstrName);
238 BOOL16 WINAPI ModuleFindHandle16(MODULEENTRY *lpModule, HMODULE16 hModule);
240 /* tasks */
242 typedef struct
244 DWORD dwSize;
245 HTASK16 hTask;
246 HTASK16 hTaskParent;
247 HINSTANCE16 hInst;
248 HMODULE16 hModule;
249 WORD wSS;
250 WORD wSP;
251 WORD wStackTop;
252 WORD wStackMinimum;
253 WORD wStackBottom;
254 WORD wcEvents;
255 HGLOBAL16 hQueue;
256 char szModule[MAX_MODULE_NAME + 1];
257 WORD wPSPOffset;
258 HANDLE16 hNext;
259 } TASKENTRY, *LPTASKENTRY;
261 BOOL16 WINAPI TaskFirst16(LPTASKENTRY lpTask);
262 BOOL16 WINAPI TaskNext16(LPTASKENTRY lpTask);
263 BOOL16 WINAPI TaskFindHandle16(LPTASKENTRY lpTask, HTASK16 hTask);
264 DWORD WINAPI TaskSetCSIP(HTASK16 hTask, WORD wCS, WORD wIP);
265 DWORD WINAPI TaskGetCSIP(HTASK16 hTask);
266 BOOL16 WINAPI TaskSwitch(HTASK16 hTask, DWORD dwNewCSIP);
268 /* flag for TerminateApp16() */
269 #define NO_UAE_BOX 1
271 /* mem info */
273 typedef struct tagMEMMANINFO {
274 DWORD dwSize;
275 DWORD dwLargestFreeBlock;
276 DWORD dwMaxPagesAvailable;
277 DWORD dwMaxPagesLockable;
278 DWORD dwTotalLinearSpace;
279 DWORD dwTotalUnlockedPages;
280 DWORD dwFreePages;
281 DWORD dwTotalPages;
282 DWORD dwFreeLinearSpace;
283 DWORD dwSwapFilePages;
284 WORD wPageSize;
285 } MEMMANINFO;
286 typedef MEMMANINFO *LPMEMMANINFO;
288 typedef struct
290 DWORD dwSize;
291 WORD wUserFreePercent;
292 WORD wGDIFreePercent;
293 HGLOBAL16 hUserSegment;
294 HGLOBAL16 hGDISegment;
295 } SYSHEAPINFO;
297 BOOL16 WINAPI MemManInfo16(LPMEMMANINFO lpEnhMode);
298 BOOL16 WINAPI SystemHeapInfo16( SYSHEAPINFO *pHeapInfo );
300 /* timer info */
302 typedef struct tagTIMERINFO {
303 DWORD dwSize;
304 DWORD dwmsSinceStart;
305 DWORD dwmsThisVM;
306 } TIMERINFO;
308 BOOL16 WINAPI TimerCount16( TIMERINFO *pTimerInfo );
310 /* Window classes */
312 typedef struct
314 DWORD dwSize;
315 HMODULE16 hInst; /* This is really an hModule */
316 char szClassName[MAX_CLASSNAME + 1];
317 HANDLE16 wNext;
318 } CLASSENTRY;
320 BOOL16 WINAPI ClassFirst16( CLASSENTRY *pClassEntry );
321 BOOL16 WINAPI ClassNext16( CLASSENTRY *pClassEntry );
324 /* Memory read/write */
326 DWORD WINAPI MemoryRead16( WORD sel, DWORD offset, void *buffer, DWORD count );
327 DWORD WINAPI MemoryWrite16( WORD sel, DWORD offset, void *buffer, DWORD count );
329 /* flags to NotifyRegister() */
330 #define NF_NORMAL 0 /* everything except taskswitches, debugerrors,
331 * debugstrings
333 #define NF_TASKSWITCH 1 /* get taskswitch information */
334 #define NF_RIP 2 /* get debugerrors of system */
336 BOOL16 WINAPI NotifyRegister16(HTASK16 htask,FARPROC16 lpfnCallback,WORD wFlags);
338 #define NFY_UNKNOWN 0
339 #define NFY_LOADSEG 1
340 /* DATA is a pointer to following struct: */
341 typedef struct {
342 DWORD dwSize;
343 WORD wSelector;
344 WORD wSegNum;
345 WORD wType; /* bit 0 set if this is a code segment */
346 WORD wcInstance; /* only valid for data segment */
347 } NFYLOADSEG;
348 /* called when freeing a segment. LOWORD(dwData) is the freed selector */
349 #define NFY_FREESEG 2
351 /* called when loading/starting a DLL */
352 #define NFY_STARTDLL 3
353 typedef struct {
354 DWORD dwSize;
355 HMODULE16 hModule;
356 WORD wCS;
357 WORD wIP;
358 } NFYSTARTDLL;
360 /* called when starting a task. dwData is CS:IP */
361 #define NFY_STARTTASK 4
363 /* called when a task terminates. dwData is the return code */
364 #define NFY_EXITTASK 5
366 /* called when module is removed. LOWORD(dwData) is the handle */
367 #define NFY_DELMODULE 6
369 /* RIP? debugevent */
370 #define NFY_RIP 7
371 typedef struct {
372 DWORD dwSize;
373 WORD wIP;
374 WORD wCS;
375 WORD wSS;
376 WORD wBP;
377 WORD wExitCode;
378 } NFYRIP;
380 /* called before (after?) switching to a task
381 * no data, callback should call GetCurrentTask
383 #define NFY_TASKIN 8
385 /* called before(after?) switching from a task
386 * no data, callback should call GetCurrentTask
388 #define NFY_TASKOUT 9
390 /* returns ASCII input value, dwData not set */
391 #define NFY_INCHAR 10
393 /* output debugstring (pointed to by dwData) */
394 #define NFY_OUTSTRING 11
396 /* log errors */
397 #define NFY_LOGERROR 12
398 typedef struct {
399 DWORD dwSize;
400 UINT16 wErrCode;
401 VOID *lpInfo; /* depends on wErrCode */
402 } NFYLOGERROR;
404 /* called for parameter errors? */
405 #define NFY_LOGPARAMERROR 13
406 typedef struct {
407 DWORD dwSize;
408 UINT16 wErrCode;
409 FARPROC16 lpfnErrorAddr;
410 void **lpBadParam;
411 } NFYLOGPARAMERROR;
413 typedef struct {
414 DWORD dwSize;
415 HTASK16 hTask;
416 WORD wSS;
417 WORD wBP;
418 WORD wCS;
419 WORD wIP;
420 HMODULE16 hModule;
421 WORD wSegment;
422 WORD wFlags;
423 } STACKTRACEENTRY;
425 #include <poppack.h>
427 #endif /* __WINE_TOOLHELP_H */