Added YUV routines needed for v4l driver, and in the future possibly
[wine/gsoc-2012-control.git] / dlls / kernel / toolhelp.h
blobfb7d6584d75c4120a96cf0f3912dd3838b17ef7f
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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 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,
104 WORD wSeg );
106 /* FIXME: Wine internal functions */
107 extern HGLOBAL16 GLOBAL_CreateBlock( UINT16 flags, const void *ptr, DWORD size,
108 HGLOBAL16 hOwner, unsigned char selflags );
109 extern BOOL16 GLOBAL_FreeBlock( HGLOBAL16 handle );
110 extern BOOL16 GLOBAL_MoveBlock( HGLOBAL16 handle, const void *ptr, DWORD size );
111 extern HGLOBAL16 GLOBAL_Alloc( WORD flags, DWORD size, HGLOBAL16 hOwner, unsigned char selflags );
113 /* Local heap */
115 typedef struct
117 DWORD dwSize;
118 WORD wcItems;
119 } LOCALINFO;
121 typedef struct
123 DWORD dwSize;
124 HLOCAL16 hHandle;
125 WORD wAddress;
126 WORD wSize;
127 WORD wFlags;
128 WORD wcLock;
129 WORD wType;
130 WORD hHeap;
131 WORD wHeapType;
132 WORD wNext;
133 } LOCALENTRY;
135 /* wHeapType values */
136 #define NORMAL_HEAP 0
137 #define USER_HEAP 1
138 #define GDI_HEAP 2
140 /* wFlags values */
141 #define LF_FIXED 1
142 #define LF_FREE 2
143 #define LF_MOVEABLE 4
145 /* wType values */
146 #define LT_NORMAL 0
147 #define LT_FREE 0xff
148 #define LT_GDI_PEN 1 /* LT_GDI_* is for GDI's heap */
149 #define LT_GDI_BRUSH 2
150 #define LT_GDI_FONT 3
151 #define LT_GDI_PALETTE 4
152 #define LT_GDI_BITMAP 5
153 #define LT_GDI_RGN 6
154 #define LT_GDI_DC 7
155 #define LT_GDI_DISABLED_DC 8
156 #define LT_GDI_METADC 9
157 #define LT_GDI_METAFILE 10
158 #define LT_GDI_MAX LT_GDI_METAFILE
159 #define LT_USER_CLASS 1 /* LT_USER_* is for USER's heap */
160 #define LT_USER_WND 2
161 #define LT_USER_STRING 3
162 #define LT_USER_MENU 4
163 #define LT_USER_CLIP 5
164 #define LT_USER_CBOX 6
165 #define LT_USER_PALETTE 7
166 #define LT_USER_ED 8
167 #define LT_USER_BWL 9
168 #define LT_USER_OWNERDRAW 10
169 #define LT_USER_SPB 11
170 #define LT_USER_CHECKPOINT 12
171 #define LT_USER_DCE 13
172 #define LT_USER_MWP 14
173 #define LT_USER_PROP 15
174 #define LT_USER_LBIV 16
175 #define LT_USER_MISC 17
176 #define LT_USER_ATOMS 18
177 #define LT_USER_LOCKINPUTSTATE 19
178 #define LT_USER_HOOKLIST 20
179 #define LT_USER_USERSEEUSERDOALLOC 21
180 #define LT_USER_HOTKEYLIST 22
181 #define LT_USER_POPUPMENU 23
182 #define LT_USER_HANDLETABLE 32
183 #define LT_USER_MAX LT_USER_HANDLETABLE
185 BOOL16 WINAPI LocalInfo16( LOCALINFO *pLocalInfo, HGLOBAL16 handle );
186 BOOL16 WINAPI LocalFirst16( LOCALENTRY *pLocalEntry, HGLOBAL16 handle );
187 BOOL16 WINAPI LocalNext16( LOCALENTRY *pLocalEntry );
189 /* Local 32-bit heap */
191 typedef struct
193 DWORD dwSize; /* 00 */
194 DWORD dwMemReserved; /* 04 */
195 DWORD dwMemCommitted; /* 08 */
196 DWORD dwTotalFree; /* 0C */
197 DWORD dwLargestFreeBlock; /* 10 */
198 DWORD dwcFreeHandles; /* 14 */
199 } LOCAL32INFO;
201 typedef struct
203 DWORD dwSize; /* 00 */
204 WORD hHandle; /* 04 */
205 DWORD dwAddress; /* 06 */
206 DWORD dwSizeBlock; /* 0A */
207 WORD wFlags; /* 0E */
208 WORD wType; /* 10 */
209 WORD hHeap; /* 12 */
210 WORD wHeapType; /* 14 */
211 DWORD dwNext; /* 16 */
212 DWORD dwNextAlt; /* 1A */
213 } LOCAL32ENTRY;
215 /* LOCAL32ENTRY.wHeapType flags same as LOCALENTRY.wHeapType flags */
216 /* LOCAL32ENTRY.wFlags same as LOCALENTRY.wFlags */
217 /* LOCAL32ENTRY.wType same as LOCALENTRY.wType */
219 BOOL16 WINAPI Local32Info16( LOCAL32INFO *pLocal32Info, HGLOBAL16 handle );
220 BOOL16 WINAPI Local32First16( LOCAL32ENTRY *pLocal32Entry, HGLOBAL16 handle );
221 BOOL16 WINAPI Local32Next16( LOCAL32ENTRY *pLocal32Entry );
224 /* modules */
226 typedef struct
228 DWORD dwSize;
229 char szModule[MAX_MODULE_NAME + 1];
230 HMODULE16 hModule;
231 WORD wcUsage;
232 char szExePath[MAX_PATH16 + 1];
233 HANDLE16 wNext;
234 } MODULEENTRY, *LPMODULEENTRY;
236 BOOL16 WINAPI ModuleFirst16(MODULEENTRY *lpModule);
237 BOOL16 WINAPI ModuleNext16(MODULEENTRY *lpModule);
238 BOOL16 WINAPI ModuleFindName16(MODULEENTRY *lpModule, LPCSTR lpstrName);
239 BOOL16 WINAPI ModuleFindHandle16(MODULEENTRY *lpModule, HMODULE16 hModule);
241 /* tasks */
243 typedef struct
245 DWORD dwSize;
246 HTASK16 hTask;
247 HTASK16 hTaskParent;
248 HINSTANCE16 hInst;
249 HMODULE16 hModule;
250 WORD wSS;
251 WORD wSP;
252 WORD wStackTop;
253 WORD wStackMinimum;
254 WORD wStackBottom;
255 WORD wcEvents;
256 HGLOBAL16 hQueue;
257 char szModule[MAX_MODULE_NAME + 1];
258 WORD wPSPOffset;
259 HANDLE16 hNext;
260 } TASKENTRY, *LPTASKENTRY;
262 BOOL16 WINAPI TaskFirst16(LPTASKENTRY lpTask);
263 BOOL16 WINAPI TaskNext16(LPTASKENTRY lpTask);
264 BOOL16 WINAPI TaskFindHandle16(LPTASKENTRY lpTask, HTASK16 hTask);
265 DWORD WINAPI TaskSetCSIP(HTASK16 hTask, WORD wCS, WORD wIP);
266 DWORD WINAPI TaskGetCSIP(HTASK16 hTask);
267 BOOL16 WINAPI TaskSwitch(HTASK16 hTask, DWORD dwNewCSIP);
269 /* flag for TerminateApp16() */
270 #define NO_UAE_BOX 1
272 /* mem info */
274 typedef struct tagMEMMANINFO {
275 DWORD dwSize;
276 DWORD dwLargestFreeBlock;
277 DWORD dwMaxPagesAvailable;
278 DWORD dwMaxPagesLockable;
279 DWORD dwTotalLinearSpace;
280 DWORD dwTotalUnlockedPages;
281 DWORD dwFreePages;
282 DWORD dwTotalPages;
283 DWORD dwFreeLinearSpace;
284 DWORD dwSwapFilePages;
285 WORD wPageSize;
286 } MEMMANINFO;
287 typedef MEMMANINFO *LPMEMMANINFO;
289 typedef struct
291 DWORD dwSize;
292 WORD wUserFreePercent;
293 WORD wGDIFreePercent;
294 HGLOBAL16 hUserSegment;
295 HGLOBAL16 hGDISegment;
296 } SYSHEAPINFO;
298 BOOL16 WINAPI MemManInfo16(LPMEMMANINFO lpEnhMode);
299 BOOL16 WINAPI SystemHeapInfo16( SYSHEAPINFO *pHeapInfo );
301 /* timer info */
303 typedef struct tagTIMERINFO {
304 DWORD dwSize;
305 DWORD dwmsSinceStart;
306 DWORD dwmsThisVM;
307 } TIMERINFO;
309 BOOL16 WINAPI TimerCount16( TIMERINFO *pTimerInfo );
311 /* Window classes */
313 typedef struct
315 DWORD dwSize;
316 HMODULE16 hInst; /* This is really an hModule */
317 char szClassName[MAX_CLASSNAME + 1];
318 HANDLE16 wNext;
319 } CLASSENTRY;
321 BOOL16 WINAPI ClassFirst16( CLASSENTRY *pClassEntry );
322 BOOL16 WINAPI ClassNext16( CLASSENTRY *pClassEntry );
325 /* Memory read/write */
327 DWORD WINAPI MemoryRead16( WORD sel, DWORD offset, void *buffer, DWORD count );
328 DWORD WINAPI MemoryWrite16( WORD sel, DWORD offset, void *buffer, DWORD count );
330 /* flags to NotifyRegister() */
331 #define NF_NORMAL 0 /* everything except taskswitches, debugerrors,
332 * debugstrings
334 #define NF_TASKSWITCH 1 /* get taskswitch information */
335 #define NF_RIP 2 /* get debugerrors of system */
337 BOOL16 WINAPI NotifyRegister16(HTASK16 htask,FARPROC16 lpfnCallback,WORD wFlags);
339 #define NFY_UNKNOWN 0
340 #define NFY_LOADSEG 1
341 /* DATA is a pointer to following struct: */
342 typedef struct {
343 DWORD dwSize;
344 WORD wSelector;
345 WORD wSegNum;
346 WORD wType; /* bit 0 set if this is a code segment */
347 WORD wcInstance; /* only valid for data segment */
348 } NFYLOADSEG;
349 /* called when freeing a segment. LOWORD(dwData) is the freed selector */
350 #define NFY_FREESEG 2
352 /* called when loading/starting a DLL */
353 #define NFY_STARTDLL 3
354 typedef struct {
355 DWORD dwSize;
356 HMODULE16 hModule;
357 WORD wCS;
358 WORD wIP;
359 } NFYSTARTDLL;
361 /* called when starting a task. dwData is CS:IP */
362 #define NFY_STARTTASK 4
364 /* called when a task terminates. dwData is the return code */
365 #define NFY_EXITTASK 5
367 /* called when module is removed. LOWORD(dwData) is the handle */
368 #define NFY_DELMODULE 6
370 /* RIP? debugevent */
371 #define NFY_RIP 7
372 typedef struct {
373 DWORD dwSize;
374 WORD wIP;
375 WORD wCS;
376 WORD wSS;
377 WORD wBP;
378 WORD wExitCode;
379 } NFYRIP;
381 /* called before (after?) switching to a task
382 * no data, callback should call GetCurrentTask
384 #define NFY_TASKIN 8
386 /* called before(after?) switching from a task
387 * no data, callback should call GetCurrentTask
389 #define NFY_TASKOUT 9
391 /* returns ASCII input value, dwData not set */
392 #define NFY_INCHAR 10
394 /* output debugstring (pointed to by dwData) */
395 #define NFY_OUTSTRING 11
397 /* log errors */
398 #define NFY_LOGERROR 12
399 typedef struct {
400 DWORD dwSize;
401 UINT16 wErrCode;
402 VOID *lpInfo; /* depends on wErrCode */
403 } NFYLOGERROR;
405 /* called for parameter errors? */
406 #define NFY_LOGPARAMERROR 13
407 typedef struct {
408 DWORD dwSize;
409 UINT16 wErrCode;
410 FARPROC16 lpfnErrorAddr;
411 void **lpBadParam;
412 } NFYLOGPARAMERROR;
414 typedef struct {
415 DWORD dwSize;
416 HTASK16 hTask;
417 WORD wSS;
418 WORD wBP;
419 WORD wCS;
420 WORD wIP;
421 HMODULE16 hModule;
422 WORD wSegment;
423 WORD wFlags;
424 } STACKTRACEENTRY;
426 #include <poppack.h>
428 #endif /* __WINE_TOOLHELP_H */