- Fixed broken winedbg compilation on BSD.
[wine] / include / dbghelp.h
1 /*
2  * Declarations for DBGHELP
3  *
4  * Copyright (C) 2003 Eric Pouech
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  */
20
21 #ifndef __WINE_DBGHELP_H
22 #define __WINE_DBGHELP_H
23
24 #ifdef __cplusplus
25 extern "C" {
26 #endif /* defined(__cplusplus) */
27
28 typedef struct _LOADED_IMAGE
29 {
30     LPSTR                       ModuleName;
31     HANDLE                      hFile;
32     PUCHAR                      MappedAddress;
33     PIMAGE_NT_HEADERS           FileHeader;
34     PIMAGE_SECTION_HEADER       LastRvaSection;
35     ULONG                       NumberOfSections;
36     PIMAGE_SECTION_HEADER       Sections;
37     ULONG                       Characteristics;
38     BOOLEAN                     fSystemImage;
39     BOOLEAN                     fDOSImage;
40     LIST_ENTRY                  Links;
41     ULONG                       SizeOfImage;
42 } LOADED_IMAGE, *PLOADED_IMAGE;
43
44 /*************************
45  *    IMAGEHLP equiv     *
46  *************************/
47
48 typedef enum
49 {
50     AddrMode1616,
51     AddrMode1632,
52     AddrModeReal,
53     AddrModeFlat
54 } ADDRESS_MODE;
55
56 typedef struct _tagADDRESS
57 {
58     DWORD                       Offset;
59     WORD                        Segment;
60     ADDRESS_MODE                Mode;
61 } ADDRESS, *LPADDRESS;
62
63 #define SYMF_OMAP_GENERATED   0x00000001
64 #define SYMF_OMAP_MODIFIED    0x00000002
65 #define SYMF_USER_GENERATED   0x00000004
66 #define SYMF_REGISTER         0x00000008
67 #define SYMF_REGREL           0x00000010
68 #define SYMF_FRAMEREL         0x00000020
69 #define SYMF_PARAMETER        0x00000040
70 #define SYMF_LOCAL            0x00000080
71 #define SYMF_CONSTANT         0x00000100
72 #define SYMF_EXPORT           0x00000200
73 #define SYMF_FORWARDER        0x00000400
74 #define SYMF_FUNCTION         0x00000800
75
76 typedef enum 
77 {
78     SymNone = 0,
79     SymCoff,
80     SymCv,
81     SymPdb,
82     SymExport,
83     SymDeferred,
84     SymSym,
85     SymDia,
86     NumSymTypes
87 } SYM_TYPE;
88
89 typedef struct _IMAGEHLP_SYMBOL
90 {
91     DWORD                       SizeOfStruct;
92     DWORD                       Address;
93     DWORD                       Size;
94     DWORD                       Flags;
95     DWORD                       MaxNameLength;
96     CHAR                        Name[1];
97 } IMAGEHLP_SYMBOL, *PIMAGEHLP_SYMBOL;
98
99 typedef struct _IMAGEHLP_MODULE
100 {
101     DWORD                       SizeOfStruct;
102     DWORD                       BaseOfImage;
103     DWORD                       ImageSize;
104     DWORD                       TimeDateStamp;
105     DWORD                       CheckSum;
106     DWORD                       NumSyms;
107     SYM_TYPE                    SymType;
108     CHAR                        ModuleName[32];
109     CHAR                        ImageName[256];
110     CHAR                        LoadedImageName[256];
111 } IMAGEHLP_MODULE, *PIMAGEHLP_MODULE;
112
113 typedef struct _IMAGEHLP_MODULEW {
114     DWORD                       SizeOfStruct;
115     DWORD                       BaseOfImage;
116     DWORD                       ImageSize;
117     DWORD                       TimeDateStamp;
118     DWORD                       CheckSum;
119     DWORD                       NumSyms;
120     SYM_TYPE                    SymType;
121     WCHAR                       ModuleName[32];
122     WCHAR                       ImageName[256];
123     WCHAR                       LoadedImageName[256];
124 } IMAGEHLP_MODULEW, *PIMAGEHLP_MODULEW;
125
126 typedef struct _IMAGEHLP_LINE
127 {
128     DWORD                       SizeOfStruct;
129     PVOID                       Key;
130     DWORD                       LineNumber;
131     PCHAR                       FileName;
132     DWORD                       Address;
133 } IMAGEHLP_LINE, *PIMAGEHLP_LINE;
134
135 typedef struct _SOURCEFILE
136 {
137     DWORD                       ModBase;
138     PCHAR                       FileName;
139 } SOURCEFILE, *PSOURCEFILE;
140
141 #define CBA_DEFERRED_SYMBOL_LOAD_START          0x00000001
142 #define CBA_DEFERRED_SYMBOL_LOAD_COMPLETE       0x00000002
143 #define CBA_DEFERRED_SYMBOL_LOAD_FAILURE        0x00000003
144 #define CBA_SYMBOLS_UNLOADED                    0x00000004
145 #define CBA_DUPLICATE_SYMBOL                    0x00000005
146 #define CBA_READ_MEMORY                         0x00000006
147 #define CBA_DEFERRED_SYMBOL_LOAD_CANCEL         0x00000007
148 #define CBA_SET_OPTIONS                         0x00000008
149 #define CBA_EVENT                               0x00000010
150 #define CBA_DEBUG_INFO                          0x10000000
151
152 typedef struct _IMAGEHLP_CBA_READ_MEMORY
153 {
154     DWORD     addr;
155     PVOID     buf;
156     DWORD     bytes;
157     DWORD    *bytesread;
158 } IMAGEHLP_CBA_READ_MEMORY, *PIMAGEHLP_CBA_READ_MEMORY;
159
160 enum {
161     sevInfo = 0,
162     sevProblem,
163     sevAttn,
164     sevFatal,
165     sevMax
166 };
167
168 typedef struct _IMAGEHLP_CBA_EVENT
169 {
170     DWORD severity;
171     DWORD code;
172     PCHAR desc;
173     PVOID object;
174 } IMAGEHLP_CBA_EVENT, *PIMAGEHLP_CBA_EVENT;
175
176 typedef struct _IMAGEHLP_DEFERRED_SYMBOL_LOAD
177 {
178     DWORD                       SizeOfStruct;
179     DWORD64                     BaseOfImage;
180     DWORD                       CheckSum;
181     DWORD                       TimeDateStamp;
182     CHAR                        FileName[MAX_PATH];
183     BOOLEAN                     Reparse;
184 } IMAGEHLP_DEFERRED_SYMBOL_LOAD, *PIMAGEHLP_DEFERRED_SYMBOL_LOAD;
185
186 typedef struct _IMAGEHLP_DUPLICATE_SYMBOL
187 {
188     DWORD                       SizeOfStruct;
189     DWORD                       NumberOfDups;
190     PIMAGEHLP_SYMBOL            Symbol;
191     DWORD                       SelectedSymbol;
192 } IMAGEHLP_DUPLICATE_SYMBOL, *PIMAGEHLP_DUPLICATE_SYMBOL;
193
194 #define SYMOPT_CASE_INSENSITIVE         0x00000001
195 #define SYMOPT_UNDNAME                  0x00000002
196 #define SYMOPT_DEFERRED_LOADS           0x00000004
197 #define SYMOPT_NO_CPP                   0x00000008
198 #define SYMOPT_LOAD_LINES               0x00000010
199 #define SYMOPT_OMAP_FIND_NEAREST        0x00000020
200 #define SYMOPT_LOAD_ANYTHING            0x00000040
201 #define SYMOPT_IGNORE_CVREC             0x00000080
202 #define SYMOPT_NO_UNQUALIFIED_LOADS     0x00000100
203 #define SYMOPT_FAIL_CRITICAL_ERRORS     0x00000200
204 #define SYMOPT_EXACT_SYMBOLS            0x00000400
205 #define SYMOPT_WILD_UNDERSCORE          0x00000800
206 #define SYMOPT_USE_DEFAULTS             0x00001000
207 #define SYMOPT_INCLUDE_32BIT_MODULES    0x00002000
208
209 #define SYMOPT_DEBUG                    0x80000000
210
211 typedef struct _IMAGEHLP_STACK_FRAME
212 {
213     ULONG       InstructionOffset;
214     ULONG       ReturnOffset;
215     ULONG       FrameOffset;
216     ULONG       StackOffset;
217     ULONG       BackingStoreOffset;
218     ULONG       FuncTableEntry;
219     ULONG       Params[4];
220     ULONG       Reserved[5];
221     BOOL        Virtual;
222     ULONG       Reserved2;
223 } IMAGEHLP_STACK_FRAME, *PIMAGEHLP_STACK_FRAME;
224
225 typedef VOID IMAGEHLP_CONTEXT, *PIMAGEHLP_CONTEXT;
226
227 #define DBHHEADER_DEBUGDIRS     0x1
228 typedef struct _DBGHELP_MODLOAD_DATA
229 {
230     DWORD               ssize;
231     DWORD               ssig;
232     PVOID               data;
233     DWORD               size;
234     DWORD               flags;
235 } MODLOAD_DATA, *PMODLOAD_DATA;
236
237 /*************************
238  *     now DBGHELP       *
239  *************************/
240
241 /* DebugHelp */
242
243 #define MINIDUMP_SIGNATURE 0x4D444D50 /* 'PMDM' */
244 #define MINIDUMP_VERSION   (42899)
245
246 typedef DWORD   RVA;
247 typedef ULONG64 RVA64;
248
249 typedef enum _MINIDUMP_TYPE 
250 {
251     MiniDumpNormal         = 0x0000,
252     MiniDumpWithDataSegs   = 0x0001,
253     MiniDumpWithFullMemory = 0x0002,
254     MiniDumpWithHandleData = 0x0004,
255     MiniDumpFilterMemory   = 0x0008,
256     MiniDumpScanMemory     = 0x0010
257 } MINIDUMP_TYPE;
258
259 typedef enum _MINIDUMP_CALLBACK_TYPE
260 {
261     ModuleCallback,
262     ThreadCallback,
263     ThreadExCallback,
264     IncludeThreadCallback,
265     IncludeModuleCallback,
266 } MINIDUMP_CALLBACK_TYPE;
267
268 typedef struct _MINIDUMP_THREAD_CALLBACK
269 {
270     ULONG                       ThreadId;
271     HANDLE                      ThreadHandle;
272     CONTEXT                     Context;
273     ULONG                       SizeOfContext;
274     ULONGLONG                   StackBase;
275     ULONG64                     StackEnd;
276 } MINIDUMP_THREAD_CALLBACK, *PMINIDUMP_THREAD_CALLBACK;
277
278 typedef struct _MINIDUMP_THREAD_EX_CALLBACK 
279 {
280     ULONG                       ThreadId;
281     HANDLE                      ThreadHandle;
282     CONTEXT                     Context;
283     ULONG                       SizeOfContext;
284     ULONGLONG                   StackBase;
285     ULONGLONG                   StackEnd;
286     ULONGLONG                   BackingStoreBase;
287     ULONGLONG                   BackingStoreEnd;
288 } MINIDUMP_THREAD_EX_CALLBACK, *PMINIDUMP_THREAD_EX_CALLBACK;
289
290 typedef struct _MINIDUMP_INCLUDE_THREAD_CALLBACK
291 {
292     ULONG ThreadId;
293 } MINIDUMP_INCLUDE_THREAD_CALLBACK, *PMINIDUMP_INCLUDE_THREAD_CALLBACK;
294
295 typedef enum _THREAD_WRITE_FLAGS 
296 {
297     ThreadWriteThread            = 0x0001,
298     ThreadWriteStack             = 0x0002,
299     ThreadWriteContext           = 0x0004,
300     ThreadWriteBackingStore      = 0x0008,
301     ThreadWriteInstructionWindow = 0x0010
302 } THREAD_WRITE_FLAGS;
303
304 typedef struct _MINIDUMP_MODULE_CALLBACK 
305 {
306     PWCHAR                      FullPath;
307     ULONGLONG                   BaseOfImage;
308     ULONG                       SizeOfImage;
309     ULONG                       CheckSum;
310     ULONG                       TimeDateStamp;
311     VS_FIXEDFILEINFO            VersionInfo;
312     PVOID                       CvRecord;
313     ULONG                       SizeOfCvRecord;
314     PVOID                       MiscRecord;
315     ULONG                       SizeOfMiscRecord;
316 } MINIDUMP_MODULE_CALLBACK, *PMINIDUMP_MODULE_CALLBACK;
317
318 typedef struct _MINIDUMP_INCLUDE_MODULE_CALLBACK 
319 {
320     ULONG64 BaseOfImage;
321 } MINIDUMP_INCLUDE_MODULE_CALLBACK, *PMINIDUMP_INCLUDE_MODULE_CALLBACK;
322
323 typedef enum _MODULE_WRITE_FLAGS 
324 {
325     ModuleWriteModule        = 0x0001,
326     ModuleWriteDataSeg       = 0x0002,
327     ModuleWriteMiscRecord    = 0x0004,
328     ModuleWriteCvRecord      = 0x0008,
329     ModuleReferencedByMemory = 0x0010
330 } MODULE_WRITE_FLAGS;
331
332 typedef struct _MINIDUMP_CALLBACK_INPUT 
333 {
334     ULONG                       ProcessId;
335     HANDLE                      ProcessHandle;
336     ULONG                       CallbackType;
337     union 
338     {
339         MINIDUMP_THREAD_CALLBACK        Thread;
340         MINIDUMP_THREAD_EX_CALLBACK     ThreadEx;
341         MINIDUMP_MODULE_CALLBACK        Module;
342         MINIDUMP_INCLUDE_THREAD_CALLBACK IncludeThread;
343         MINIDUMP_INCLUDE_MODULE_CALLBACK IncludeModule;
344     } u;
345 } MINIDUMP_CALLBACK_INPUT, *PMINIDUMP_CALLBACK_INPUT;
346
347 typedef struct _MINIDUMP_CALLBACK_OUTPUT
348 {
349     union 
350     {
351         ULONG                           ModuleWriteFlags;
352         ULONG                           ThreadWriteFlags;
353     } u;
354 } MINIDUMP_CALLBACK_OUTPUT, *PMINIDUMP_CALLBACK_OUTPUT;
355
356 typedef BOOL (WINAPI* MINIDUMP_CALLBACK_ROUTINE)(PVOID CallbackParam,
357                                                  const PMINIDUMP_CALLBACK_INPUT CallbackInput,
358                                                  PMINIDUMP_CALLBACK_OUTPUT CallbackOutput);
359
360 typedef struct _MINIDUMP_CALLBACK_INFORMATION 
361 {
362     MINIDUMP_CALLBACK_ROUTINE   CallbackRoutine;
363     void*                       CallbackParam;
364 } MINIDUMP_CALLBACK_INFORMATION, *PMINIDUMP_CALLBACK_INFORMATION;
365
366 typedef struct _MINIDUMP_LOCATION_DESCRIPTOR 
367 {
368     ULONG                       DataSize;
369     RVA                         Rva;
370 } MINIDUMP_LOCATION_DESCRIPTOR;
371
372 typedef struct _MINIDUMP_DIRECTORY 
373 {
374     ULONG                       StreamType;
375     MINIDUMP_LOCATION_DESCRIPTOR Location;
376 } MINIDUMP_DIRECTORY, *PMINIDUMP_DIRECTORY;
377
378 typedef struct _MINIDUMP_EXCEPTION
379 {
380     ULONG                       ExceptionCode;
381     ULONG                       ExceptionFlags;
382     ULONGLONG                   ExceptionRecord;
383     ULONGLONG                   ExceptionAddress;
384     ULONG                       NumberParameters;
385     ULONG                        __unusedAlignment;
386     ULONGLONG                   ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS];
387 } MINIDUMP_EXCEPTION, *PMINIDUMP_EXCEPTION;
388
389 typedef struct _MINIDUMP_EXCEPTION_INFORMATION
390 {
391     DWORD                       ThreadId;
392     PEXCEPTION_POINTERS         ExceptionPointers;
393     BOOL                        ClientPointers;
394 } MINIDUMP_EXCEPTION_INFORMATION, *PMINIDUMP_EXCEPTION_INFORMATION;
395
396 typedef struct MINIDUMP_EXCEPTION_STREAM 
397 {
398     ULONG                       ThreadId;
399     ULONG                       __alignment;
400     MINIDUMP_EXCEPTION          ExceptionRecord;
401     MINIDUMP_LOCATION_DESCRIPTOR ThreadContext;
402 } MINIDUMP_EXCEPTION_STREAM, *PMINIDUMP_EXCEPTION_STREAM;
403
404 typedef struct _MINIDUMP_HEADER 
405 {
406     DWORD                       Signature;
407     DWORD                       Version;
408     DWORD                       NumberOfStreams;
409     RVA                         StreamDirectoryRva;
410     DWORD                       CheckSum;
411     union 
412     {
413         DWORD                           Reserved;
414         DWORD                           TimeDateStamp;
415     } u;
416     ULONGLONG                   Flags;
417 } MINIDUMP_HEADER, *PMINIDUMP_HEADER;
418
419 typedef struct _MINIDUMP_MEMORY_DESCRIPTOR 
420 {
421     ULONGLONG                   StartOfMemoryRange;
422     MINIDUMP_LOCATION_DESCRIPTOR Memory;
423 } MINIDUMP_MEMORY_DESCRIPTOR, *PMINIDUMP_MEMORY_DESCRIPTOR;
424
425 typedef struct _MINIDUMP_MODULE
426 {
427     ULONGLONG                   BaseOfImage;
428     ULONG                       SizeOfImage;
429     ULONG                       CheckSum;
430     ULONG                       TimeDateStamp;
431     RVA                         ModuleNameRva;
432     VS_FIXEDFILEINFO            VersionInfo;
433     MINIDUMP_LOCATION_DESCRIPTOR CvRecord;
434     MINIDUMP_LOCATION_DESCRIPTOR MiscRecord;
435     ULONGLONG                   Reserved0;
436     ULONGLONG                   Reserved1;
437 } MINIDUMP_MODULE, *PMINIDUMP_MODULE;
438
439 typedef struct _MINIDUMP_MODULE_LIST 
440 {
441     ULONG                       NumberOfModules;
442     MINIDUMP_MODULE             Modules[1]; /* FIXME: 0-sized array not supported */
443 } MINIDUMP_MODULE_LIST, *PMINIDUMP_MODULE_LIST;
444
445 typedef struct _MINIDUMP_USER_STREAM
446 {
447     ULONG                       Type;
448     ULONG                       BufferSize;
449     void*                       Buffer;
450 } MINIDUMP_USER_STREAM, *PMINIDUMP_USER_STREAM;
451
452 typedef struct _MINIDUMP_USER_STREAM_INFORMATION
453 {
454     ULONG                       UserStreamCount;
455     PMINIDUMP_USER_STREAM       UserStreamArray;
456 } MINIDUMP_USER_STREAM_INFORMATION, *PMINIDUMP_USER_STREAM_INFORMATION;
457
458 typedef enum _MINIDUMP_STREAM_TYPE
459 {
460     UnusedStream                = 0,
461     ReservedStream0             = 1,
462     ReservedStream1             = 2,
463     ThreadListStream            = 3,
464     ModuleListStream            = 4,
465     MemoryListStream            = 5,
466     ExceptionStream             = 6,
467     SystemInfoStream            = 7,
468     ThreadExListStream          = 8,
469     Memory64ListStream          = 9,
470     CommentStreamA              = 10,
471     CommentStreamW              = 11,
472     HandleDataStream            = 12,
473     FunctionTableStream         = 13,
474
475     LastReservedStream          = 0xffff
476 } MINIDUMP_STREAM_TYPE;
477
478 typedef struct _MINIDUMP_SYSTEM_INFO
479 {
480     USHORT                      ProcessorArchitecture;
481     USHORT                      ProcessorLevel;
482     USHORT                      ProcessorRevision;
483     USHORT                      Reserved0;
484
485     ULONG                       MajorVersion;
486     ULONG                       MinorVersion;
487     ULONG                       BuildNumber;
488     ULONG                       PlatformId;
489
490     RVA                         CSDVersionRva;
491     ULONG                       Reserved1;
492     union _CPU_INFORMATION 
493     {
494         struct 
495         {
496             ULONG                       VendorId[3];
497             ULONG                       VersionInformation;
498             ULONG                       FeatureInformation;
499             ULONG                       AMDExtendedCpuFeatures;
500         } X86CpuInfo;
501         struct 
502         {
503             ULONGLONG                   ProcessorFeatures[2];
504         } OtherCpuInfo;
505     } Cpu;
506
507 } MINIDUMP_SYSTEM_INFO, *PMINIDUMP_SYSTEM_INFO;
508
509 typedef struct _MINIDUMP_THREAD
510 {
511     ULONG                       ThreadId;
512     ULONG                       SuspendCount;
513     ULONG                       PriorityClass;
514     ULONG                       Priority;
515     ULONGLONG                   Teb;
516     MINIDUMP_MEMORY_DESCRIPTOR  Stack;
517     MINIDUMP_LOCATION_DESCRIPTOR ThreadContext;
518 } MINIDUMP_THREAD, *PMINIDUMP_THREAD;
519
520 typedef struct _MINIDUMP_THREAD_LIST
521 {
522     ULONG                       NumberOfThreads;
523     MINIDUMP_THREAD             Threads[1]; /* FIXME: no support of 0 sized array */
524 } MINIDUMP_THREAD_LIST, *PMINIDUMP_THREAD_LIST;
525
526
527 /*************************
528  *    MODULE handling    *
529  *************************/
530 typedef BOOL (CALLBACK *PENUMLOADED_MODULES_CALLBACK)(PSTR ModuleName, DWORD ModuleBase,
531                                                       ULONG ModuleSize, PVOID UserContext);
532 extern BOOL  WINAPI EnumerateLoadedModules(HANDLE hProcess,
533                                            PENUMLOADED_MODULES_CALLBACK EnumLoadedModulesCallback,
534                                            PVOID UserContext);
535 typedef BOOL (CALLBACK *PSYM_ENUMMODULES_CALLBACK)(PSTR ModuleName, DWORD BaseOfDll,
536                                                    PVOID UserContext);
537 extern BOOL  WINAPI SymEnumerateModules(HANDLE hProcess,
538                                         PSYM_ENUMMODULES_CALLBACK EnumModulesCallback,  
539                                         PVOID UserContext);
540 extern BOOL  WINAPI SymGetModuleInfo(HANDLE hProcess, DWORD dwAddr, 
541                                      PIMAGEHLP_MODULE ModuleInfo);
542 extern BOOL  WINAPI SymGetModuleInfoW(HANDLE hProcess, DWORD dwAddr,
543                                       PIMAGEHLP_MODULEW ModuleInfo);
544 extern DWORD WINAPI SymGetModuleBase(HANDLE hProcess, DWORD dwAddr);
545 extern DWORD WINAPI SymLoadModule(HANDLE hProcess, HANDLE hFile, PSTR ImageName,
546                                   PSTR ModuleName, DWORD BaseOfDll, DWORD SizeOfDll);
547 extern DWORD WINAPI SymLoadModuleEx(HANDLE hProcess, HANDLE hFile, PSTR ImageName,
548                                     PSTR ModuleName, DWORD BaseOfDll, DWORD DllSize,
549                                     PMODLOAD_DATA Data, DWORD Flags);
550 extern BOOL  WINAPI SymUnloadModule(HANDLE hProcess, DWORD BaseOfDll);
551
552 /*************************
553  *    Symbol Handling    *
554  *************************/
555
556 #define IMAGEHLP_SYMBOL_INFO_VALUEPRESENT          1
557 #define IMAGEHLP_SYMBOL_INFO_REGISTER              SYMF_REGISTER        /*  0x08 */
558 #define IMAGEHLP_SYMBOL_INFO_REGRELATIVE           SYMF_REGREL          /*  0x10 */
559 #define IMAGEHLP_SYMBOL_INFO_FRAMERELATIVE         SYMF_FRAMEREL        /*  0x20 */
560 #define IMAGEHLP_SYMBOL_INFO_PARAMETER             SYMF_PARAMETER       /*  0x40 */
561 #define IMAGEHLP_SYMBOL_INFO_LOCAL                 SYMF_LOCAL           /*  0x80 */
562 #define IMAGEHLP_SYMBOL_INFO_CONSTANT              SYMF_CONSTANT        /* 0x100 */
563 #define IMAGEHLP_SYMBOL_FUNCTION                   SYMF_FUNCTION        /* 0x800 */
564
565 typedef struct _SYMBOL_INFO
566 {
567     ULONG       SizeOfStruct;
568     ULONG       TypeIndex;
569     ULONG       Reserved[2];
570     ULONG       Reserved2;
571     ULONG       Size;
572     ULONG       ModBase;
573     ULONG       Flags;
574     ULONG       Value;
575     ULONG       Address;
576     ULONG       Register;
577     ULONG       Scope;
578     ULONG       Tag;
579     ULONG       NameLen;
580     ULONG       MaxNameLen;
581     CHAR        Name[1];
582 } SYMBOL_INFO, *PSYMBOL_INFO;
583
584 typedef enum _IMAGEHLP_SYMBOL_TYPE_INFO 
585 {
586     TI_GET_SYMTAG,
587     TI_GET_SYMNAME,
588     TI_GET_LENGTH,
589     TI_GET_TYPE,
590     TI_GET_TYPEID,
591     TI_GET_BASETYPE,
592     TI_GET_ARRAYINDEXTYPEID,
593     TI_FINDCHILDREN,
594     TI_GET_DATAKIND,
595     TI_GET_ADDRESSOFFSET,
596     TI_GET_OFFSET,
597     TI_GET_VALUE,
598     TI_GET_COUNT,
599     TI_GET_CHILDRENCOUNT,
600     TI_GET_BITPOSITION,
601     TI_GET_VIRTUALBASECLASS,
602     TI_GET_VIRTUALTABLESHAPEID,
603     TI_GET_VIRTUALBASEPOINTEROFFSET,
604     TI_GET_CLASSPARENTID,
605     TI_GET_NESTED,
606     TI_GET_SYMINDEX,
607     TI_GET_LEXICALPARENT,
608     TI_GET_ADDRESS,
609     TI_GET_THISADJUST,
610 } IMAGEHLP_SYMBOL_TYPE_INFO;
611
612 typedef struct _TI_FINDCHILDREN_PARAMS 
613 {
614     ULONG Count;
615     ULONG Start;
616     ULONG ChildId[1];
617 } TI_FINDCHILDREN_PARAMS;
618
619 BOOL WINAPI SymGetTypeInfo(HANDLE hProcess, DWORD ModBase, ULONG TypeId,
620                            IMAGEHLP_SYMBOL_TYPE_INFO GetType, PVOID);
621 typedef BOOL (CALLBACK *PSYM_ENUMERATESYMBOLS_CALLBACK)(PSYMBOL_INFO pSymInfo,
622                                                         ULONG SymbolSize, PVOID UserContext);
623 BOOL WINAPI SymEnumTypes(HANDLE hProcess, DWORD BaseOfDll,
624                          PSYM_ENUMERATESYMBOLS_CALLBACK EnumSymbolsCallback,
625                          PVOID UserContext);
626 BOOL WINAPI SymGetTypeFromName(HANDLE hProcess, DWORD BaseOfDll, LPSTR Name,
627                                PSYMBOL_INFO Symbol);
628 BOOL WINAPI SymEnumSymbols(HANDLE hProcess, ULONG BaseOfDll, PCSTR Mask,
629                            PSYM_ENUMERATESYMBOLS_CALLBACK EnumSymbolsCallback,
630                            PVOID UserContext);
631
632 /*************************
633  *      Source Files     *
634  *************************/
635 typedef BOOL (CALLBACK *PSYM_ENUMSOURCFILES_CALLBACK)(PSOURCEFILE pSourceFile,
636                                                       PVOID UserContext);
637
638 BOOL WINAPI SymEnumSourceFiles(HANDLE hProcess, ULONG ModBase, LPSTR Mask,
639                                PSYM_ENUMSOURCFILES_CALLBACK cbSrcFiles,
640                                PVOID UserContext);
641
642 /*************************
643  * File & image handling *
644  *************************/
645 BOOL WINAPI SymInitialize(HANDLE hProcess, PSTR UserSearchPath, BOOL fInvadeProcess);
646 BOOL WINAPI SymCleanup(HANDLE hProcess);
647
648 HANDLE WINAPI FindDebugInfoFile(PSTR FileName, PSTR SymbolPath, PSTR DebugFilePath);
649 typedef BOOL (CALLBACK *PFIND_DEBUG_FILE_CALLBACK)(HANDLE FileHandle, PSTR FileName,
650                                                    PVOID CallerData);
651 HANDLE WINAPI FindDebugInfoFileEx(PSTR FileName, PSTR SymbolPath, PSTR DebugFilePath,
652                                   PFIND_DEBUG_FILE_CALLBACK Callback, PVOID CallerData);
653 typedef BOOL (CALLBACK *PFINDFILEINPATHCALLBACK)(PSTR filename, PVOID context);
654
655 BOOL WINAPI SymFindFileInPath(HANDLE hProcess, LPSTR searchPath, LPSTR FileName,
656                               PVOID id, DWORD two, DWORD three, DWORD flags,
657                               LPSTR FilePath, PFINDFILEINPATHCALLBACK callback,
658                               PVOID context);
659 HANDLE WINAPI FindExecutableImage(PSTR FileName, PSTR SymbolPath, PSTR ImageFilePath);
660 typedef BOOL (CALLBACK *PFIND_EXE_FILE_CALLBACK)(HANDLE FileHandle, PSTR FileName,
661                                                  PVOID CallerData);
662 HANDLE WINAPI FindExecutableImageEx(PSTR FileName, PSTR SymbolPath, PSTR ImageFilePath,
663                                     PFIND_EXE_FILE_CALLBACK Callback, PVOID CallerData);
664 PIMAGE_NT_HEADERS WINAPI ImageNtHeader(PVOID Base);
665
666 PVOID WINAPI ImageDirectoryEntryToDataEx(PVOID Base, BOOLEAN MappedAsImage,
667                                          USHORT DirectoryEntry, PULONG Size,
668                                          PIMAGE_SECTION_HEADER *FoundHeader);
669 PVOID WINAPI ImageDirectoryEntryToData(PVOID Base, BOOLEAN MappedAsImage,
670                                        USHORT DirectoryEntry, PULONG Size);
671 PIMAGE_SECTION_HEADER WINAPI ImageRvaToSection(PIMAGE_NT_HEADERS NtHeaders,
672                                                PVOID Base, ULONG Rva);
673 PVOID WINAPI ImageRvaToVa(PIMAGE_NT_HEADERS NtHeaders, PVOID Base,
674                           ULONG Rva, OUT PIMAGE_SECTION_HEADER *LastRvaSection);
675
676 /*************************
677  *   Context management  *
678  *************************/
679 BOOL WINAPI SymSetContext(HANDLE hProcess, PIMAGEHLP_STACK_FRAME StackFrame,
680                           PIMAGEHLP_CONTEXT Context);
681
682
683 #ifdef __cplusplus
684 } /* extern "C" */
685 #endif /* defined(__cplusplus) */
686
687 #endif  /* __WINE_DBGHELP_H */