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