Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Use ucontext_t instead of void* in some places
[simgrid.git] / src / include / xbt / wine_dbghelp.h
1 /* Copyright (c) 2008-2010, 2014. The SimGrid Team.
2  * All rights reserved.                                                     */
3
4 /* This program is free software; you can redistribute it and/or modify it
5  * under the terms of the license (GNU LGPL) which comes with this package. */
6
7 /*
8  * Declarations for DBGHELP
9  *
10  * Copyright (C) 2003 Eric Pouech
11  *
12  * This library is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU Lesser General Public
14  * License as published by the Free Software Foundation; either
15  * version 2.1 of the License, or (at your option) any later version.
16  *
17  * This library is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
20  * Lesser General Public License for more details.
21  *
22  * You should have received a copy of the GNU Lesser General Public
23  * License along with this library; if not, write to the Free Software
24  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
25  * 
26  * We need this file in SimGrid when cross-compiling with gcc for the windows target.
27  */
28
29 #ifndef __WINE_DBGHELP_H
30 #define __WINE_DBGHELP_H
31
32 #ifdef __cplusplus
33 extern "C" {
34 #endif                          /* defined(__cplusplus) */
35
36 #define IMAGEAPI WINAPI
37 #define DBHLPAPI IMAGEAPI
38
39   typedef struct _LOADED_IMAGE {
40     PSTR ModuleName;
41     HANDLE hFile;
42     PUCHAR MappedAddress;
43     PIMAGE_NT_HEADERS FileHeader;
44     PIMAGE_SECTION_HEADER LastRvaSection;
45     ULONG NumberOfSections;
46     PIMAGE_SECTION_HEADER Sections;
47     ULONG Characteristics;
48     BOOLEAN fSystemImage;
49     BOOLEAN fDOSImage;
50     BOOLEAN fReadOnly;
51     UCHAR Version;
52     LIST_ENTRY Links;
53     ULONG SizeOfImage;
54   } LOADED_IMAGE, *PLOADED_IMAGE;
55
56 /*************************
57  *    IMAGEHLP equiv     *
58  *************************/
59
60   typedef enum {
61     AddrMode1616,
62     AddrMode1632,
63     AddrModeReal,
64     AddrModeFlat
65   } ADDRESS_MODE;
66
67   typedef struct _tagADDRESS {
68     DWORD Offset;
69     WORD Segment;
70     ADDRESS_MODE Mode;
71   } ADDRESS, *LPADDRESS;
72
73   typedef struct _tagADDRESS64 {
74     DWORD64 Offset;
75     WORD Segment;
76     ADDRESS_MODE Mode;
77   } ADDRESS64, *LPADDRESS64;
78
79 #define SYMF_OMAP_GENERATED   0x00000001
80 #define SYMF_OMAP_MODIFIED    0x00000002
81 #define SYMF_USER_GENERATED   0x00000004
82 #define SYMF_REGISTER         0x00000008
83 #define SYMF_REGREL           0x00000010
84 #define SYMF_FRAMEREL         0x00000020
85 #define SYMF_PARAMETER        0x00000040
86 #define SYMF_LOCAL            0x00000080
87 #define SYMF_CONSTANT         0x00000100
88 #define SYMF_EXPORT           0x00000200
89 #define SYMF_FORWARDER        0x00000400
90 #define SYMF_FUNCTION         0x00000800
91 #define SYMF_VIRTUAL          0x00001000
92 #define SYMF_THUNK            0x00002000
93 #define SYMF_TLSREL           0x00004000
94
95   typedef enum {
96     SymNone = 0,
97     SymCoff,
98     SymCv,
99     SymPdb,
100     SymExport,
101     SymDeferred,
102     SymSym,
103     SymDia,
104     SymVirtual,
105     NumSymTypes
106   } SYM_TYPE;
107
108   typedef struct _IMAGEHLP_SYMBOL {
109     DWORD SizeOfStruct;
110     DWORD Address;
111     DWORD Size;
112     DWORD Flags;
113     DWORD MaxNameLength;
114     CHAR Name[1];
115   } IMAGEHLP_SYMBOL, *PIMAGEHLP_SYMBOL;
116
117   typedef struct _IMAGEHLP_SYMBOL64 {
118     DWORD SizeOfStruct;
119     DWORD64 Address;
120     DWORD Size;
121     DWORD Flags;
122     DWORD MaxNameLength;
123     CHAR Name[1];
124   } IMAGEHLP_SYMBOL64, *PIMAGEHLP_SYMBOL64;
125
126   typedef struct _IMAGEHLP_SYMBOLW64 {
127     DWORD SizeOfStruct;
128     DWORD64 Address;
129     DWORD Size;
130     DWORD Flags;
131     DWORD MaxNameLength;
132     WCHAR Name[1];
133   } IMAGEHLP_SYMBOLW64, *PIMAGEHLP_SYMBOLW64;
134
135   typedef struct _IMAGEHLP_MODULE {
136     DWORD SizeOfStruct;
137     DWORD BaseOfImage;
138     DWORD ImageSize;
139     DWORD TimeDateStamp;
140     DWORD CheckSum;
141     DWORD NumSyms;
142     SYM_TYPE SymType;
143     CHAR ModuleName[32];
144     CHAR ImageName[256];
145     CHAR LoadedImageName[256];
146   } IMAGEHLP_MODULE, *PIMAGEHLP_MODULE;
147
148   typedef struct _IMAGEHLP_MODULEW {
149     DWORD SizeOfStruct;
150     DWORD BaseOfImage;
151     DWORD ImageSize;
152     DWORD TimeDateStamp;
153     DWORD CheckSum;
154     DWORD NumSyms;
155     SYM_TYPE SymType;
156     WCHAR ModuleName[32];
157     WCHAR ImageName[256];
158     WCHAR LoadedImageName[256];
159   } IMAGEHLP_MODULEW, *PIMAGEHLP_MODULEW;
160
161   typedef struct _IMAGEHLP_MODULE64 {
162     DWORD SizeOfStruct;
163     DWORD64 BaseOfImage;
164     DWORD ImageSize;
165     DWORD TimeDateStamp;
166     DWORD CheckSum;
167     DWORD NumSyms;
168     SYM_TYPE SymType;
169     CHAR ModuleName[32];
170     CHAR ImageName[256];
171     CHAR LoadedImageName[256];
172     CHAR LoadedPdbName[256];
173     DWORD CVSig;
174     CHAR CVData[MAX_PATH * 3];
175     DWORD PdbSig;
176     GUID PdbSig70;
177     DWORD PdbAge;
178     BOOL PdbUnmatched;
179     BOOL DbgUnmatched;
180     BOOL LineNumbers;
181     BOOL GlobalSymbols;
182     BOOL TypeInfo;
183     BOOL SourceIndexed;
184     BOOL Publics;
185   } IMAGEHLP_MODULE64, *PIMAGEHLP_MODULE64;
186
187   typedef struct _IMAGEHLP_MODULEW64 {
188     DWORD SizeOfStruct;
189     DWORD64 BaseOfImage;
190     DWORD ImageSize;
191     DWORD TimeDateStamp;
192     DWORD CheckSum;
193     DWORD NumSyms;
194     SYM_TYPE SymType;
195     WCHAR ModuleName[32];
196     WCHAR ImageName[256];
197     WCHAR LoadedImageName[256];
198     WCHAR LoadedPdbName[256];
199     DWORD CVSig;
200     WCHAR CVData[MAX_PATH * 3];
201     DWORD PdbSig;
202     GUID PdbSig70;
203     DWORD PdbAge;
204     BOOL PdbUnmatched;
205     BOOL DbgUnmatched;
206     BOOL LineNumbers;
207     BOOL GlobalSymbols;
208     BOOL TypeInfo;
209     BOOL SourceIndexed;
210     BOOL Publics;
211   } IMAGEHLP_MODULEW64, *PIMAGEHLP_MODULEW64;
212
213   typedef struct _IMAGEHLP_LINE {
214     DWORD SizeOfStruct;
215     PVOID Key;
216     DWORD LineNumber;
217     PCHAR FileName;
218     DWORD Address;
219   } IMAGEHLP_LINE, *PIMAGEHLP_LINE;
220
221   typedef struct _IMAGEHLP_LINEW {
222     DWORD SizeOfStruct;
223     PVOID Key;
224     DWORD LineNumber;
225     PWSTR FileName;
226     DWORD Address;
227   } IMAGEHLP_LINEW, *PIMAGEHLP_LINEW;
228
229   typedef struct _IMAGEHLP_LINE64 {
230     DWORD SizeOfStruct;
231     PVOID Key;
232     DWORD LineNumber;
233     PCHAR FileName;
234     DWORD64 Address;
235   } IMAGEHLP_LINE64, *PIMAGEHLP_LINE64;
236
237   typedef struct _IMAGEHLP_LINEW64 {
238     DWORD SizeOfStruct;
239     PVOID Key;
240     DWORD LineNumber;
241     PWSTR FileName;
242     DWORD64 Address;
243   } IMAGEHLP_LINEW64, *PIMAGEHLP_LINEW64;
244
245   typedef struct _SOURCEFILE {
246     DWORD64 ModBase;
247     PCHAR FileName;
248   } SOURCEFILE, *PSOURCEFILE;
249
250   typedef struct _SOURCEFILEW {
251     DWORD64 ModBase;
252     PWSTR FileName;
253   } SOURCEFILEW, *PSOURCEFILEW;
254
255 #define CBA_DEFERRED_SYMBOL_LOAD_START          0x00000001
256 #define CBA_DEFERRED_SYMBOL_LOAD_COMPLETE       0x00000002
257 #define CBA_DEFERRED_SYMBOL_LOAD_FAILURE        0x00000003
258 #define CBA_SYMBOLS_UNLOADED                    0x00000004
259 #define CBA_DUPLICATE_SYMBOL                    0x00000005
260 #define CBA_READ_MEMORY                         0x00000006
261 #define CBA_DEFERRED_SYMBOL_LOAD_CANCEL         0x00000007
262 #define CBA_SET_OPTIONS                         0x00000008
263 #define CBA_EVENT                               0x00000010
264 #define CBA_DEFERRED_SYMBOL_LOAD_PARTIAL        0x00000020
265 #define CBA_DEBUG_INFO                          0x10000000
266
267   typedef struct _IMAGEHLP_CBA_READ_MEMORY {
268     DWORD64 addr;
269     PVOID buf;
270     DWORD bytes;
271     DWORD *bytesread;
272   } IMAGEHLP_CBA_READ_MEMORY, *PIMAGEHLP_CBA_READ_MEMORY;
273
274   enum {
275     sevInfo = 0,
276     sevProblem,
277     sevAttn,
278     sevFatal,
279     sevMax
280   };
281
282 #define EVENT_SRCSPEW_START 100
283 #define EVENT_SRCSPEW       100
284 #define EVENT_SRCSPEW_END   199
285
286   typedef struct _IMAGEHLP_CBA_EVENT {
287     DWORD severity;
288     DWORD code;
289     PCHAR desc;
290     PVOID object;
291   } IMAGEHLP_CBA_EVENT, *PIMAGEHLP_CBA_EVENT;
292
293   typedef struct _IMAGEHLP_DEFERRED_SYMBOL_LOAD {
294     DWORD SizeOfStruct;
295     DWORD BaseOfImage;
296     DWORD CheckSum;
297     DWORD TimeDateStamp;
298     CHAR FileName[MAX_PATH];
299     BOOLEAN Reparse;
300     HANDLE hFile;
301   } IMAGEHLP_DEFERRED_SYMBOL_LOAD, *PIMAGEHLP_DEFERRED_SYMBOL_LOAD;
302
303   typedef struct _IMAGEHLP_DEFERRED_SYMBOL_LOAD64 {
304     DWORD SizeOfStruct;
305     DWORD64 BaseOfImage;
306     DWORD CheckSum;
307     DWORD TimeDateStamp;
308     CHAR FileName[MAX_PATH];
309     BOOLEAN Reparse;
310     HANDLE hFile;
311     DWORD Flags;
312   } IMAGEHLP_DEFERRED_SYMBOL_LOAD64, *PIMAGEHLP_DEFERRED_SYMBOL_LOAD64;
313
314   typedef struct _IMAGEHLP_DEFERRED_SYMBOL_LOADW64 {
315     DWORD SizeOfStruct;
316     DWORD64 BaseOfImage;
317     DWORD CheckSum;
318     DWORD TimeDateStamp;
319     WCHAR FileName[MAX_PATH + 1];
320     BOOLEAN Reparse;
321     HANDLE hFile;
322     DWORD Flags;
323   } IMAGEHLP_DEFERRED_SYMBOL_LOADW64, *PIMAGEHLP_DEFERRED_SYMBOL_LOADW64;
324
325   typedef struct _IMAGEHLP_DUPLICATE_SYMBOL {
326     DWORD SizeOfStruct;
327     DWORD NumberOfDups;
328     PIMAGEHLP_SYMBOL Symbol;
329     DWORD SelectedSymbol;
330   } IMAGEHLP_DUPLICATE_SYMBOL, *PIMAGEHLP_DUPLICATE_SYMBOL;
331
332   typedef struct _IMAGEHLP_DUPLICATE_SYMBOL64 {
333     DWORD SizeOfStruct;
334     DWORD NumberOfDups;
335     PIMAGEHLP_SYMBOL64 Symbol;
336     DWORD SelectedSymbol;
337   } IMAGEHLP_DUPLICATE_SYMBOL64, *PIMAGEHLP_DUPLICATE_SYMBOL64;
338
339 #define SYMOPT_CASE_INSENSITIVE         0x00000001
340 #define SYMOPT_UNDNAME                  0x00000002
341 #define SYMOPT_DEFERRED_LOADS           0x00000004
342 #define SYMOPT_NO_CPP                   0x00000008
343 #define SYMOPT_LOAD_LINES               0x00000010
344 #define SYMOPT_OMAP_FIND_NEAREST        0x00000020
345 #define SYMOPT_LOAD_ANYTHING            0x00000040
346 #define SYMOPT_IGNORE_CVREC             0x00000080
347 #define SYMOPT_NO_UNQUALIFIED_LOADS     0x00000100
348 #define SYMOPT_FAIL_CRITICAL_ERRORS     0x00000200
349 #define SYMOPT_EXACT_SYMBOLS            0x00000400
350 #define SYMOPT_WILD_UNDERSCORE          0x00000800
351 #define SYMOPT_USE_DEFAULTS             0x00001000
352 /* latest SDK defines:
353 #define SYMOPT_ALLOW_ABSOLUTE_SYMBOLS   0x00000800
354 #define SYMOPT_IGNORE_NT_SYMPATH        0x00001000
355 */
356 #define SYMOPT_INCLUDE_32BIT_MODULES    0x00002000
357 #define SYMOPT_PUBLICS_ONLY             0x00004000
358 #define SYMOPT_NO_PUBLICS               0x00008000
359 #define SYMOPT_AUTO_PUBLICS             0x00010000
360 #define SYMOPT_NO_IMAGE_SEARCH          0x00020000
361 #define SYMOPT_SECURE                   0x00040000
362 #define SYMOPT_NO_PROMPTS               0x00080000
363 #define SYMOPT_OVERWRITE                0x00100000
364 #define SYMOPT_IGNORE_IMAGEDIR          0x00200000
365
366 #define SYMOPT_DEBUG                    0x80000000
367
368   typedef struct _IMAGEHLP_STACK_FRAME {
369     ULONG64 InstructionOffset;
370     ULONG64 ReturnOffset;
371     ULONG64 FrameOffset;
372     ULONG64 StackOffset;
373     ULONG64 BackingStoreOffset;
374     ULONG64 FuncTableEntry;
375     ULONG64 Params[4];
376     ULONG64 Reserved[5];
377     BOOL Virtual;
378     ULONG Reserved2;
379   } IMAGEHLP_STACK_FRAME, *PIMAGEHLP_STACK_FRAME;
380
381   typedef VOID IMAGEHLP_CONTEXT, *PIMAGEHLP_CONTEXT;
382
383 #define DBHHEADER_DEBUGDIRS     0x1
384   typedef struct _DBGHELP_MODLOAD_DATA {
385     DWORD ssize;
386     DWORD ssig;
387     PVOID data;
388     DWORD size;
389     DWORD flags;
390   } MODLOAD_DATA, *PMODLOAD_DATA;
391
392 /*************************
393  *       MiniDUMP        *
394  *************************/
395
396 #include <pshpack4.h>
397 /* DebugHelp */
398
399 #define MINIDUMP_SIGNATURE 0x504D444D   /* 'MDMP' */
400 #define MINIDUMP_VERSION   (42899)
401
402   typedef DWORD RVA;
403   typedef ULONG64 RVA64;
404
405   typedef enum _MINIDUMP_TYPE {
406     MiniDumpNormal = 0x0000,
407     MiniDumpWithDataSegs = 0x0001,
408     MiniDumpWithFullMemory = 0x0002,
409     MiniDumpWithHandleData = 0x0004,
410     MiniDumpFilterMemory = 0x0008,
411     MiniDumpScanMemory = 0x0010,
412     MiniDumpWithUnloadedModules = 0x0020,
413     MiniDumpWithIndirectlyReferencedMemory = 0x0040,
414     MiniDumpFilterModulePaths = 0x0080,
415     MiniDumpWithProcessThreadData = 0x0100,
416     MiniDumpWithPrivateReadWriteMemory = 0x0200,
417     MiniDumpWithoutOptionalData = 0x0400,
418     MiniDumpWithFullMemoryInfo = 0x0800,
419     MiniDumpWithThreadInfo = 0x1000,
420     MiniDumpWithCodeSegs = 0x2000
421   } MINIDUMP_TYPE;
422
423   typedef enum _MINIDUMP_CALLBACK_TYPE {
424     ModuleCallback,
425     ThreadCallback,
426     ThreadExCallback,
427     IncludeThreadCallback,
428     IncludeModuleCallback,
429     MemoryCallback,
430   } MINIDUMP_CALLBACK_TYPE;
431
432   typedef struct _MINIDUMP_THREAD_CALLBACK {
433     ULONG ThreadId;
434     HANDLE ThreadHandle;
435     CONTEXT Context;
436     ULONG SizeOfContext;
437     ULONG64 StackBase;
438     ULONG64 StackEnd;
439   } MINIDUMP_THREAD_CALLBACK, *PMINIDUMP_THREAD_CALLBACK;
440
441   typedef struct _MINIDUMP_THREAD_EX_CALLBACK {
442     ULONG ThreadId;
443     HANDLE ThreadHandle;
444     CONTEXT Context;
445     ULONG SizeOfContext;
446     ULONG64 StackBase;
447     ULONG64 StackEnd;
448     ULONG64 BackingStoreBase;
449     ULONG64 BackingStoreEnd;
450   } MINIDUMP_THREAD_EX_CALLBACK, *PMINIDUMP_THREAD_EX_CALLBACK;
451
452   typedef struct _MINIDUMP_INCLUDE_THREAD_CALLBACK {
453     ULONG ThreadId;
454   } MINIDUMP_INCLUDE_THREAD_CALLBACK, *PMINIDUMP_INCLUDE_THREAD_CALLBACK;
455
456   typedef enum _THREAD_WRITE_FLAGS {
457     ThreadWriteThread = 0x0001,
458     ThreadWriteStack = 0x0002,
459     ThreadWriteContext = 0x0004,
460     ThreadWriteBackingStore = 0x0008,
461     ThreadWriteInstructionWindow = 0x0010,
462     ThreadWriteThreadData = 0x0020,
463     ThreadWriteThreadInfo = 0x0040
464   } THREAD_WRITE_FLAGS;
465
466   typedef struct _MINIDUMP_MODULE_CALLBACK {
467     PWCHAR FullPath;
468     ULONG64 BaseOfImage;
469     ULONG SizeOfImage;
470     ULONG CheckSum;
471     ULONG TimeDateStamp;
472     VS_FIXEDFILEINFO VersionInfo;
473     PVOID CvRecord;
474     ULONG SizeOfCvRecord;
475     PVOID MiscRecord;
476     ULONG SizeOfMiscRecord;
477   } MINIDUMP_MODULE_CALLBACK, *PMINIDUMP_MODULE_CALLBACK;
478
479   typedef struct _MINIDUMP_INCLUDE_MODULE_CALLBACK {
480     ULONG64 BaseOfImage;
481   } MINIDUMP_INCLUDE_MODULE_CALLBACK, *PMINIDUMP_INCLUDE_MODULE_CALLBACK;
482
483   typedef enum _MODULE_WRITE_FLAGS {
484     ModuleWriteModule = 0x0001,
485     ModuleWriteDataSeg = 0x0002,
486     ModuleWriteMiscRecord = 0x0004,
487     ModuleWriteCvRecord = 0x0008,
488     ModuleReferencedByMemory = 0x0010,
489     ModuleWriteTlsData = 0x0020,
490     ModuleWriteCodeSegs = 0x0040,
491   } MODULE_WRITE_FLAGS;
492
493   typedef struct _MINIDUMP_CALLBACK_INPUT {
494     ULONG ProcessId;
495     HANDLE ProcessHandle;
496     ULONG CallbackType;
497     union {
498       MINIDUMP_THREAD_CALLBACK Thread;
499       MINIDUMP_THREAD_EX_CALLBACK ThreadEx;
500       MINIDUMP_MODULE_CALLBACK Module;
501       MINIDUMP_INCLUDE_THREAD_CALLBACK IncludeThread;
502       MINIDUMP_INCLUDE_MODULE_CALLBACK IncludeModule;
503     } DUMMYUNIONNAME;
504   } MINIDUMP_CALLBACK_INPUT, *PMINIDUMP_CALLBACK_INPUT;
505
506   typedef struct _MINIDUMP_CALLBACK_OUTPUT {
507     union {
508       ULONG ModuleWriteFlags;
509       ULONG ThreadWriteFlags;
510       struct {
511         ULONG64 MemoryBase;
512         ULONG MemorySize;
513       } DUMMYSTRUCTNAME;
514     } DUMMYUNIONNAME;
515   } MINIDUMP_CALLBACK_OUTPUT, *PMINIDUMP_CALLBACK_OUTPUT;
516
517   typedef BOOL(WINAPI * MINIDUMP_CALLBACK_ROUTINE) (PVOID,
518                                                     const
519                                                     PMINIDUMP_CALLBACK_INPUT,
520                                                     PMINIDUMP_CALLBACK_OUTPUT);
521
522   typedef struct _MINIDUMP_CALLBACK_INFORMATION {
523     MINIDUMP_CALLBACK_ROUTINE CallbackRoutine;
524     void *CallbackParam;
525   } MINIDUMP_CALLBACK_INFORMATION, *PMINIDUMP_CALLBACK_INFORMATION;
526
527   typedef struct _MINIDUMP_LOCATION_DESCRIPTOR {
528     ULONG DataSize;
529     RVA Rva;
530   } MINIDUMP_LOCATION_DESCRIPTOR;
531
532   typedef struct _MINIDUMP_LOCATION_DESCRIPTOR64 {
533     ULONG64 DataSize;
534     RVA64 Rva;
535   } MINIDUMP_LOCATION_DESCRIPTOR64;
536
537   typedef struct _MINIDUMP_DIRECTORY {
538     ULONG StreamType;
539     MINIDUMP_LOCATION_DESCRIPTOR Location;
540   } MINIDUMP_DIRECTORY, *PMINIDUMP_DIRECTORY;
541
542   typedef struct _MINIDUMP_EXCEPTION {
543     ULONG ExceptionCode;
544     ULONG ExceptionFlags;
545     ULONG64 ExceptionRecord;
546     ULONG64 ExceptionAddress;
547     ULONG NumberParameters;
548     ULONG __unusedAlignment;
549     ULONG64 ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS];
550   } MINIDUMP_EXCEPTION, *PMINIDUMP_EXCEPTION;
551
552   typedef struct _MINIDUMP_EXCEPTION_INFORMATION {
553     DWORD ThreadId;
554     PEXCEPTION_POINTERS ExceptionPointers;
555     BOOL ClientPointers;
556   } MINIDUMP_EXCEPTION_INFORMATION, *PMINIDUMP_EXCEPTION_INFORMATION;
557
558   typedef struct MINIDUMP_EXCEPTION_STREAM {
559     ULONG ThreadId;
560     ULONG __alignment;
561     MINIDUMP_EXCEPTION ExceptionRecord;
562     MINIDUMP_LOCATION_DESCRIPTOR ThreadContext;
563   } MINIDUMP_EXCEPTION_STREAM, *PMINIDUMP_EXCEPTION_STREAM;
564
565   typedef struct _MINIDUMP_HEADER {
566     DWORD Signature;
567     DWORD Version;
568     DWORD NumberOfStreams;
569     RVA StreamDirectoryRva;
570     DWORD CheckSum;
571     union {
572       DWORD Reserved;
573       DWORD TimeDateStamp;
574     } DUMMYUNIONNAME;
575     ULONG64 Flags;
576   } MINIDUMP_HEADER, *PMINIDUMP_HEADER;
577
578   typedef struct _MINIDUMP_MEMORY_DESCRIPTOR {
579     ULONG64 StartOfMemoryRange;
580     MINIDUMP_LOCATION_DESCRIPTOR Memory;
581   } MINIDUMP_MEMORY_DESCRIPTOR, *PMINIDUMP_MEMORY_DESCRIPTOR;
582
583   typedef struct _MINIDUMP_MEMORY_LIST {
584     ULONG NumberOfMemoryRanges;
585     MINIDUMP_MEMORY_DESCRIPTOR MemoryRanges[1]; /* FIXME: 0-sized array not supported */
586   } MINIDUMP_MEMORY_LIST, *PMINIDUMP_MEMORY_LIST;
587
588 #define MINIDUMP_MISC1_PROCESS_ID       0x00000001
589 #define MINIDUMP_MISC1_PROCESS_TIMES    0x00000002
590
591   typedef struct _MINIDUMP_MISC_INFO {
592     ULONG SizeOfInfo;
593     ULONG Flags1;
594     ULONG ProcessId;
595     ULONG ProcessCreateTime;
596     ULONG ProcessUserTime;
597     ULONG ProcessKernelTime;
598   } MINIDUMP_MISC_INFO, *PMINIDUMP_MISC_INFO;
599
600   typedef struct _MINIDUMP_MODULE {
601     ULONG64 BaseOfImage;
602     ULONG SizeOfImage;
603     ULONG CheckSum;
604     ULONG TimeDateStamp;
605     RVA ModuleNameRva;
606     VS_FIXEDFILEINFO VersionInfo;
607     MINIDUMP_LOCATION_DESCRIPTOR CvRecord;
608     MINIDUMP_LOCATION_DESCRIPTOR MiscRecord;
609     ULONG64 Reserved0;
610     ULONG64 Reserved1;
611   } MINIDUMP_MODULE, *PMINIDUMP_MODULE;
612
613   typedef struct _MINIDUMP_MODULE_LIST {
614     ULONG NumberOfModules;
615     MINIDUMP_MODULE Modules[1]; /* FIXME: 0-sized array not supported */
616   } MINIDUMP_MODULE_LIST, *PMINIDUMP_MODULE_LIST;
617
618   typedef struct _MINIDUMP_STRING {
619     ULONG Length;
620     WCHAR Buffer[1];            /* FIXME: O-sized array not supported */
621   } MINIDUMP_STRING, *PMINIDUMP_STRING;
622
623   typedef struct _MINIDUMP_SYSTEM_INFO {
624     USHORT ProcessorArchitecture;
625     USHORT ProcessorLevel;
626     USHORT ProcessorRevision;
627     union {
628       USHORT Reserved0;
629       struct {
630         UCHAR NumberOfProcessors;
631         UCHAR ProductType;
632       } DUMMYSTRUCTNAME;
633     } DUMMYUNIONNAME;
634
635     ULONG MajorVersion;
636     ULONG MinorVersion;
637     ULONG BuildNumber;
638     ULONG PlatformId;
639
640     RVA CSDVersionRva;
641     union {
642       ULONG Reserved1;
643       struct {
644         USHORT SuiteMask;
645         USHORT Reserved2;
646       } DUMMYSTRUCTNAME;
647     } DUMMYUNIONNAME1;
648     union _CPU_INFORMATION {
649       struct {
650         ULONG VendorId[3];
651         ULONG VersionInformation;
652         ULONG FeatureInformation;
653         ULONG AMDExtendedCpuFeatures;
654       } X86CpuInfo;
655       struct {
656         ULONG64 ProcessorFeatures[2];
657       } OtherCpuInfo;
658     } Cpu;
659
660   } MINIDUMP_SYSTEM_INFO, *PMINIDUMP_SYSTEM_INFO;
661
662   typedef struct _MINIDUMP_THREAD {
663     ULONG ThreadId;
664     ULONG SuspendCount;
665     ULONG PriorityClass;
666     ULONG Priority;
667     ULONG64 Teb;
668     MINIDUMP_MEMORY_DESCRIPTOR Stack;
669     MINIDUMP_LOCATION_DESCRIPTOR ThreadContext;
670   } MINIDUMP_THREAD, *PMINIDUMP_THREAD;
671
672   typedef struct _MINIDUMP_THREAD_LIST {
673     ULONG NumberOfThreads;
674     MINIDUMP_THREAD Threads[1]; /* FIXME: no support of 0 sized array */
675   } MINIDUMP_THREAD_LIST, *PMINIDUMP_THREAD_LIST;
676
677   typedef struct _MINIDUMP_USER_STREAM {
678     ULONG Type;
679     ULONG BufferSize;
680     void *Buffer;
681   } MINIDUMP_USER_STREAM, *PMINIDUMP_USER_STREAM;
682
683   typedef struct _MINIDUMP_USER_STREAM_INFORMATION {
684     ULONG UserStreamCount;
685     PMINIDUMP_USER_STREAM UserStreamArray;
686   } MINIDUMP_USER_STREAM_INFORMATION, *PMINIDUMP_USER_STREAM_INFORMATION;
687
688   typedef enum _MINIDUMP_STREAM_TYPE {
689     UnusedStream = 0,
690     ReservedStream0 = 1,
691     ReservedStream1 = 2,
692     ThreadListStream = 3,
693     ModuleListStream = 4,
694     MemoryListStream = 5,
695     ExceptionStream = 6,
696     SystemInfoStream = 7,
697     ThreadExListStream = 8,
698     Memory64ListStream = 9,
699     CommentStreamA = 10,
700     CommentStreamW = 11,
701     HandleDataStream = 12,
702     FunctionTableStream = 13,
703     UnloadedModuleListStream = 14,
704     MiscInfoStream = 15,
705     MemoryInfoListStream = 16,
706     ThreadInfoListStream = 17,
707
708     LastReservedStream = 0xffff
709   } MINIDUMP_STREAM_TYPE;
710
711   BOOL WINAPI MiniDumpWriteDump(HANDLE, DWORD, HANDLE, MINIDUMP_TYPE,
712                                 const PMINIDUMP_EXCEPTION_INFORMATION,
713                                 const PMINIDUMP_USER_STREAM_INFORMATION,
714                                 const PMINIDUMP_CALLBACK_INFORMATION);
715   BOOL WINAPI MiniDumpReadDumpStream(PVOID, ULONG, PMINIDUMP_DIRECTORY *,
716                                      PVOID *, ULONG *);
717
718 #include <poppack.h>
719
720 /*************************
721  *    MODULE handling    *
722  *************************/
723
724 /* flags for SymLoadModuleEx */
725 #define SLMFLAG_VIRTUAL         0x1
726 #define SLMFLAG_NO_SYMBOLS      0x4
727
728   typedef BOOL(CALLBACK * PENUMLOADED_MODULES_CALLBACK) (PSTR, ULONG,
729                                                          ULONG, PVOID);
730   BOOL WINAPI EnumerateLoadedModules(HANDLE, PENUMLOADED_MODULES_CALLBACK,
731                                      PVOID);
732   typedef BOOL(CALLBACK * PENUMLOADED_MODULES_CALLBACK64) (PCSTR, DWORD64,
733                                                            ULONG, PVOID);
734   BOOL WINAPI EnumerateLoadedModules64(HANDLE,
735                                        PENUMLOADED_MODULES_CALLBACK64,
736                                        PVOID);
737   typedef BOOL(CALLBACK * PENUMLOADED_MODULES_CALLBACKW64) (PCWSTR,
738                                                             DWORD64, ULONG,
739                                                             PVOID);
740   BOOL WINAPI EnumerateLoadedModulesW64(HANDLE,
741                                         PENUMLOADED_MODULES_CALLBACKW64,
742                                         PVOID);
743   typedef BOOL(CALLBACK * PSYM_ENUMMODULES_CALLBACK) (PCSTR, ULONG, PVOID);
744   BOOL WINAPI SymEnumerateModules(HANDLE, PSYM_ENUMMODULES_CALLBACK,
745                                   PVOID);
746   typedef BOOL(CALLBACK * PSYM_ENUMMODULES_CALLBACK64) (PCSTR, DWORD64,
747                                                         PVOID);
748   BOOL WINAPI SymEnumerateModules64(HANDLE, PSYM_ENUMMODULES_CALLBACK64,
749                                     PVOID);
750   typedef BOOL(CALLBACK * PSYM_ENUMMODULES_CALLBACKW64) (PCWSTR, DWORD64,
751                                                          PVOID);
752   BOOL WINAPI SymEnumerateModulesW64(HANDLE, PSYM_ENUMMODULES_CALLBACKW64,
753                                      PVOID);
754   BOOL WINAPI SymGetModuleInfo(HANDLE, DWORD, PIMAGEHLP_MODULE);
755   BOOL WINAPI SymGetModuleInfoW(HANDLE, DWORD, PIMAGEHLP_MODULEW);
756   BOOL WINAPI SymGetModuleInfo64(HANDLE, DWORD64, PIMAGEHLP_MODULE64);
757   BOOL WINAPI SymGetModuleInfoW64(HANDLE, DWORD64, PIMAGEHLP_MODULEW64);
758   DWORD WINAPI SymGetModuleBase(HANDLE, DWORD);
759   DWORD64 WINAPI SymGetModuleBase64(HANDLE, DWORD64);
760   DWORD WINAPI SymLoadModule(HANDLE, HANDLE, PCSTR, PCSTR, DWORD, DWORD);
761   DWORD64 WINAPI SymLoadModule64(HANDLE, HANDLE, PCSTR, PCSTR, DWORD64,
762                                  DWORD);
763   DWORD64 WINAPI SymLoadModuleEx(HANDLE, HANDLE, PCSTR, PCSTR, DWORD64,
764                                  DWORD, PMODLOAD_DATA, DWORD);
765   DWORD64 WINAPI SymLoadModuleExW(HANDLE, HANDLE, PCWSTR, PCWSTR, DWORD64,
766                                   DWORD, PMODLOAD_DATA, DWORD);
767   BOOL WINAPI SymUnloadModule(HANDLE, DWORD);
768   BOOL WINAPI SymUnloadModule64(HANDLE, DWORD64);
769
770 /*************************
771  *    Symbol Handling    *
772  *************************/
773
774 #define IMAGEHLP_SYMBOL_INFO_VALUEPRESENT          1
775 #define IMAGEHLP_SYMBOL_INFO_REGISTER              SYMF_REGISTER        /*  0x08 */
776 #define IMAGEHLP_SYMBOL_INFO_REGRELATIVE           SYMF_REGREL  /*  0x10 */
777 #define IMAGEHLP_SYMBOL_INFO_FRAMERELATIVE         SYMF_FRAMEREL        /*  0x20 */
778 #define IMAGEHLP_SYMBOL_INFO_PARAMETER             SYMF_PARAMETER       /*  0x40 */
779 #define IMAGEHLP_SYMBOL_INFO_LOCAL                 SYMF_LOCAL   /*  0x80 */
780 #define IMAGEHLP_SYMBOL_INFO_CONSTANT              SYMF_CONSTANT        /* 0x100 */
781 #define IMAGEHLP_SYMBOL_FUNCTION                   SYMF_FUNCTION        /* 0x800 */
782
783 #define SYMFLAG_VALUEPRESENT     0x00000001
784 #define SYMFLAG_REGISTER         0x00000008
785 #define SYMFLAG_REGREL           0x00000010
786 #define SYMFLAG_FRAMEREL         0x00000020
787 #define SYMFLAG_PARAMETER        0x00000040
788 #define SYMFLAG_LOCAL            0x00000080
789 #define SYMFLAG_CONSTANT         0x00000100
790 #define SYMFLAG_EXPORT           0x00000200
791 #define SYMFLAG_FORWARDER        0x00000400
792 #define SYMFLAG_FUNCTION         0x00000800
793 #define SYMFLAG_VIRTUAL          0x00001000
794 #define SYMFLAG_THUNK            0x00002000
795 #define SYMFLAG_TLSREL           0x00004000
796 #define SYMFLAG_SLOT             0x00008000
797
798 #define MAX_SYM_NAME    2000
799
800   typedef struct _SYMBOL_INFO {
801     ULONG SizeOfStruct;
802     ULONG TypeIndex;
803     ULONG64 Reserved[2];
804     ULONG info;                 /* sdk states info, while MSDN says it's Index... */
805     ULONG Size;
806     ULONG64 ModBase;
807     ULONG Flags;
808     ULONG64 Value;
809     ULONG64 Address;
810     ULONG Register;
811     ULONG Scope;
812     ULONG Tag;
813     ULONG NameLen;
814     ULONG MaxNameLen;
815     CHAR Name[1];
816   } SYMBOL_INFO, *PSYMBOL_INFO;
817
818   typedef struct _SYMBOL_INFOW {
819     ULONG SizeOfStruct;
820     ULONG TypeIndex;
821     ULONG64 Reserved[2];
822     ULONG Index;
823     ULONG Size;
824     ULONG64 ModBase;
825     ULONG Flags;
826     ULONG64 Value;
827     ULONG64 Address;
828     ULONG Register;
829     ULONG Scope;
830     ULONG Tag;
831     ULONG NameLen;
832     ULONG MaxNameLen;
833     WCHAR Name[1];
834   } SYMBOL_INFOW, *PSYMBOL_INFOW;
835
836   typedef enum _IMAGEHLP_SYMBOL_TYPE_INFO {
837     TI_GET_SYMTAG,
838     TI_GET_SYMNAME,
839     TI_GET_LENGTH,
840     TI_GET_TYPE,
841     TI_GET_TYPEID,
842     TI_GET_BASETYPE,
843     TI_GET_ARRAYINDEXTYPEID,
844     TI_FINDCHILDREN,
845     TI_GET_DATAKIND,
846     TI_GET_ADDRESSOFFSET,
847     TI_GET_OFFSET,
848     TI_GET_VALUE,
849     TI_GET_COUNT,
850     TI_GET_CHILDRENCOUNT,
851     TI_GET_BITPOSITION,
852     TI_GET_VIRTUALBASECLASS,
853     TI_GET_VIRTUALTABLESHAPEID,
854     TI_GET_VIRTUALBASEPOINTEROFFSET,
855     TI_GET_CLASSPARENTID,
856     TI_GET_NESTED,
857     TI_GET_SYMINDEX,
858     TI_GET_LEXICALPARENT,
859     TI_GET_ADDRESS,
860     TI_GET_THISADJUST,
861     TI_GET_UDTKIND,
862     TI_IS_EQUIV_TO,
863     TI_GET_CALLING_CONVENTION,
864   } IMAGEHLP_SYMBOL_TYPE_INFO;
865
866 #define IMAGEHLP_GET_TYPE_INFO_UNCACHED            0x00000001
867 #define IMAGEHLP_GET_TYPE_INFO_CHILDREN            0x00000002
868   typedef struct _IMAGEHLP_GET_TYPE_INFO_PARAMS {
869     ULONG SizeOfStruct;
870     ULONG Flags;
871     ULONG NumIds;
872     PULONG TypeIds;
873     ULONG64 TagFilter;
874     ULONG NumReqs;
875     IMAGEHLP_SYMBOL_TYPE_INFO *ReqKinds;
876     PULONG_PTR ReqOffsets;
877     PULONG ReqSizes;
878     ULONG_PTR ReqStride;
879     ULONG_PTR BufferSize;
880     PVOID Buffer;
881     ULONG EntriesMatched;
882     ULONG EntriesFilled;
883     ULONG64 TagsFound;
884     ULONG64 AllReqsValid;
885     ULONG NumReqsValid;
886     PULONG64 ReqsValid;
887   } IMAGEHLP_GET_TYPE_INFO_PARAMS, *PIMAGEHLP_GET_TYPE_INFO_PARAMS;
888
889   typedef struct _TI_FINDCHILDREN_PARAMS {
890     ULONG Count;
891     ULONG Start;
892     ULONG ChildId[1];
893   } TI_FINDCHILDREN_PARAMS;
894
895 #define UNDNAME_COMPLETE                 (0x0000)
896 #define UNDNAME_NO_LEADING_UNDERSCORES   (0x0001)
897 #define UNDNAME_NO_MS_KEYWORDS           (0x0002)
898 #define UNDNAME_NO_FUNCTION_RETURNS      (0x0004)
899 #define UNDNAME_NO_ALLOCATION_MODEL      (0x0008)
900 #define UNDNAME_NO_ALLOCATION_LANGUAGE   (0x0010)
901 #define UNDNAME_NO_MS_THISTYPE           (0x0020)
902 #define UNDNAME_NO_CV_THISTYPE           (0x0040)
903 #define UNDNAME_NO_THISTYPE              (0x0060)
904 #define UNDNAME_NO_ACCESS_SPECIFIERS     (0x0080)
905 #define UNDNAME_NO_THROW_SIGNATURES      (0x0100)
906 #define UNDNAME_NO_MEMBER_TYPE           (0x0200)
907 #define UNDNAME_NO_RETURN_UDT_MODEL      (0x0400)
908 #define UNDNAME_32_BIT_DECODE            (0x0800)
909 #define UNDNAME_NAME_ONLY                (0x1000)
910 #define UNDNAME_NO_ARGUMENTS             (0x2000)
911 #define UNDNAME_NO_SPECIAL_SYMS          (0x4000)
912
913 #define SYMSEARCH_MASKOBJS              0x01
914 #define SYMSEARCH_RECURSE               0x02
915 #define SYMSEARCH_GLOBALSONLY           0x04
916
917   BOOL WINAPI SymGetTypeInfo(HANDLE, DWORD64, ULONG,
918                              IMAGEHLP_SYMBOL_TYPE_INFO, PVOID);
919   BOOL WINAPI SymGetTypeInfoEx(HANDLE, DWORD64,
920                                PIMAGEHLP_GET_TYPE_INFO_PARAMS);
921   typedef BOOL(CALLBACK * PSYM_ENUMERATESYMBOLS_CALLBACK) (PSYMBOL_INFO,
922                                                            ULONG, PVOID);
923   typedef BOOL(CALLBACK * PSYM_ENUMERATESYMBOLS_CALLBACKW) (PSYMBOL_INFOW,
924                                                             ULONG, PVOID);
925   BOOL WINAPI SymEnumTypes(HANDLE, ULONG64, PSYM_ENUMERATESYMBOLS_CALLBACK,
926                            PVOID);
927   BOOL WINAPI SymEnumTypesW(HANDLE, ULONG64,
928                             PSYM_ENUMERATESYMBOLS_CALLBACKW, PVOID);
929   BOOL WINAPI SymFromAddr(HANDLE, DWORD64, DWORD64 *, SYMBOL_INFO *);
930   BOOL WINAPI SymFromAddrW(HANDLE, DWORD64, DWORD64 *, SYMBOL_INFOW *);
931   BOOL WINAPI SymFromToken(HANDLE, DWORD64, DWORD, PSYMBOL_INFO);
932   BOOL WINAPI SymFromTokenW(HANDLE, DWORD64, DWORD, PSYMBOL_INFOW);
933   BOOL WINAPI SymFromName(HANDLE, PCSTR, PSYMBOL_INFO);
934   BOOL WINAPI SymFromNameW(HANDLE, PCWSTR, PSYMBOL_INFOW);
935   BOOL WINAPI SymGetSymFromAddr(HANDLE, DWORD, PDWORD, PIMAGEHLP_SYMBOL);
936   BOOL WINAPI SymGetSymFromAddr64(HANDLE, DWORD64, PDWORD64,
937                                   PIMAGEHLP_SYMBOL64);
938   BOOL WINAPI SymGetSymFromName(HANDLE, PCSTR, PIMAGEHLP_SYMBOL);
939   BOOL WINAPI SymGetSymFromName64(HANDLE, PCSTR, PIMAGEHLP_SYMBOL64);
940   BOOL WINAPI SymGetTypeFromName(HANDLE, ULONG64, PCSTR, PSYMBOL_INFO);
941   BOOL WINAPI SymGetTypeFromNameW(HANDLE, ULONG64, PCWSTR, PSYMBOL_INFOW);
942   BOOL WINAPI SymGetSymNext(HANDLE, PIMAGEHLP_SYMBOL);
943   BOOL WINAPI SymGetSymNext64(HANDLE, PIMAGEHLP_SYMBOL64);
944   BOOL WINAPI SymGetSymNextW64(HANDLE, PIMAGEHLP_SYMBOLW64);
945   BOOL WINAPI SymGetSymPrev(HANDLE, PIMAGEHLP_SYMBOL);
946   BOOL WINAPI SymGetSymPrev64(HANDLE, PIMAGEHLP_SYMBOL64);
947   BOOL WINAPI SymGetSymPrevW64(HANDLE, PIMAGEHLP_SYMBOLW64);
948   BOOL WINAPI SymEnumSymbols(HANDLE, ULONG64, PCSTR,
949                              PSYM_ENUMERATESYMBOLS_CALLBACK, PVOID);
950   BOOL WINAPI SymEnumSymbolsW(HANDLE, ULONG64, PCWSTR,
951                               PSYM_ENUMERATESYMBOLS_CALLBACKW, PVOID);
952   typedef BOOL(CALLBACK * PSYM_ENUMSYMBOLS_CALLBACK) (PCSTR, DWORD, ULONG,
953                                                       PVOID);
954   typedef BOOL(CALLBACK * PSYM_ENUMSYMBOLS_CALLBACKW) (PCWSTR, DWORD,
955                                                        ULONG, PVOID);
956   BOOL WINAPI SymEnumerateSymbols(HANDLE, ULONG, PSYM_ENUMSYMBOLS_CALLBACK,
957                                   PVOID);
958   BOOL WINAPI SymEnumerateSymbolsW(HANDLE, ULONG,
959                                    PSYM_ENUMSYMBOLS_CALLBACKW, PVOID);
960   typedef BOOL(CALLBACK * PSYM_ENUMSYMBOLS_CALLBACK64) (PCSTR, DWORD64,
961                                                         ULONG, PVOID);
962   typedef BOOL(CALLBACK * PSYM_ENUMSYMBOLS_CALLBACK64W) (PCWSTR, DWORD64,
963                                                          ULONG, PVOID);
964   BOOL WINAPI SymEnumerateSymbols64(HANDLE, ULONG64,
965                                     PSYM_ENUMSYMBOLS_CALLBACK64, PVOID);
966   BOOL WINAPI SymEnumerateSymbolsW64(HANDLE, ULONG64,
967                                      PSYM_ENUMSYMBOLS_CALLBACK64W, PVOID);
968   BOOL WINAPI SymEnumSymbolsForAddr(HANDLE, DWORD64,
969                                     PSYM_ENUMERATESYMBOLS_CALLBACK, PVOID);
970   BOOL WINAPI SymEnumSymbolsForAddrW(HANDLE, DWORD64,
971                                      PSYM_ENUMERATESYMBOLS_CALLBACKW,
972                                      PVOID);
973   typedef BOOL(CALLBACK * PSYMBOL_REGISTERED_CALLBACK) (HANDLE, ULONG,
974                                                         PVOID, PVOID);
975   BOOL WINAPI SymRegisterCallback(HANDLE, PSYMBOL_REGISTERED_CALLBACK,
976                                   PVOID);
977   typedef BOOL(CALLBACK * PSYMBOL_REGISTERED_CALLBACK64) (HANDLE, ULONG,
978                                                           ULONG64,
979                                                           ULONG64);
980   BOOL WINAPI SymRegisterCallback64(HANDLE, PSYMBOL_REGISTERED_CALLBACK64,
981                                     ULONG64);
982   BOOL WINAPI SymRegisterCallbackW64(HANDLE, PSYMBOL_REGISTERED_CALLBACK64,
983                                      ULONG64);
984   BOOL WINAPI SymUnDName(PIMAGEHLP_SYMBOL, PSTR, DWORD);
985   BOOL WINAPI SymUnDName64(PIMAGEHLP_SYMBOL64, PSTR, DWORD);
986   BOOL WINAPI SymMatchString(PCSTR, PCSTR, BOOL);
987   BOOL WINAPI SymMatchStringA(PCSTR, PCSTR, BOOL);
988   BOOL WINAPI SymMatchStringW(PCWSTR, PCWSTR, BOOL);
989   BOOL WINAPI SymSearch(HANDLE, ULONG64, DWORD, DWORD, PCSTR, DWORD64,
990                         PSYM_ENUMERATESYMBOLS_CALLBACK, PVOID, DWORD);
991   BOOL WINAPI SymSearchW(HANDLE, ULONG64, DWORD, DWORD, PCWSTR, DWORD64,
992                          PSYM_ENUMERATESYMBOLS_CALLBACKW, PVOID, DWORD);
993   DWORD WINAPI UnDecorateSymbolName(PCSTR, PSTR, DWORD, DWORD);
994   DWORD WINAPI UnDecorateSymbolNameW(PCWSTR, PWSTR, DWORD, DWORD);
995   BOOL WINAPI SymGetScope(HANDLE, ULONG64, DWORD, PSYMBOL_INFO);
996   BOOL WINAPI SymGetScopeW(HANDLE, ULONG64, DWORD, PSYMBOL_INFOW);
997   BOOL WINAPI SymFromIndex(HANDLE, ULONG64, DWORD, PSYMBOL_INFO);
998   BOOL WINAPI SymFromIndexW(HANDLE, ULONG64, DWORD, PSYMBOL_INFOW);
999   BOOL WINAPI SymAddSymbol(HANDLE, ULONG64, PCSTR, DWORD64, DWORD, DWORD);
1000   BOOL WINAPI SymAddSymbolW(HANDLE, ULONG64, PCWSTR, DWORD64, DWORD,
1001                             DWORD);
1002   BOOL WINAPI SymDeleteSymbol(HANDLE, ULONG64, PCSTR, DWORD64, DWORD);
1003   BOOL WINAPI SymDeleteSymbolW(HANDLE, ULONG64, PCWSTR, DWORD64, DWORD);
1004
1005 /*************************
1006  *      Source Files     *
1007  *************************/
1008   typedef BOOL(CALLBACK * PSYM_ENUMSOURCEFILES_CALLBACK) (PSOURCEFILE,
1009                                                           PVOID);
1010   typedef BOOL(CALLBACK * PSYM_ENUMSOURCEFILES_CALLBACKW) (PSOURCEFILEW,
1011                                                            PVOID);
1012
1013   BOOL WINAPI SymEnumSourceFiles(HANDLE, ULONG64, PCSTR,
1014                                  PSYM_ENUMSOURCEFILES_CALLBACK, PVOID);
1015   BOOL WINAPI SymEnumSourceFilesW(HANDLE, ULONG64, PCWSTR,
1016                                   PSYM_ENUMSOURCEFILES_CALLBACKW, PVOID);
1017   BOOL WINAPI SymGetLineFromAddr(HANDLE, DWORD, PDWORD, PIMAGEHLP_LINE);
1018   BOOL WINAPI SymGetLineFromAddrW(HANDLE, DWORD, PDWORD, PIMAGEHLP_LINEW);
1019   BOOL WINAPI SymGetLineFromAddr64(HANDLE, DWORD64, PDWORD,
1020                                    PIMAGEHLP_LINE64);
1021   BOOL WINAPI SymGetLineFromAddrW64(HANDLE, DWORD64, PDWORD,
1022                                     PIMAGEHLP_LINEW64);
1023   BOOL WINAPI SymGetLinePrev(HANDLE, PIMAGEHLP_LINE);
1024   BOOL WINAPI SymGetLinePrevW(HANDLE, PIMAGEHLP_LINEW);
1025   BOOL WINAPI SymGetLinePrev64(HANDLE, PIMAGEHLP_LINE64);
1026   BOOL WINAPI SymGetLinePrevW64(HANDLE, PIMAGEHLP_LINEW64);
1027   BOOL WINAPI SymGetLineNext(HANDLE, PIMAGEHLP_LINE);
1028   BOOL WINAPI SymGetLineNextW(HANDLE, PIMAGEHLP_LINEW);
1029   BOOL WINAPI SymGetLineNext64(HANDLE, PIMAGEHLP_LINE64);
1030   BOOL WINAPI SymGetLineNextW64(HANDLE, PIMAGEHLP_LINEW64);
1031   BOOL WINAPI SymGetLineFromName(HANDLE, PCSTR, PCSTR, DWORD, PLONG,
1032                                  PIMAGEHLP_LINE);
1033   BOOL WINAPI SymGetLineFromName64(HANDLE, PCSTR, PCSTR, DWORD, PLONG,
1034                                    PIMAGEHLP_LINE64);
1035   BOOL WINAPI SymGetLineFromNameW64(HANDLE, PCWSTR, PCWSTR, DWORD, PLONG,
1036                                     PIMAGEHLP_LINEW64);
1037   ULONG WINAPI SymGetFileLineOffsets64(HANDLE, PCSTR, PCSTR, PDWORD64,
1038                                        ULONG);
1039   BOOL WINAPI SymGetSourceFile(HANDLE, ULONG64, PCSTR, PCSTR, PSTR, DWORD);
1040   BOOL WINAPI SymGetSourceFileW(HANDLE, ULONG64, PCWSTR, PCWSTR, PWSTR,
1041                                 DWORD);
1042   BOOL WINAPI SymGetSourceFileToken(HANDLE, ULONG64, PCSTR, PVOID *,
1043                                     DWORD *);
1044   BOOL WINAPI SymGetSourceFileTokenW(HANDLE, ULONG64, PCWSTR, PVOID *,
1045                                      DWORD *);
1046   BOOL WINAPI SymGetSourceFileFromToken(HANDLE, PVOID, PCSTR, PSTR, DWORD);
1047   BOOL WINAPI SymGetSourceFileFromTokenW(HANDLE, PVOID, PCWSTR, PWSTR,
1048                                          DWORD);
1049   BOOL WINAPI SymGetSourceVarFromToken(HANDLE, PVOID, PCSTR, PCSTR, PSTR,
1050                                        DWORD);
1051   BOOL WINAPI SymGetSourceVarFromTokenW(HANDLE, PVOID, PCWSTR, PCWSTR,
1052                                         PWSTR, DWORD);
1053
1054   typedef struct _SRCCODEINFO {
1055     DWORD SizeOfStruct;
1056     PVOID Key;
1057     DWORD64 ModBase;
1058     CHAR Obj[MAX_PATH + 1];
1059     CHAR FileName[MAX_PATH + 1];
1060     DWORD LineNumber;
1061     DWORD64 Address;
1062   } SRCCODEINFO, *PSRCCODEINFO;
1063
1064   typedef struct _SRCCODEINFOW {
1065     DWORD SizeOfStruct;
1066     PVOID Key;
1067     DWORD64 ModBase;
1068     WCHAR Obj[MAX_PATH + 1];
1069     WCHAR FileName[MAX_PATH + 1];
1070     DWORD LineNumber;
1071     DWORD64 Address;
1072   } SRCCODEINFOW, *PSRCCODEINFOW;
1073
1074   typedef BOOL(CALLBACK * PSYM_ENUMLINES_CALLBACK) (PSRCCODEINFO, PVOID);
1075   typedef BOOL(CALLBACK * PSYM_ENUMLINES_CALLBACKW) (PSRCCODEINFOW, PVOID);
1076   BOOL WINAPI SymEnumLines(HANDLE, ULONG64, PCSTR, PCSTR,
1077                            PSYM_ENUMLINES_CALLBACK, PVOID);
1078   BOOL WINAPI SymEnumLinesW(HANDLE, ULONG64, PCWSTR, PCWSTR,
1079                             PSYM_ENUMLINES_CALLBACKW, PVOID);
1080   BOOL WINAPI SymEnumSourceLines(HANDLE, ULONG64, PCSTR, PCSTR, DWORD,
1081                                  DWORD, PSYM_ENUMLINES_CALLBACK, PVOID);
1082   BOOL WINAPI SymEnumSourceLinesW(HANDLE, ULONG64, PCWSTR, PCWSTR, DWORD,
1083                                   DWORD, PSYM_ENUMLINES_CALLBACKW, PVOID);
1084
1085 /*************************
1086  * File & image handling *
1087  *************************/
1088   BOOL WINAPI SymInitialize(HANDLE, PCSTR, BOOL);
1089   BOOL WINAPI SymInitializeW(HANDLE, PCWSTR, BOOL);
1090   BOOL WINAPI SymCleanup(HANDLE);
1091
1092   HANDLE WINAPI FindDebugInfoFile(PCSTR, PCSTR, PSTR);
1093   typedef BOOL(CALLBACK * PFIND_DEBUG_FILE_CALLBACK) (HANDLE, PCSTR,
1094                                                       PVOID);
1095   typedef BOOL(CALLBACK * PFIND_DEBUG_FILE_CALLBACKW) (HANDLE, PCWSTR,
1096                                                        PVOID);
1097   HANDLE WINAPI FindDebugInfoFileEx(PCSTR, PCSTR, PSTR,
1098                                     PFIND_DEBUG_FILE_CALLBACK, PVOID);
1099   HANDLE WINAPI FindDebugInfoFileExW(PCWSTR, PCWSTR, PWSTR,
1100                                      PFIND_DEBUG_FILE_CALLBACKW, PVOID);
1101   HANDLE WINAPI SymFindDebugInfoFile(HANDLE, PCSTR, PSTR,
1102                                      PFIND_DEBUG_FILE_CALLBACK, PVOID);
1103   HANDLE WINAPI SymFindDebugInfoFileW(HANDLE, PCWSTR, PWSTR,
1104                                       PFIND_DEBUG_FILE_CALLBACKW, PVOID);
1105   typedef BOOL(CALLBACK * PFINDFILEINPATHCALLBACK) (PCSTR, PVOID);
1106   typedef BOOL(CALLBACK * PFINDFILEINPATHCALLBACKW) (PCWSTR, PVOID);
1107   BOOL WINAPI FindFileInPath(HANDLE, PCSTR, PCSTR, PVOID, DWORD, DWORD,
1108                              DWORD, PSTR, PFINDFILEINPATHCALLBACK, PVOID);
1109   BOOL WINAPI SymFindFileInPath(HANDLE, PCSTR, PCSTR, PVOID, DWORD, DWORD,
1110                                 DWORD, PSTR, PFINDFILEINPATHCALLBACK,
1111                                 PVOID);
1112   BOOL WINAPI SymFindFileInPathW(HANDLE, PCWSTR, PCWSTR, PVOID, DWORD,
1113                                  DWORD, DWORD, PWSTR,
1114                                  PFINDFILEINPATHCALLBACKW, PVOID);
1115   HANDLE WINAPI FindExecutableImage(PCSTR, PCSTR, PSTR);
1116   typedef BOOL(CALLBACK * PFIND_EXE_FILE_CALLBACK) (HANDLE, PCSTR, PVOID);
1117   typedef BOOL(CALLBACK * PFIND_EXE_FILE_CALLBACKW) (HANDLE, PCWSTR,
1118                                                      PVOID);
1119   HANDLE WINAPI FindExecutableImageEx(PCSTR, PCSTR, PSTR,
1120                                       PFIND_EXE_FILE_CALLBACK, PVOID);
1121   HANDLE WINAPI FindExecutableImageExW(PCWSTR, PCWSTR, PWSTR,
1122                                        PFIND_EXE_FILE_CALLBACKW, PVOID);
1123   HANDLE WINAPI SymFindExecutableImage(HANDLE, PCSTR, PSTR,
1124                                        PFIND_EXE_FILE_CALLBACK, PVOID);
1125   HANDLE WINAPI SymFindExecutableImageW(HANDLE, PCWSTR, PWSTR,
1126                                         PFIND_EXE_FILE_CALLBACKW, PVOID);
1127   PIMAGE_NT_HEADERS WINAPI ImageNtHeader(PVOID);
1128   PVOID WINAPI ImageDirectoryEntryToDataEx(PVOID, BOOLEAN, USHORT, PULONG,
1129                                            PIMAGE_SECTION_HEADER *);
1130   PVOID WINAPI ImageDirectoryEntryToData(PVOID, BOOLEAN, USHORT, PULONG);
1131   PIMAGE_SECTION_HEADER WINAPI ImageRvaToSection(PIMAGE_NT_HEADERS, PVOID,
1132                                                  ULONG);
1133   PVOID WINAPI ImageRvaToVa(PIMAGE_NT_HEADERS, PVOID, ULONG,
1134                             PIMAGE_SECTION_HEADER *);
1135   BOOL WINAPI SymGetSearchPath(HANDLE, PSTR, DWORD);
1136   BOOL WINAPI SymGetSearchPathW(HANDLE, PWSTR, DWORD);
1137   BOOL WINAPI SymSetSearchPath(HANDLE, PCSTR);
1138   BOOL WINAPI SymSetSearchPathW(HANDLE, PCWSTR);
1139   DWORD WINAPI GetTimestampForLoadedLibrary(HMODULE);
1140   BOOL WINAPI MakeSureDirectoryPathExists(PCSTR);
1141   BOOL WINAPI SearchTreeForFile(PCSTR, PCSTR, PSTR);
1142   BOOL WINAPI SearchTreeForFileW(PCWSTR, PCWSTR, PWSTR);
1143   typedef BOOL(CALLBACK * PENUMDIRTREE_CALLBACK) (PCSTR, PVOID);
1144   typedef BOOL(CALLBACK * PENUMDIRTREE_CALLBACKW) (PCWSTR, PVOID);
1145   BOOL WINAPI EnumDirTree(HANDLE, PCSTR, PCSTR, PSTR,
1146                           PENUMDIRTREE_CALLBACK, PVOID);
1147   BOOL WINAPI EnumDirTreeW(HANDLE, PCWSTR, PCWSTR, PWSTR,
1148                            PENUMDIRTREE_CALLBACKW, PVOID);
1149   BOOL WINAPI SymMatchFileName(PCSTR, PCSTR, PSTR *, PSTR *);
1150   BOOL WINAPI SymMatchFileNameW(PCWSTR, PCWSTR, PWSTR *, PWSTR *);
1151   PCHAR WINAPI SymSetHomeDirectory(HANDLE, PCSTR);
1152   PWSTR WINAPI SymSetHomeDirectoryW(HANDLE, PCWSTR);
1153   PCHAR WINAPI SymGetHomeDirectory(DWORD, PSTR, size_t);
1154   PWSTR WINAPI SymGetHomeDirectoryW(DWORD, PWSTR, size_t);
1155 #define hdBase  0
1156 #define hdSym   1
1157 #define hdSrc   2
1158 #define hdMax   3
1159
1160 /*************************
1161  *   Context management  *
1162  *************************/
1163   BOOL WINAPI SymSetContext(HANDLE, PIMAGEHLP_STACK_FRAME,
1164                             PIMAGEHLP_CONTEXT);
1165
1166
1167 /*************************
1168  *    Stack management   *
1169  *************************/
1170
1171   typedef struct _KDHELP {
1172     DWORD Thread;
1173     DWORD ThCallbackStack;
1174     DWORD NextCallback;
1175     DWORD FramePointer;
1176     DWORD KiCallUserMode;
1177     DWORD KeUserCallbackDispatcher;
1178     DWORD SystemRangeStart;
1179   } KDHELP, *PKDHELP;
1180
1181   typedef struct _KDHELP64 {
1182     DWORD64 Thread;
1183     DWORD ThCallbackStack;
1184     DWORD ThCallbackBStore;
1185     DWORD NextCallback;
1186     DWORD FramePointer;
1187     DWORD64 KiCallUserMode;
1188     DWORD64 KeUserCallbackDispatcher;
1189     DWORD64 SystemRangeStart;
1190     DWORD64 Reserved[8];
1191   } KDHELP64, *PKDHELP64;
1192
1193   typedef struct _STACKFRAME {
1194     ADDRESS AddrPC;
1195     ADDRESS AddrReturn;
1196     ADDRESS AddrFrame;
1197     ADDRESS AddrStack;
1198     PVOID FuncTableEntry;
1199     DWORD Params[4];
1200     BOOL Far;
1201     BOOL Virtual;
1202     DWORD Reserved[3];
1203     KDHELP KdHelp;
1204     ADDRESS AddrBStore;
1205   } STACKFRAME, *LPSTACKFRAME;
1206
1207   typedef struct _STACKFRAME64 {
1208     ADDRESS64 AddrPC;
1209     ADDRESS64 AddrReturn;
1210     ADDRESS64 AddrFrame;
1211     ADDRESS64 AddrStack;
1212     ADDRESS64 AddrBStore;
1213     PVOID FuncTableEntry;
1214     DWORD64 Params[4];
1215     BOOL Far;
1216     BOOL Virtual;
1217     DWORD64 Reserved[3];
1218     KDHELP64 KdHelp;
1219   } STACKFRAME64, *LPSTACKFRAME64;
1220
1221   typedef BOOL(CALLBACK * PREAD_PROCESS_MEMORY_ROUTINE)
1222    (HANDLE, DWORD, PVOID, DWORD, PDWORD);
1223   typedef PVOID(CALLBACK * PFUNCTION_TABLE_ACCESS_ROUTINE) (HANDLE, DWORD);
1224   typedef DWORD(CALLBACK * PGET_MODULE_BASE_ROUTINE) (HANDLE, DWORD);
1225   typedef DWORD(CALLBACK * PTRANSLATE_ADDRESS_ROUTINE) (HANDLE, HANDLE,
1226                                                         LPADDRESS);
1227   BOOL WINAPI StackWalk(DWORD, HANDLE, HANDLE, LPSTACKFRAME, PVOID,
1228                         PREAD_PROCESS_MEMORY_ROUTINE,
1229                         PFUNCTION_TABLE_ACCESS_ROUTINE,
1230                         PGET_MODULE_BASE_ROUTINE,
1231                         PTRANSLATE_ADDRESS_ROUTINE);
1232
1233   typedef BOOL(CALLBACK * PREAD_PROCESS_MEMORY_ROUTINE64)
1234    (HANDLE, DWORD64, PVOID, DWORD, PDWORD);
1235   typedef PVOID(CALLBACK * PFUNCTION_TABLE_ACCESS_ROUTINE64) (HANDLE,
1236                                                               DWORD64);
1237   typedef DWORD64(CALLBACK * PGET_MODULE_BASE_ROUTINE64) (HANDLE, DWORD64);
1238   typedef DWORD64(CALLBACK * PTRANSLATE_ADDRESS_ROUTINE64) (HANDLE, HANDLE,
1239                                                             LPADDRESS64);
1240   BOOL WINAPI StackWalk64(DWORD, HANDLE, HANDLE, LPSTACKFRAME64, PVOID,
1241                           PREAD_PROCESS_MEMORY_ROUTINE64,
1242                           PFUNCTION_TABLE_ACCESS_ROUTINE64,
1243                           PGET_MODULE_BASE_ROUTINE64,
1244                           PTRANSLATE_ADDRESS_ROUTINE64);
1245
1246   PVOID WINAPI SymFunctionTableAccess(HANDLE, DWORD);
1247   PVOID WINAPI SymFunctionTableAccess64(HANDLE, DWORD64);
1248
1249   typedef PVOID(CALLBACK * PSYMBOL_FUNCENTRY_CALLBACK) (HANDLE, DWORD,
1250                                                         PVOID);
1251   typedef PVOID(CALLBACK * PSYMBOL_FUNCENTRY_CALLBACK64) (HANDLE, ULONG64,
1252                                                           ULONG64);
1253
1254   BOOL WINAPI SymRegisterFunctionEntryCallback(HANDLE,
1255                                                PSYMBOL_FUNCENTRY_CALLBACK,
1256                                                PVOID);
1257   BOOL WINAPI SymRegisterFunctionEntryCallback64(HANDLE,
1258                                                  PSYMBOL_FUNCENTRY_CALLBACK64,
1259                                                  ULONG64);
1260
1261 /*************************
1262  * Version, global stuff *
1263  *************************/
1264
1265 #define API_VERSION_NUMBER 9
1266
1267   typedef struct API_VERSION {
1268     USHORT MajorVersion;
1269     USHORT MinorVersion;
1270     USHORT Revision;
1271     USHORT Reserved;
1272   } API_VERSION, *LPAPI_VERSION;
1273
1274   LPAPI_VERSION WINAPI ImagehlpApiVersion(void);
1275   LPAPI_VERSION WINAPI ImagehlpApiVersionEx(LPAPI_VERSION);
1276
1277   typedef struct _IMAGE_DEBUG_INFORMATION {
1278     LIST_ENTRY List;
1279     DWORD ReservedSize;
1280     PVOID ReservedMappedBase;
1281     USHORT ReservedMachine;
1282     USHORT ReservedCharacteristics;
1283     DWORD ReservedCheckSum;
1284     DWORD ImageBase;
1285     DWORD SizeOfImage;
1286     DWORD ReservedNumberOfSections;
1287     PIMAGE_SECTION_HEADER ReservedSections;
1288     DWORD ReservedExportedNamesSize;
1289     PSTR ReservedExportedNames;
1290     DWORD ReservedNumberOfFunctionTableEntries;
1291     PIMAGE_FUNCTION_ENTRY ReservedFunctionTableEntries;
1292     DWORD ReservedLowestFunctionStartingAddress;
1293     DWORD ReservedHighestFunctionEndingAddress;
1294     DWORD ReservedNumberOfFpoTableEntries;
1295     PFPO_DATA ReservedFpoTableEntries;
1296     DWORD SizeOfCoffSymbols;
1297     PIMAGE_COFF_SYMBOLS_HEADER CoffSymbols;
1298     DWORD ReservedSizeOfCodeViewSymbols;
1299     PVOID ReservedCodeViewSymbols;
1300     PSTR ImageFilePath;
1301     PSTR ImageFileName;
1302     PSTR ReservedDebugFilePath;
1303     DWORD ReservedTimeDateStamp;
1304     BOOL ReservedRomImage;
1305     PIMAGE_DEBUG_DIRECTORY ReservedDebugDirectory;
1306     DWORD ReservedNumberOfDebugDirectories;
1307     DWORD ReservedOriginalFunctionTableBaseAddress;
1308     DWORD Reserved[2];
1309   } IMAGE_DEBUG_INFORMATION, *PIMAGE_DEBUG_INFORMATION;
1310
1311
1312   PIMAGE_DEBUG_INFORMATION WINAPI MapDebugInformation(HANDLE, PCSTR, PCSTR,
1313                                                       ULONG);
1314
1315   BOOL WINAPI UnmapDebugInformation(PIMAGE_DEBUG_INFORMATION);
1316
1317   DWORD WINAPI SymGetOptions(void);
1318   DWORD WINAPI SymSetOptions(DWORD);
1319
1320   BOOL WINAPI SymSetParentWindow(HWND);
1321
1322 /*************************
1323  * Version, global stuff *
1324  *************************/
1325
1326   typedef BOOL(WINAPI * PSYMBOLSERVERPROC) (PCSTR, PCSTR, PVOID, DWORD,
1327                                             DWORD, PSTR);
1328   typedef BOOL(WINAPI * PSYMBOLSERVERPROCA) (PCSTR, PCSTR, PVOID, DWORD,
1329                                              DWORD, PSTR);
1330   typedef BOOL(WINAPI * PSYMBOLSERVERPROCW) (PCWSTR, PCWSTR, PVOID, DWORD,
1331                                              DWORD, PWSTR);
1332   typedef BOOL(WINAPI * PSYMBOLSERVEROPENPROC) (void);
1333   typedef BOOL(WINAPI * PSYMBOLSERVERCLOSEPROC) (void);
1334   typedef BOOL(WINAPI * PSYMBOLSERVERSETOPTIONSPROC) (UINT_PTR, ULONG64);
1335   typedef BOOL(CALLBACK * PSYMBOLSERVERCALLBACKPROC) (UINT_PTR, ULONG64,
1336                                                       ULONG64);
1337   typedef UINT_PTR(WINAPI * PSYMBOLSERVERGETOPTIONSPROC) (void);
1338   typedef BOOL(WINAPI * PSYMBOLSERVERPINGPROC) (PCSTR);
1339   typedef BOOL(WINAPI * PSYMBOLSERVERPINGPROCA) (PCSTR);
1340   typedef BOOL(WINAPI * PSYMBOLSERVERPINGPROCW) (PCWSTR);
1341
1342 #define SSRVOPT_CALLBACK            0x0001
1343 #define SSRVOPT_DWORD               0x0002
1344 #define SSRVOPT_DWORDPTR            0x0004
1345 #define SSRVOPT_GUIDPTR             0x0008
1346 #define SSRVOPT_OLDGUIDPTR          0x0010
1347 #define SSRVOPT_UNATTENDED          0x0020
1348 #define SSRVOPT_NOCOPY              0x0040
1349 #define SSRVOPT_PARENTWIN           0x0080
1350 #define SSRVOPT_PARAMTYPE           0x0100
1351 #define SSRVOPT_SECURE              0x0200
1352 #define SSRVOPT_TRACE               0x0400
1353 #define SSRVOPT_SETCONTEXT          0x0800
1354 #define SSRVOPT_PROXY               0x1000
1355 #define SSRVOPT_DOWNSTREAM_STORE    0x2000
1356 #define SSRVOPT_RESET               ((ULONG_PTR)-1)
1357
1358 #define SSRVACTION_TRACE        1
1359 #define SSRVACTION_QUERYCANCEL  2
1360 #define SSRVACTION_EVENT        3
1361
1362 #ifdef __cplusplus
1363 }                               /* extern "C" */
1364 #endif                          /* defined(__cplusplus) */
1365 #endif                          /* __WINE_DBGHELP_H */