blob: f2b1629de8b591167fcfdb2f422671f303046cc1 [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
4#include "windows.h"
Patrick Spinler3f8e1e41998-12-11 15:04:11 +00005#include "tlhelp32.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
Patrick Spinler3f8e1e41998-12-11 15:04:11 +00009#ifndef MAX_PATH
Alexandre Julliard3f2abfa1994-08-16 15:43:11 +000010#define MAX_PATH 255
Patrick Spinler3f8e1e41998-12-11 15:04:11 +000011#endif
Alexandre Julliard3f2abfa1994-08-16 15:43:11 +000012#define MAX_CLASSNAME 255
13
Alexandre Julliard21979011997-03-05 08:22:35 +000014#pragma pack(1)
15
Alexandre Julliarde2abbb11995-03-19 17:39:39 +000016/* Global heap */
17
Alexandre Julliardfa68b751995-04-03 16:55:37 +000018typedef struct
19{
20 DWORD dwSize;
21 WORD wcItems;
22 WORD wcItemsFree;
23 WORD wcItemsLRU;
24} GLOBALINFO;
Alexandre Julliarde2abbb11995-03-19 17:39:39 +000025
Alexandre Julliardfa68b751995-04-03 16:55:37 +000026typedef struct
27{
Alexandre Julliard3051b641996-07-05 17:14:13 +000028 DWORD dwSize;
29 DWORD dwAddress;
30 DWORD dwBlockSize;
31 HGLOBAL16 hBlock;
32 WORD wcLock;
33 WORD wcPageLock;
34 WORD wFlags;
35 BOOL16 wHeapPresent;
36 HGLOBAL16 hOwner;
37 WORD wType;
38 WORD wData;
39 DWORD dwNext;
40 DWORD dwNextAlt;
Alexandre Julliardfa68b751995-04-03 16:55:37 +000041} GLOBALENTRY;
42
43 /* GlobalFirst()/GlobalNext() flags */
44#define GLOBAL_ALL 0
45#define GLOBAL_LRU 1
46#define GLOBAL_FREE 2
47
48 /* wType values */
49#define GT_UNKNOWN 0
50#define GT_DGROUP 1
51#define GT_DATA 2
52#define GT_CODE 3
53#define GT_TASK 4
54#define GT_RESOURCE 5
55#define GT_MODULE 6
56#define GT_FREE 7
57#define GT_INTERNAL 8
58#define GT_SENTINEL 9
59#define GT_BURGERMASTER 10
60
61/* wData values */
62#define GD_USERDEFINED 0
63#define GD_CURSORCOMPONENT 1
64#define GD_BITMAP 2
65#define GD_ICONCOMPONENT 3
66#define GD_MENU 4
67#define GD_DIALOG 5
68#define GD_STRING 6
69#define GD_FONTDIR 7
70#define GD_FONT 8
71#define GD_ACCELERATORS 9
72#define GD_RCDATA 10
73#define GD_ERRTABLE 11
74#define GD_CURSOR 12
75#define GD_ICON 14
76#define GD_NAMETABLE 15
77#define GD_MAX_RESOURCE 15
78
79/* wFlags values */
80#define GF_PDB_OWNER 0x0100 /* Low byte is KERNEL flags */
81
Alexandre Julliard670cdc41997-08-24 16:00:30 +000082WORD WINAPI GlobalHandleToSel( HGLOBAL16 handle );
83BOOL16 WINAPI GlobalInfo( GLOBALINFO *pInfo );
84BOOL16 WINAPI GlobalFirst( GLOBALENTRY *pGlobal, WORD wFlags );
85BOOL16 WINAPI GlobalNext( GLOBALENTRY *pGlobal, WORD wFlags) ;
86BOOL16 WINAPI GlobalEntryHandle( GLOBALENTRY *pGlobal, HGLOBAL16 hItem );
87BOOL16 WINAPI GlobalEntryModule( GLOBALENTRY *pGlobal, HMODULE16 hModule,
88 WORD wSeg );
Alexandre Julliarde2abbb11995-03-19 17:39:39 +000089
90/* Local heap */
91
92typedef struct
93{
94 DWORD dwSize;
95 WORD wcItems;
96} LOCALINFO;
97
98typedef struct
99{
100 DWORD dwSize;
Alexandre Julliard1285c2f1996-05-06 16:06:24 +0000101 HLOCAL16 hHandle;
Alexandre Julliarde2abbb11995-03-19 17:39:39 +0000102 WORD wAddress;
103 WORD wSize;
104 WORD wFlags;
105 WORD wcLock;
106 WORD wType;
107 WORD hHeap;
108 WORD wHeapType;
109 WORD wNext;
110} LOCALENTRY;
111
112/* wHeapType values */
113#define NORMAL_HEAP 0
114#define USER_HEAP 1
115#define GDI_HEAP 2
116
117/* wFlags values */
118#define LF_FIXED 1
119#define LF_FREE 2
120#define LF_MOVEABLE 4
121
122/* wType values */
123#define LT_NORMAL 0
124#define LT_FREE 0xff
125#define LT_GDI_PEN 1 /* LT_GDI_* is for GDI's heap */
126#define LT_GDI_BRUSH 2
127#define LT_GDI_FONT 3
128#define LT_GDI_PALETTE 4
129#define LT_GDI_BITMAP 5
130#define LT_GDI_RGN 6
131#define LT_GDI_DC 7
132#define LT_GDI_DISABLED_DC 8
133#define LT_GDI_METADC 9
134#define LT_GDI_METAFILE 10
135#define LT_GDI_MAX LT_GDI_METAFILE
136#define LT_USER_CLASS 1 /* LT_USER_* is for USER's heap */
137#define LT_USER_WND 2
138#define LT_USER_STRING 3
139#define LT_USER_MENU 4
140#define LT_USER_CLIP 5
141#define LT_USER_CBOX 6
142#define LT_USER_PALETTE 7
143#define LT_USER_ED 8
144#define LT_USER_BWL 9
145#define LT_USER_OWNERDRAW 10
146#define LT_USER_SPB 11
147#define LT_USER_CHECKPOINT 12
148#define LT_USER_DCE 13
149#define LT_USER_MWP 14
150#define LT_USER_PROP 15
151#define LT_USER_LBIV 16
152#define LT_USER_MISC 17
153#define LT_USER_ATOMS 18
154#define LT_USER_LOCKINPUTSTATE 19
155#define LT_USER_HOOKLIST 20
156#define LT_USER_USERSEEUSERDOALLOC 21
157#define LT_USER_HOTKEYLIST 22
158#define LT_USER_POPUPMENU 23
159#define LT_USER_HANDLETABLE 32
160#define LT_USER_MAX LT_USER_HANDLETABLE
161
Alexandre Julliard670cdc41997-08-24 16:00:30 +0000162BOOL16 WINAPI LocalInfo( LOCALINFO *pLocalInfo, HGLOBAL16 handle );
163BOOL16 WINAPI LocalFirst( LOCALENTRY *pLocalEntry, HGLOBAL16 handle );
164BOOL16 WINAPI LocalNext( LOCALENTRY *pLocalEntry );
Alexandre Julliarde2abbb11995-03-19 17:39:39 +0000165
Ulrich Weigand416d39e1998-12-01 14:45:37 +0000166/* Local 32-bit heap */
167
168typedef struct
169{
170 DWORD dwSize; /* 00 */
171 DWORD dwMemReserved; /* 04 */
172 DWORD dwMemCommitted; /* 08 */
173 DWORD dwTotalFree; /* 0C */
174 DWORD dwLargestFreeBlock; /* 10 */
175 DWORD dwcFreeHandles; /* 14 */
176} LOCAL32INFO;
177
178typedef struct
179{
180 DWORD dwSize; /* 00 */
181 WORD hHandle; /* 04 */
182 DWORD dwAddress; /* 06 */
183 DWORD dwSizeBlock; /* 0A */
184 WORD wFlags; /* 0E */
185 WORD wType; /* 10 */
186 WORD hHeap; /* 12 */
187 WORD wHeapType; /* 14 */
188 DWORD dwNext; /* 16 */
189 DWORD dwNextAlt; /* 1A */
190} LOCAL32ENTRY;
191
192/* LOCAL32ENTRY.wHeapType flags same as LOCALENTRY.wHeapType flags */
193/* LOCAL32ENTRY.wFlags same as LOCALENTRY.wFlags */
194/* LOCAL32ENTRY.wType same as LOCALENTRY.wType */
195
196BOOL16 WINAPI Local32Info( LOCAL32INFO *pLocal32Info, HGLOBAL16 handle );
197BOOL16 WINAPI Local32First( LOCAL32ENTRY *pLocal32Entry, HGLOBAL16 handle );
198BOOL16 WINAPI Local32Next( LOCAL32ENTRY *pLocal32Entry );
199
Alexandre Julliarde2abbb11995-03-19 17:39:39 +0000200
Alexandre Julliard3f2abfa1994-08-16 15:43:11 +0000201/* modules */
Alexandre Julliard490a27e1994-06-08 13:57:50 +0000202
Alexandre Julliard3051b641996-07-05 17:14:13 +0000203typedef struct
204{
205 DWORD dwSize;
206 char szModule[MAX_MODULE_NAME + 1];
207 HMODULE16 hModule;
208 WORD wcUsage;
209 char szExePath[MAX_PATH + 1];
210 HANDLE16 wNext;
211} MODULEENTRY, *LPMODULEENTRY;
Alexandre Julliard490a27e1994-06-08 13:57:50 +0000212
Alexandre Julliard670cdc41997-08-24 16:00:30 +0000213BOOL16 WINAPI ModuleFirst(MODULEENTRY *lpModule);
214BOOL16 WINAPI ModuleNext(MODULEENTRY *lpModule);
215BOOL16 WINAPI ModuleFindName(MODULEENTRY *lpModule, LPCSTR lpstrName);
216BOOL16 WINAPI ModuleFindHandle(MODULEENTRY *lpModule, HMODULE16 hModule);
Alexandre Julliard490a27e1994-06-08 13:57:50 +0000217
Alexandre Julliard3f2abfa1994-08-16 15:43:11 +0000218/* tasks */
219
Alexandre Julliard3051b641996-07-05 17:14:13 +0000220typedef struct
221{
222 DWORD dwSize;
223 HTASK16 hTask;
224 HTASK16 hTaskParent;
225 HINSTANCE16 hInst;
226 HMODULE16 hModule;
227 WORD wSS;
228 WORD wSP;
229 WORD wStackTop;
230 WORD wStackMinimum;
231 WORD wStackBottom;
232 WORD wcEvents;
233 HGLOBAL16 hQueue;
234 char szModule[MAX_MODULE_NAME + 1];
235 WORD wPSPOffset;
236 HANDLE16 hNext;
237} TASKENTRY, *LPTASKENTRY;
Alexandre Julliard3f2abfa1994-08-16 15:43:11 +0000238
Alexandre Julliard670cdc41997-08-24 16:00:30 +0000239BOOL16 WINAPI TaskFirst(LPTASKENTRY lpTask);
240BOOL16 WINAPI TaskNext(LPTASKENTRY lpTask);
241BOOL16 WINAPI TaskFindHandle(LPTASKENTRY lpTask, HTASK16 hTask);
242DWORD WINAPI TaskSetCSIP(HTASK16 hTask, WORD wCS, WORD wIP);
243DWORD WINAPI TaskGetCSIP(HTASK16 hTask);
244BOOL16 WINAPI TaskSwitch(HTASK16 hTask, DWORD dwNewCSIP);
Alexandre Julliard3f2abfa1994-08-16 15:43:11 +0000245
246/* mem info */
247
248typedef struct tagMEMMANINFO {
249 DWORD dwSize;
250 DWORD dwLargestFreeBlock;
251 DWORD dwMaxPagesAvailable;
252 DWORD dwMaxPagesLockable;
253 DWORD dwTotalLinearSpace;
254 DWORD dwTotalUnlockedPages;
255 DWORD dwFreePages;
256 DWORD dwTotalPages;
257 DWORD dwFreeLinearSpace;
258 DWORD dwSwapFilePages;
259 WORD wPageSize;
260} MEMMANINFO;
261typedef MEMMANINFO *LPMEMMANINFO;
262
Alexandre Julliarde2abbb11995-03-19 17:39:39 +0000263typedef struct
264{
Alexandre Julliard3051b641996-07-05 17:14:13 +0000265 DWORD dwSize;
266 WORD wUserFreePercent;
267 WORD wGDIFreePercent;
268 HGLOBAL16 hUserSegment;
269 HGLOBAL16 hGDISegment;
Alexandre Julliard3f2abfa1994-08-16 15:43:11 +0000270} SYSHEAPINFO;
Alexandre Julliard3f2abfa1994-08-16 15:43:11 +0000271
Alexandre Julliard670cdc41997-08-24 16:00:30 +0000272BOOL16 WINAPI MemManInfo(LPMEMMANINFO lpEnhMode);
273BOOL16 WINAPI SystemHeapInfo( SYSHEAPINFO *pHeapInfo );
Alexandre Julliarde2abbb11995-03-19 17:39:39 +0000274
Alexandre Julliard4f8c37b1996-01-14 18:12:01 +0000275/* timer info */
276
277typedef struct tagTIMERINFO {
278 DWORD dwSize;
279 DWORD dwmsSinceStart;
280 DWORD dwmsThisVM;
281} TIMERINFO;
282
Alexandre Julliard670cdc41997-08-24 16:00:30 +0000283BOOL16 WINAPI TimerCount( TIMERINFO *pTimerInfo );
Alexandre Julliarde2abbb11995-03-19 17:39:39 +0000284
285/* Window classes */
286
287typedef struct
288{
289 DWORD dwSize;
Alexandre Julliard3051b641996-07-05 17:14:13 +0000290 HMODULE16 hInst; /* This is really an hModule */
Alexandre Julliarde2abbb11995-03-19 17:39:39 +0000291 char szClassName[MAX_CLASSNAME + 1];
Alexandre Julliard3051b641996-07-05 17:14:13 +0000292 HANDLE16 wNext;
Alexandre Julliarde2abbb11995-03-19 17:39:39 +0000293} CLASSENTRY;
294
Alexandre Julliard670cdc41997-08-24 16:00:30 +0000295BOOL16 WINAPI ClassFirst( CLASSENTRY *pClassEntry );
296BOOL16 WINAPI ClassNext( CLASSENTRY *pClassEntry );
Alexandre Julliarde2abbb11995-03-19 17:39:39 +0000297
298
299/* Memory read/write */
300
Alexandre Julliard670cdc41997-08-24 16:00:30 +0000301DWORD WINAPI MemoryRead( WORD sel, DWORD offset, void *buffer, DWORD count );
302DWORD WINAPI MemoryWrite( WORD sel, DWORD offset, void *buffer, DWORD count );
Alexandre Julliarde2abbb11995-03-19 17:39:39 +0000303
Alexandre Julliard7e56f681996-01-31 19:02:28 +0000304/* flags to NotifyRegister() */
305#define NF_NORMAL 0 /* everything except taskswitches, debugerrors,
306 * debugstrings
307 */
308#define NF_TASKSWITCH 1 /* get taskswitch information */
309#define NF_RIP 2 /* get debugerrors of system */
Alexandre Julliard3f2abfa1994-08-16 15:43:11 +0000310
Alexandre Julliard670cdc41997-08-24 16:00:30 +0000311BOOL16 WINAPI NotifyRegister(HTASK16 htask,FARPROC16 lpfnCallback,WORD wFlags);
Alexandre Julliard7e56f681996-01-31 19:02:28 +0000312
313#define NFY_UNKNOWN 0
314#define NFY_LOADSEG 1
315/* DATA is a pointer to following struct: */
Alexandre Julliard23946ad1997-06-16 17:43:53 +0000316typedef struct {
Alexandre Julliard7e56f681996-01-31 19:02:28 +0000317 DWORD dwSize;
318 WORD wSelector;
319 WORD wSegNum;
320 WORD wType; /* bit 0 set if this is a code segment */
321 WORD wcInstance; /* only valid for data segment */
322} NFYLOADSEG;
323/* called when freeing a segment. LOWORD(dwData) is the freed selector */
324#define NFY_FREESEG 2
325
326/* called when loading/starting a DLL */
327#define NFY_STARTDLL 3
Alexandre Julliard23946ad1997-06-16 17:43:53 +0000328typedef struct {
Alexandre Julliard3051b641996-07-05 17:14:13 +0000329 DWORD dwSize;
330 HMODULE16 hModule;
331 WORD wCS;
332 WORD wIP;
Alexandre Julliard7e56f681996-01-31 19:02:28 +0000333} NFYSTARTDLL;
334
335/* called when starting a task. dwData is CS:IP */
336#define NFY_STARTTASK 4
337
338/* called when a task terminates. dwData is the return code */
339#define NFY_EXITTASK 5
340
341/* called when module is removed. LOWORD(dwData) is the handle */
342#define NFY_DELMODULE 6
343
344/* RIP? debugevent */
345#define NFY_RIP 7
Alexandre Julliard23946ad1997-06-16 17:43:53 +0000346typedef struct {
Alexandre Julliard7e56f681996-01-31 19:02:28 +0000347 DWORD dwSize;
348 WORD wIP;
349 WORD wCS;
350 WORD wSS;
351 WORD wBP;
352 WORD wExitCode;
353} NFYRIP;
354
355/* called before (after?) switching to a task
356 * no data, callback should call GetCurrentTask
357 */
358#define NFY_TASKIN 8
359
360/* called before(after?) switching from a task
361 * no data, callback should call GetCurrentTask
362*/
363#define NFY_TASKOUT 9
364
365/* returns ASCII input value, dwData not set */
366#define NFY_INCHAR 10
367
368/* output debugstring (pointed to by dwData) */
369#define NFY_OUTSTRING 11
370
371/* log errors */
372#define NFY_LOGERROR 12
Alexandre Julliard23946ad1997-06-16 17:43:53 +0000373typedef struct {
Alexandre Julliard7e56f681996-01-31 19:02:28 +0000374 DWORD dwSize;
Alexandre Julliard3051b641996-07-05 17:14:13 +0000375 UINT16 wErrCode;
Alexandre Julliard1285c2f1996-05-06 16:06:24 +0000376 VOID *lpInfo; /* depends on wErrCode */
Alexandre Julliard7e56f681996-01-31 19:02:28 +0000377} NFYLOGERROR;
378
379/* called for parameter errors? */
380#define NFY_LOGPARAMERROR 13
Alexandre Julliard23946ad1997-06-16 17:43:53 +0000381typedef struct {
Alexandre Julliard3051b641996-07-05 17:14:13 +0000382 DWORD dwSize;
383 UINT16 wErrCode;
384 FARPROC16 lpfnErrorAddr;
385 void **lpBadParam;
Alexandre Julliard7e56f681996-01-31 19:02:28 +0000386} NFYLOGPARAMERROR;
Alexandre Julliard21979011997-03-05 08:22:35 +0000387
Alexandre Julliard44ed71f1997-12-21 19:17:50 +0000388typedef struct {
389 DWORD dwSize;
390 HTASK16 hTask;
391 WORD wSS;
392 WORD wBP;
393 WORD wCS;
394 WORD wIP;
395 HMODULE16 hModule;
396 WORD wSegment;
397 WORD wFlags;
398} STACKTRACEENTRY;
399
Alexandre Julliard21979011997-03-05 08:22:35 +0000400#pragma pack(4)
401
Huw D M Daviesd0421881998-11-01 19:23:52 +0000402/*
403 * Process Entry list as created by CreateToolHelp32Snapshot
404 */
405
406typedef struct tagPROCESSENTRY32 {
407 DWORD dwSize;
408 DWORD cntUsage;
409 DWORD th32ProcessID;
410 DWORD th32DefaultHeapID;
411 DWORD th32ModuleID;
412 DWORD cntThreads;
413 DWORD th32ParentProcessID;
414 LONG pcPriClassBase;
415 DWORD dwFlags;
416 char szExeFile[MAX_PATH];
417} PROCESSENTRY32;
418typedef PROCESSENTRY32 * PPROCESSENTRY32;
419typedef PROCESSENTRY32 * LPPROCESSENTRY32;
420
421BOOL32 WINAPI Process32First(HANDLE32,LPPROCESSENTRY32);
422BOOL32 WINAPI Process32Next(HANDLE32,LPPROCESSENTRY32);
423
424
Alexandre Julliardc6c09441997-01-12 18:32:19 +0000425#endif /* __WINE_TOOLHELP_H */