blob: c85f4aa43c9f5227b2e3494c9bd0f081939ec7fc [file] [log] [blame]
Alexandre Julliardc6c09441997-01-12 18:32:19 +00001#ifndef __WINE_TOOLHELP_H
2#define __WINE_TOOLHELP_H
Alexandre Julliard490a27e1994-06-08 13:57:50 +00003
Marcus Meissner317af321999-02-17 13:51:06 +00004#include "windef.h"
Alexandre Julliard83f52d12000-09-26 22:20:14 +00005#include "wine/windef16.h"
Alexandre Julliard490a27e1994-06-08 13:57:50 +00006
Alexandre Julliard3f2abfa1994-08-16 15:43:11 +00007#define MAX_DATA 11
8#define MAX_MODULE_NAME 9
Alexandre Julliarde27326a1999-01-31 18:55:54 +00009#define MAX_PATH16 255
Alexandre Julliard3f2abfa1994-08-16 15:43:11 +000010#define MAX_CLASSNAME 255
11
Patrik Stridvallc7a8dde1999-04-25 12:36:53 +000012#include "pshpack1.h"
Alexandre Julliard21979011997-03-05 08:22:35 +000013
Alexandre Julliarde2abbb11995-03-19 17:39:39 +000014/* Global heap */
15
Alexandre Julliardfa68b751995-04-03 16:55:37 +000016typedef struct
17{
18 DWORD dwSize;
19 WORD wcItems;
20 WORD wcItemsFree;
21 WORD wcItemsLRU;
22} GLOBALINFO;
Alexandre Julliarde2abbb11995-03-19 17:39:39 +000023
Alexandre Julliardfa68b751995-04-03 16:55:37 +000024typedef struct
25{
Alexandre Julliard3051b641996-07-05 17:14:13 +000026 DWORD dwSize;
27 DWORD dwAddress;
28 DWORD dwBlockSize;
29 HGLOBAL16 hBlock;
30 WORD wcLock;
31 WORD wcPageLock;
32 WORD wFlags;
33 BOOL16 wHeapPresent;
34 HGLOBAL16 hOwner;
35 WORD wType;
36 WORD wData;
37 DWORD dwNext;
38 DWORD dwNextAlt;
Alexandre Julliardfa68b751995-04-03 16:55:37 +000039} GLOBALENTRY;
40
41 /* GlobalFirst()/GlobalNext() flags */
42#define GLOBAL_ALL 0
43#define GLOBAL_LRU 1
44#define GLOBAL_FREE 2
45
46 /* wType values */
47#define GT_UNKNOWN 0
48#define GT_DGROUP 1
49#define GT_DATA 2
50#define GT_CODE 3
51#define GT_TASK 4
52#define GT_RESOURCE 5
53#define GT_MODULE 6
54#define GT_FREE 7
55#define GT_INTERNAL 8
56#define GT_SENTINEL 9
57#define GT_BURGERMASTER 10
58
59/* wData values */
60#define GD_USERDEFINED 0
61#define GD_CURSORCOMPONENT 1
62#define GD_BITMAP 2
63#define GD_ICONCOMPONENT 3
64#define GD_MENU 4
65#define GD_DIALOG 5
66#define GD_STRING 6
67#define GD_FONTDIR 7
68#define GD_FONT 8
69#define GD_ACCELERATORS 9
70#define GD_RCDATA 10
71#define GD_ERRTABLE 11
72#define GD_CURSOR 12
73#define GD_ICON 14
74#define GD_NAMETABLE 15
75#define GD_MAX_RESOURCE 15
76
77/* wFlags values */
78#define GF_PDB_OWNER 0x0100 /* Low byte is KERNEL flags */
79
Alexandre Julliarda3960291999-02-26 11:11:13 +000080WORD WINAPI GlobalHandleToSel16( HGLOBAL16 handle );
81BOOL16 WINAPI GlobalInfo16( GLOBALINFO *pInfo );
82BOOL16 WINAPI GlobalFirst16( GLOBALENTRY *pGlobal, WORD wFlags );
83BOOL16 WINAPI GlobalNext16( GLOBALENTRY *pGlobal, WORD wFlags) ;
84BOOL16 WINAPI GlobalEntryHandle16( GLOBALENTRY *pGlobal, HGLOBAL16 hItem );
85BOOL16 WINAPI GlobalEntryModule16( GLOBALENTRY *pGlobal, HMODULE16 hModule,
Alexandre Julliard670cdc41997-08-24 16:00:30 +000086 WORD wSeg );
Alexandre Julliarde2abbb11995-03-19 17:39:39 +000087
88/* Local heap */
89
90typedef struct
91{
92 DWORD dwSize;
93 WORD wcItems;
94} LOCALINFO;
95
96typedef struct
97{
98 DWORD dwSize;
Alexandre Julliard1285c2f1996-05-06 16:06:24 +000099 HLOCAL16 hHandle;
Alexandre Julliarde2abbb11995-03-19 17:39:39 +0000100 WORD wAddress;
101 WORD wSize;
102 WORD wFlags;
103 WORD wcLock;
104 WORD wType;
105 WORD hHeap;
106 WORD wHeapType;
107 WORD wNext;
108} LOCALENTRY;
109
110/* wHeapType values */
111#define NORMAL_HEAP 0
112#define USER_HEAP 1
113#define GDI_HEAP 2
114
115/* wFlags values */
116#define LF_FIXED 1
117#define LF_FREE 2
118#define LF_MOVEABLE 4
119
120/* wType values */
121#define LT_NORMAL 0
122#define LT_FREE 0xff
123#define LT_GDI_PEN 1 /* LT_GDI_* is for GDI's heap */
124#define LT_GDI_BRUSH 2
125#define LT_GDI_FONT 3
126#define LT_GDI_PALETTE 4
127#define LT_GDI_BITMAP 5
128#define LT_GDI_RGN 6
129#define LT_GDI_DC 7
130#define LT_GDI_DISABLED_DC 8
131#define LT_GDI_METADC 9
132#define LT_GDI_METAFILE 10
133#define LT_GDI_MAX LT_GDI_METAFILE
134#define LT_USER_CLASS 1 /* LT_USER_* is for USER's heap */
135#define LT_USER_WND 2
136#define LT_USER_STRING 3
137#define LT_USER_MENU 4
138#define LT_USER_CLIP 5
139#define LT_USER_CBOX 6
140#define LT_USER_PALETTE 7
141#define LT_USER_ED 8
142#define LT_USER_BWL 9
143#define LT_USER_OWNERDRAW 10
144#define LT_USER_SPB 11
145#define LT_USER_CHECKPOINT 12
146#define LT_USER_DCE 13
147#define LT_USER_MWP 14
148#define LT_USER_PROP 15
149#define LT_USER_LBIV 16
150#define LT_USER_MISC 17
151#define LT_USER_ATOMS 18
152#define LT_USER_LOCKINPUTSTATE 19
153#define LT_USER_HOOKLIST 20
154#define LT_USER_USERSEEUSERDOALLOC 21
155#define LT_USER_HOTKEYLIST 22
156#define LT_USER_POPUPMENU 23
157#define LT_USER_HANDLETABLE 32
158#define LT_USER_MAX LT_USER_HANDLETABLE
159
Alexandre Julliarda3960291999-02-26 11:11:13 +0000160BOOL16 WINAPI LocalInfo16( LOCALINFO *pLocalInfo, HGLOBAL16 handle );
161BOOL16 WINAPI LocalFirst16( LOCALENTRY *pLocalEntry, HGLOBAL16 handle );
162BOOL16 WINAPI LocalNext16( LOCALENTRY *pLocalEntry );
Alexandre Julliarde2abbb11995-03-19 17:39:39 +0000163
Ulrich Weigand416d39e1998-12-01 14:45:37 +0000164/* Local 32-bit heap */
165
166typedef struct
167{
168 DWORD dwSize; /* 00 */
169 DWORD dwMemReserved; /* 04 */
170 DWORD dwMemCommitted; /* 08 */
171 DWORD dwTotalFree; /* 0C */
172 DWORD dwLargestFreeBlock; /* 10 */
173 DWORD dwcFreeHandles; /* 14 */
174} LOCAL32INFO;
175
176typedef struct
177{
178 DWORD dwSize; /* 00 */
179 WORD hHandle; /* 04 */
180 DWORD dwAddress; /* 06 */
181 DWORD dwSizeBlock; /* 0A */
182 WORD wFlags; /* 0E */
183 WORD wType; /* 10 */
184 WORD hHeap; /* 12 */
185 WORD wHeapType; /* 14 */
186 DWORD dwNext; /* 16 */
187 DWORD dwNextAlt; /* 1A */
188} LOCAL32ENTRY;
189
190/* LOCAL32ENTRY.wHeapType flags same as LOCALENTRY.wHeapType flags */
191/* LOCAL32ENTRY.wFlags same as LOCALENTRY.wFlags */
192/* LOCAL32ENTRY.wType same as LOCALENTRY.wType */
193
Alexandre Julliarda3960291999-02-26 11:11:13 +0000194BOOL16 WINAPI Local32Info16( LOCAL32INFO *pLocal32Info, HGLOBAL16 handle );
195BOOL16 WINAPI Local32First16( LOCAL32ENTRY *pLocal32Entry, HGLOBAL16 handle );
196BOOL16 WINAPI Local32Next16( LOCAL32ENTRY *pLocal32Entry );
Ulrich Weigand416d39e1998-12-01 14:45:37 +0000197
Alexandre Julliarde2abbb11995-03-19 17:39:39 +0000198
Alexandre Julliard3f2abfa1994-08-16 15:43:11 +0000199/* modules */
Alexandre Julliard490a27e1994-06-08 13:57:50 +0000200
Alexandre Julliard3051b641996-07-05 17:14:13 +0000201typedef struct
202{
203 DWORD dwSize;
204 char szModule[MAX_MODULE_NAME + 1];
205 HMODULE16 hModule;
206 WORD wcUsage;
Alexandre Julliarde27326a1999-01-31 18:55:54 +0000207 char szExePath[MAX_PATH16 + 1];
Alexandre Julliard3051b641996-07-05 17:14:13 +0000208 HANDLE16 wNext;
209} MODULEENTRY, *LPMODULEENTRY;
Alexandre Julliard490a27e1994-06-08 13:57:50 +0000210
Alexandre Julliarda3960291999-02-26 11:11:13 +0000211BOOL16 WINAPI ModuleFirst16(MODULEENTRY *lpModule);
212BOOL16 WINAPI ModuleNext16(MODULEENTRY *lpModule);
213BOOL16 WINAPI ModuleFindName16(MODULEENTRY *lpModule, LPCSTR lpstrName);
214BOOL16 WINAPI ModuleFindHandle16(MODULEENTRY *lpModule, HMODULE16 hModule);
Alexandre Julliard490a27e1994-06-08 13:57:50 +0000215
Alexandre Julliard3f2abfa1994-08-16 15:43:11 +0000216/* tasks */
217
Alexandre Julliard3051b641996-07-05 17:14:13 +0000218typedef struct
219{
220 DWORD dwSize;
221 HTASK16 hTask;
222 HTASK16 hTaskParent;
223 HINSTANCE16 hInst;
224 HMODULE16 hModule;
225 WORD wSS;
226 WORD wSP;
227 WORD wStackTop;
228 WORD wStackMinimum;
229 WORD wStackBottom;
230 WORD wcEvents;
231 HGLOBAL16 hQueue;
232 char szModule[MAX_MODULE_NAME + 1];
233 WORD wPSPOffset;
234 HANDLE16 hNext;
235} TASKENTRY, *LPTASKENTRY;
Alexandre Julliard3f2abfa1994-08-16 15:43:11 +0000236
Alexandre Julliarda3960291999-02-26 11:11:13 +0000237BOOL16 WINAPI TaskFirst16(LPTASKENTRY lpTask);
238BOOL16 WINAPI TaskNext16(LPTASKENTRY lpTask);
239BOOL16 WINAPI TaskFindHandle16(LPTASKENTRY lpTask, HTASK16 hTask);
Alexandre Julliard670cdc41997-08-24 16:00:30 +0000240DWORD WINAPI TaskSetCSIP(HTASK16 hTask, WORD wCS, WORD wIP);
241DWORD WINAPI TaskGetCSIP(HTASK16 hTask);
242BOOL16 WINAPI TaskSwitch(HTASK16 hTask, DWORD dwNewCSIP);
Alexandre Julliard3f2abfa1994-08-16 15:43:11 +0000243
244/* mem info */
245
246typedef struct tagMEMMANINFO {
247 DWORD dwSize;
248 DWORD dwLargestFreeBlock;
249 DWORD dwMaxPagesAvailable;
250 DWORD dwMaxPagesLockable;
251 DWORD dwTotalLinearSpace;
252 DWORD dwTotalUnlockedPages;
253 DWORD dwFreePages;
254 DWORD dwTotalPages;
255 DWORD dwFreeLinearSpace;
256 DWORD dwSwapFilePages;
257 WORD wPageSize;
258} MEMMANINFO;
259typedef MEMMANINFO *LPMEMMANINFO;
260
Alexandre Julliarde2abbb11995-03-19 17:39:39 +0000261typedef struct
262{
Alexandre Julliard3051b641996-07-05 17:14:13 +0000263 DWORD dwSize;
264 WORD wUserFreePercent;
265 WORD wGDIFreePercent;
266 HGLOBAL16 hUserSegment;
267 HGLOBAL16 hGDISegment;
Alexandre Julliard3f2abfa1994-08-16 15:43:11 +0000268} SYSHEAPINFO;
Alexandre Julliard3f2abfa1994-08-16 15:43:11 +0000269
Alexandre Julliarda3960291999-02-26 11:11:13 +0000270BOOL16 WINAPI MemManInfo16(LPMEMMANINFO lpEnhMode);
271BOOL16 WINAPI SystemHeapInfo16( SYSHEAPINFO *pHeapInfo );
Alexandre Julliarde2abbb11995-03-19 17:39:39 +0000272
Alexandre Julliard4f8c37b1996-01-14 18:12:01 +0000273/* timer info */
274
275typedef struct tagTIMERINFO {
276 DWORD dwSize;
277 DWORD dwmsSinceStart;
278 DWORD dwmsThisVM;
279} TIMERINFO;
280
Alexandre Julliarda3960291999-02-26 11:11:13 +0000281BOOL16 WINAPI TimerCount16( TIMERINFO *pTimerInfo );
Alexandre Julliarde2abbb11995-03-19 17:39:39 +0000282
283/* Window classes */
284
285typedef struct
286{
287 DWORD dwSize;
Alexandre Julliard3051b641996-07-05 17:14:13 +0000288 HMODULE16 hInst; /* This is really an hModule */
Alexandre Julliarde2abbb11995-03-19 17:39:39 +0000289 char szClassName[MAX_CLASSNAME + 1];
Alexandre Julliard3051b641996-07-05 17:14:13 +0000290 HANDLE16 wNext;
Alexandre Julliarde2abbb11995-03-19 17:39:39 +0000291} CLASSENTRY;
292
Alexandre Julliarda3960291999-02-26 11:11:13 +0000293BOOL16 WINAPI ClassFirst16( CLASSENTRY *pClassEntry );
294BOOL16 WINAPI ClassNext16( CLASSENTRY *pClassEntry );
Alexandre Julliarde2abbb11995-03-19 17:39:39 +0000295
296
297/* Memory read/write */
298
Alexandre Julliarda3960291999-02-26 11:11:13 +0000299DWORD WINAPI MemoryRead16( WORD sel, DWORD offset, void *buffer, DWORD count );
300DWORD WINAPI MemoryWrite16( WORD sel, DWORD offset, void *buffer, DWORD count );
Alexandre Julliarde2abbb11995-03-19 17:39:39 +0000301
Alexandre Julliard7e56f681996-01-31 19:02:28 +0000302/* flags to NotifyRegister() */
303#define NF_NORMAL 0 /* everything except taskswitches, debugerrors,
304 * debugstrings
305 */
306#define NF_TASKSWITCH 1 /* get taskswitch information */
307#define NF_RIP 2 /* get debugerrors of system */
Alexandre Julliard3f2abfa1994-08-16 15:43:11 +0000308
Alexandre Julliarda3960291999-02-26 11:11:13 +0000309BOOL16 WINAPI NotifyRegister16(HTASK16 htask,FARPROC16 lpfnCallback,WORD wFlags);
Alexandre Julliard7e56f681996-01-31 19:02:28 +0000310
311#define NFY_UNKNOWN 0
312#define NFY_LOADSEG 1
313/* DATA is a pointer to following struct: */
Alexandre Julliard23946ad1997-06-16 17:43:53 +0000314typedef struct {
Alexandre Julliard7e56f681996-01-31 19:02:28 +0000315 DWORD dwSize;
316 WORD wSelector;
317 WORD wSegNum;
318 WORD wType; /* bit 0 set if this is a code segment */
319 WORD wcInstance; /* only valid for data segment */
320} NFYLOADSEG;
321/* called when freeing a segment. LOWORD(dwData) is the freed selector */
322#define NFY_FREESEG 2
323
324/* called when loading/starting a DLL */
325#define NFY_STARTDLL 3
Alexandre Julliard23946ad1997-06-16 17:43:53 +0000326typedef struct {
Alexandre Julliard3051b641996-07-05 17:14:13 +0000327 DWORD dwSize;
328 HMODULE16 hModule;
329 WORD wCS;
330 WORD wIP;
Alexandre Julliard7e56f681996-01-31 19:02:28 +0000331} NFYSTARTDLL;
332
333/* called when starting a task. dwData is CS:IP */
334#define NFY_STARTTASK 4
335
336/* called when a task terminates. dwData is the return code */
337#define NFY_EXITTASK 5
338
339/* called when module is removed. LOWORD(dwData) is the handle */
340#define NFY_DELMODULE 6
341
342/* RIP? debugevent */
343#define NFY_RIP 7
Alexandre Julliard23946ad1997-06-16 17:43:53 +0000344typedef struct {
Alexandre Julliard7e56f681996-01-31 19:02:28 +0000345 DWORD dwSize;
346 WORD wIP;
347 WORD wCS;
348 WORD wSS;
349 WORD wBP;
350 WORD wExitCode;
351} NFYRIP;
352
353/* called before (after?) switching to a task
354 * no data, callback should call GetCurrentTask
355 */
356#define NFY_TASKIN 8
357
358/* called before(after?) switching from a task
359 * no data, callback should call GetCurrentTask
360*/
361#define NFY_TASKOUT 9
362
363/* returns ASCII input value, dwData not set */
364#define NFY_INCHAR 10
365
366/* output debugstring (pointed to by dwData) */
367#define NFY_OUTSTRING 11
368
369/* log errors */
370#define NFY_LOGERROR 12
Alexandre Julliard23946ad1997-06-16 17:43:53 +0000371typedef struct {
Alexandre Julliard7e56f681996-01-31 19:02:28 +0000372 DWORD dwSize;
Alexandre Julliard3051b641996-07-05 17:14:13 +0000373 UINT16 wErrCode;
Alexandre Julliard1285c2f1996-05-06 16:06:24 +0000374 VOID *lpInfo; /* depends on wErrCode */
Alexandre Julliard7e56f681996-01-31 19:02:28 +0000375} NFYLOGERROR;
376
377/* called for parameter errors? */
378#define NFY_LOGPARAMERROR 13
Alexandre Julliard23946ad1997-06-16 17:43:53 +0000379typedef struct {
Alexandre Julliard3051b641996-07-05 17:14:13 +0000380 DWORD dwSize;
381 UINT16 wErrCode;
382 FARPROC16 lpfnErrorAddr;
383 void **lpBadParam;
Alexandre Julliard7e56f681996-01-31 19:02:28 +0000384} NFYLOGPARAMERROR;
Alexandre Julliard21979011997-03-05 08:22:35 +0000385
Alexandre Julliard44ed71f1997-12-21 19:17:50 +0000386typedef struct {
387 DWORD dwSize;
388 HTASK16 hTask;
389 WORD wSS;
390 WORD wBP;
391 WORD wCS;
392 WORD wIP;
393 HMODULE16 hModule;
394 WORD wSegment;
395 WORD wFlags;
396} STACKTRACEENTRY;
397
Patrik Stridvallc7a8dde1999-04-25 12:36:53 +0000398#include "poppack.h"
Alexandre Julliard21979011997-03-05 08:22:35 +0000399
Alexandre Julliardc6c09441997-01-12 18:32:19 +0000400#endif /* __WINE_TOOLHELP_H */