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
23 #include <wine/windef16.h>
26 #define MAX_MODULE_NAME 9
27 #define MAX_PATH16 255
28 #define MAX_CLASSNAME 255
59 /* GlobalFirst()/GlobalNext() flags */
75 #define GT_BURGERMASTER 10
78 #define GD_USERDEFINED 0
79 #define GD_CURSORCOMPONENT 1
81 #define GD_ICONCOMPONENT 3
87 #define GD_ACCELERATORS 9
89 #define GD_ERRTABLE 11
92 #define GD_NAMETABLE 15
93 #define GD_MAX_RESOURCE 15
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,
127 /* wHeapType values */
128 #define NORMAL_HEAP 0
135 #define LF_MOVEABLE 4
140 #define LT_GDI_PEN 1 /* LT_GDI_* is for GDI's heap */
141 #define LT_GDI_BRUSH 2
142 #define LT_GDI_FONT 3
143 #define LT_GDI_PALETTE 4
144 #define LT_GDI_BITMAP 5
147 #define LT_GDI_DISABLED_DC 8
148 #define LT_GDI_METADC 9
149 #define LT_GDI_METAFILE 10
150 #define LT_GDI_MAX LT_GDI_METAFILE
151 #define LT_USER_CLASS 1 /* LT_USER_* is for USER's heap */
152 #define LT_USER_WND 2
153 #define LT_USER_STRING 3
154 #define LT_USER_MENU 4
155 #define LT_USER_CLIP 5
156 #define LT_USER_CBOX 6
157 #define LT_USER_PALETTE 7
159 #define LT_USER_BWL 9
160 #define LT_USER_OWNERDRAW 10
161 #define LT_USER_SPB 11
162 #define LT_USER_CHECKPOINT 12
163 #define LT_USER_DCE 13
164 #define LT_USER_MWP 14
165 #define LT_USER_PROP 15
166 #define LT_USER_LBIV 16
167 #define LT_USER_MISC 17
168 #define LT_USER_ATOMS 18
169 #define LT_USER_LOCKINPUTSTATE 19
170 #define LT_USER_HOOKLIST 20
171 #define LT_USER_USERSEEUSERDOALLOC 21
172 #define LT_USER_HOTKEYLIST 22
173 #define LT_USER_POPUPMENU 23
174 #define LT_USER_HANDLETABLE 32
175 #define LT_USER_MAX LT_USER_HANDLETABLE
177 BOOL16 WINAPI LocalInfo16( LOCALINFO *pLocalInfo, HGLOBAL16 handle );
178 BOOL16 WINAPI LocalFirst16( LOCALENTRY *pLocalEntry, HGLOBAL16 handle );
179 BOOL16 WINAPI LocalNext16( LOCALENTRY *pLocalEntry );
181 /* Local 32-bit heap */
185 DWORD dwSize; /* 00 */
186 DWORD dwMemReserved; /* 04 */
187 DWORD dwMemCommitted; /* 08 */
188 DWORD dwTotalFree; /* 0C */
189 DWORD dwLargestFreeBlock; /* 10 */
190 DWORD dwcFreeHandles; /* 14 */
195 DWORD dwSize; /* 00 */
196 WORD hHandle; /* 04 */
197 DWORD dwAddress; /* 06 */
198 DWORD dwSizeBlock; /* 0A */
199 WORD wFlags; /* 0E */
202 WORD wHeapType; /* 14 */
203 DWORD dwNext; /* 16 */
204 DWORD dwNextAlt; /* 1A */
207 /* LOCAL32ENTRY.wHeapType flags same as LOCALENTRY.wHeapType flags */
208 /* LOCAL32ENTRY.wFlags same as LOCALENTRY.wFlags */
209 /* LOCAL32ENTRY.wType same as LOCALENTRY.wType */
211 BOOL16 WINAPI Local32Info16( LOCAL32INFO *pLocal32Info, HGLOBAL16 handle );
212 BOOL16 WINAPI Local32First16( LOCAL32ENTRY *pLocal32Entry, HGLOBAL16 handle );
213 BOOL16 WINAPI Local32Next16( LOCAL32ENTRY *pLocal32Entry );
221 char szModule[MAX_MODULE_NAME + 1];
224 char szExePath[MAX_PATH16 + 1];
226 } MODULEENTRY, *LPMODULEENTRY;
228 BOOL16 WINAPI ModuleFirst16(MODULEENTRY *lpModule);
229 BOOL16 WINAPI ModuleNext16(MODULEENTRY *lpModule);
230 BOOL16 WINAPI ModuleFindName16(MODULEENTRY *lpModule, LPCSTR lpstrName);
231 BOOL16 WINAPI ModuleFindHandle16(MODULEENTRY *lpModule, HMODULE16 hModule);
249 char szModule[MAX_MODULE_NAME + 1];
252 } TASKENTRY, *LPTASKENTRY;
254 BOOL16 WINAPI TaskFirst16(LPTASKENTRY lpTask);
255 BOOL16 WINAPI TaskNext16(LPTASKENTRY lpTask);
256 BOOL16 WINAPI TaskFindHandle16(LPTASKENTRY lpTask, HTASK16 hTask);
257 DWORD WINAPI TaskSetCSIP(HTASK16 hTask, WORD wCS, WORD wIP);
258 DWORD WINAPI TaskGetCSIP(HTASK16 hTask);
259 BOOL16 WINAPI TaskSwitch(HTASK16 hTask, DWORD dwNewCSIP);
261 /* flag for TerminateApp16() */
266 typedef struct tagMEMMANINFO {
268 DWORD dwLargestFreeBlock;
269 DWORD dwMaxPagesAvailable;
270 DWORD dwMaxPagesLockable;
271 DWORD dwTotalLinearSpace;
272 DWORD dwTotalUnlockedPages;
275 DWORD dwFreeLinearSpace;
276 DWORD dwSwapFilePages;
279 typedef MEMMANINFO *LPMEMMANINFO;
284 WORD wUserFreePercent;
285 WORD wGDIFreePercent;
286 HGLOBAL16 hUserSegment;
287 HGLOBAL16 hGDISegment;
290 BOOL16 WINAPI MemManInfo16(LPMEMMANINFO lpEnhMode);
291 BOOL16 WINAPI SystemHeapInfo16( SYSHEAPINFO *pHeapInfo );
295 typedef struct tagTIMERINFO {
297 DWORD dwmsSinceStart;
301 BOOL16 WINAPI TimerCount16( TIMERINFO *pTimerInfo );
308 HMODULE16 hInst; /* This is really an hModule */
309 char szClassName[MAX_CLASSNAME + 1];
313 BOOL16 WINAPI ClassFirst16( CLASSENTRY *pClassEntry );
314 BOOL16 WINAPI ClassNext16( CLASSENTRY *pClassEntry );
317 /* Memory read/write */
319 DWORD WINAPI MemoryRead16( WORD sel, DWORD offset, void *buffer, DWORD count );
320 DWORD WINAPI MemoryWrite16( WORD sel, DWORD offset, void *buffer, DWORD count );
322 /* flags to NotifyRegister() */
323 #define NF_NORMAL 0 /* everything except taskswitches, debugerrors,
326 #define NF_TASKSWITCH 1 /* get taskswitch information */
327 #define NF_RIP 2 /* get debugerrors of system */
329 BOOL16 WINAPI NotifyRegister16(HTASK16 htask,FARPROC16 lpfnCallback,WORD wFlags);
331 #define NFY_UNKNOWN 0
332 #define NFY_LOADSEG 1
333 /* DATA is a pointer to following struct: */
338 WORD wType; /* bit 0 set if this is a code segment */
339 WORD wcInstance; /* only valid for data segment */
341 /* called when freeing a segment. LOWORD(dwData) is the freed selector */
342 #define NFY_FREESEG 2
344 /* called when loading/starting a DLL */
345 #define NFY_STARTDLL 3
353 /* called when starting a task. dwData is CS:IP */
354 #define NFY_STARTTASK 4
356 /* called when a task terminates. dwData is the return code */
357 #define NFY_EXITTASK 5
359 /* called when module is removed. LOWORD(dwData) is the handle */
360 #define NFY_DELMODULE 6
362 /* RIP? debugevent */
373 /* called before (after?) switching to a task
374 * no data, callback should call GetCurrentTask
378 /* called before(after?) switching from a task
379 * no data, callback should call GetCurrentTask
381 #define NFY_TASKOUT 9
383 /* returns ASCII input value, dwData not set */
384 #define NFY_INCHAR 10
386 /* output debugstring (pointed to by dwData) */
387 #define NFY_OUTSTRING 11
390 #define NFY_LOGERROR 12
394 VOID *lpInfo; /* depends on wErrCode */
397 /* called for parameter errors? */
398 #define NFY_LOGPARAMERROR 13
402 FARPROC16 lpfnErrorAddr;
420 #endif /* __WINE_TOOLHELP_H */