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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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 WORD WINAPI GlobalHandleToSel16( HGLOBAL16 handle );
99 BOOL16 WINAPI GlobalInfo16( GLOBALINFO *pInfo );
100 BOOL16 WINAPI GlobalFirst16( GLOBALENTRY *pGlobal, WORD wFlags );
101 BOOL16 WINAPI GlobalNext16( GLOBALENTRY *pGlobal, WORD wFlags) ;
102 BOOL16 WINAPI GlobalEntryHandle16( GLOBALENTRY *pGlobal, HGLOBAL16 hItem );
103 BOOL16 WINAPI GlobalEntryModule16( GLOBALENTRY *pGlobal, HMODULE16 hModule,
128 /* wHeapType values */
129 #define NORMAL_HEAP 0
136 #define LF_MOVEABLE 4
141 #define LT_GDI_PEN 1 /* LT_GDI_* is for GDI's heap */
142 #define LT_GDI_BRUSH 2
143 #define LT_GDI_FONT 3
144 #define LT_GDI_PALETTE 4
145 #define LT_GDI_BITMAP 5
148 #define LT_GDI_DISABLED_DC 8
149 #define LT_GDI_METADC 9
150 #define LT_GDI_METAFILE 10
151 #define LT_GDI_MAX LT_GDI_METAFILE
152 #define LT_USER_CLASS 1 /* LT_USER_* is for USER's heap */
153 #define LT_USER_WND 2
154 #define LT_USER_STRING 3
155 #define LT_USER_MENU 4
156 #define LT_USER_CLIP 5
157 #define LT_USER_CBOX 6
158 #define LT_USER_PALETTE 7
160 #define LT_USER_BWL 9
161 #define LT_USER_OWNERDRAW 10
162 #define LT_USER_SPB 11
163 #define LT_USER_CHECKPOINT 12
164 #define LT_USER_DCE 13
165 #define LT_USER_MWP 14
166 #define LT_USER_PROP 15
167 #define LT_USER_LBIV 16
168 #define LT_USER_MISC 17
169 #define LT_USER_ATOMS 18
170 #define LT_USER_LOCKINPUTSTATE 19
171 #define LT_USER_HOOKLIST 20
172 #define LT_USER_USERSEEUSERDOALLOC 21
173 #define LT_USER_HOTKEYLIST 22
174 #define LT_USER_POPUPMENU 23
175 #define LT_USER_HANDLETABLE 32
176 #define LT_USER_MAX LT_USER_HANDLETABLE
178 BOOL16 WINAPI LocalInfo16( LOCALINFO *pLocalInfo, HGLOBAL16 handle );
179 BOOL16 WINAPI LocalFirst16( LOCALENTRY *pLocalEntry, HGLOBAL16 handle );
180 BOOL16 WINAPI LocalNext16( LOCALENTRY *pLocalEntry );
182 /* Local 32-bit heap */
186 DWORD dwSize; /* 00 */
187 DWORD dwMemReserved; /* 04 */
188 DWORD dwMemCommitted; /* 08 */
189 DWORD dwTotalFree; /* 0C */
190 DWORD dwLargestFreeBlock; /* 10 */
191 DWORD dwcFreeHandles; /* 14 */
196 DWORD dwSize; /* 00 */
197 WORD hHandle; /* 04 */
198 DWORD dwAddress; /* 06 */
199 DWORD dwSizeBlock; /* 0A */
200 WORD wFlags; /* 0E */
203 WORD wHeapType; /* 14 */
204 DWORD dwNext; /* 16 */
205 DWORD dwNextAlt; /* 1A */
208 /* LOCAL32ENTRY.wHeapType flags same as LOCALENTRY.wHeapType flags */
209 /* LOCAL32ENTRY.wFlags same as LOCALENTRY.wFlags */
210 /* LOCAL32ENTRY.wType same as LOCALENTRY.wType */
212 BOOL16 WINAPI Local32Info16( LOCAL32INFO *pLocal32Info, HGLOBAL16 handle );
213 BOOL16 WINAPI Local32First16( LOCAL32ENTRY *pLocal32Entry, HGLOBAL16 handle );
214 BOOL16 WINAPI Local32Next16( LOCAL32ENTRY *pLocal32Entry );
222 char szModule[MAX_MODULE_NAME + 1];
225 char szExePath[MAX_PATH16 + 1];
227 } MODULEENTRY, *LPMODULEENTRY;
229 BOOL16 WINAPI ModuleFirst16(MODULEENTRY *lpModule);
230 BOOL16 WINAPI ModuleNext16(MODULEENTRY *lpModule);
231 BOOL16 WINAPI ModuleFindName16(MODULEENTRY *lpModule, LPCSTR lpstrName);
232 BOOL16 WINAPI ModuleFindHandle16(MODULEENTRY *lpModule, HMODULE16 hModule);
250 char szModule[MAX_MODULE_NAME + 1];
253 } TASKENTRY, *LPTASKENTRY;
255 BOOL16 WINAPI TaskFirst16(LPTASKENTRY lpTask);
256 BOOL16 WINAPI TaskNext16(LPTASKENTRY lpTask);
257 BOOL16 WINAPI TaskFindHandle16(LPTASKENTRY lpTask, HTASK16 hTask);
258 DWORD WINAPI TaskSetCSIP(HTASK16 hTask, WORD wCS, WORD wIP);
259 DWORD WINAPI TaskGetCSIP(HTASK16 hTask);
260 BOOL16 WINAPI TaskSwitch(HTASK16 hTask, DWORD dwNewCSIP);
262 /* flag for TerminateApp16() */
267 typedef struct tagMEMMANINFO {
269 DWORD dwLargestFreeBlock;
270 DWORD dwMaxPagesAvailable;
271 DWORD dwMaxPagesLockable;
272 DWORD dwTotalLinearSpace;
273 DWORD dwTotalUnlockedPages;
276 DWORD dwFreeLinearSpace;
277 DWORD dwSwapFilePages;
280 typedef MEMMANINFO *LPMEMMANINFO;
285 WORD wUserFreePercent;
286 WORD wGDIFreePercent;
287 HGLOBAL16 hUserSegment;
288 HGLOBAL16 hGDISegment;
291 BOOL16 WINAPI MemManInfo16(LPMEMMANINFO lpEnhMode);
292 BOOL16 WINAPI SystemHeapInfo16( SYSHEAPINFO *pHeapInfo );
296 typedef struct tagTIMERINFO {
298 DWORD dwmsSinceStart;
302 BOOL16 WINAPI TimerCount16( TIMERINFO *pTimerInfo );
309 HMODULE16 hInst; /* This is really an hModule */
310 char szClassName[MAX_CLASSNAME + 1];
314 BOOL16 WINAPI ClassFirst16( CLASSENTRY *pClassEntry );
315 BOOL16 WINAPI ClassNext16( CLASSENTRY *pClassEntry );
318 /* Memory read/write */
320 DWORD WINAPI MemoryRead16( WORD sel, DWORD offset, void *buffer, DWORD count );
321 DWORD WINAPI MemoryWrite16( WORD sel, DWORD offset, void *buffer, DWORD count );
323 /* flags to NotifyRegister() */
324 #define NF_NORMAL 0 /* everything except taskswitches, debugerrors,
327 #define NF_TASKSWITCH 1 /* get taskswitch information */
328 #define NF_RIP 2 /* get debugerrors of system */
330 BOOL16 WINAPI NotifyRegister16(HTASK16 htask,FARPROC16 lpfnCallback,WORD wFlags);
332 #define NFY_UNKNOWN 0
333 #define NFY_LOADSEG 1
334 /* DATA is a pointer to following struct: */
339 WORD wType; /* bit 0 set if this is a code segment */
340 WORD wcInstance; /* only valid for data segment */
342 /* called when freeing a segment. LOWORD(dwData) is the freed selector */
343 #define NFY_FREESEG 2
345 /* called when loading/starting a DLL */
346 #define NFY_STARTDLL 3
354 /* called when starting a task. dwData is CS:IP */
355 #define NFY_STARTTASK 4
357 /* called when a task terminates. dwData is the return code */
358 #define NFY_EXITTASK 5
360 /* called when module is removed. LOWORD(dwData) is the handle */
361 #define NFY_DELMODULE 6
363 /* RIP? debugevent */
374 /* called before (after?) switching to a task
375 * no data, callback should call GetCurrentTask
379 /* called before(after?) switching from a task
380 * no data, callback should call GetCurrentTask
382 #define NFY_TASKOUT 9
384 /* returns ASCII input value, dwData not set */
385 #define NFY_INCHAR 10
387 /* output debugstring (pointed to by dwData) */
388 #define NFY_OUTSTRING 11
391 #define NFY_LOGERROR 12
395 VOID *lpInfo; /* depends on wErrCode */
398 /* called for parameter errors? */
399 #define NFY_LOGPARAMERROR 13
403 FARPROC16 lpfnErrorAddr;
421 #endif /* __WINE_TOOLHELP_H */