kernel32/tests/sync: Enable compilation with long types.
[wine.git] / include / dbghelp.h
blob07fa429809aafc5f7f13b89b52ba0f036c961cdc
1 /*
2 * Declarations for DBGHELP
4 * Copyright (C) 2003 Eric Pouech
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.
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.
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
21 #ifndef __WINE_DBGHELP_H
22 #define __WINE_DBGHELP_H
24 #ifdef __cplusplus
25 extern "C" {
26 #endif /* defined(__cplusplus) */
28 #ifdef _WIN64
29 #ifndef _IMAGEHLP64
30 #define _IMAGEHLP64
31 #endif
32 #endif
34 #define IMAGEAPI WINAPI
35 #define DBHLPAPI IMAGEAPI
37 typedef struct _LOADED_IMAGE
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;
55 /*************************
56 * IMAGEHLP equiv *
57 *************************/
59 typedef enum
61 AddrMode1616,
62 AddrMode1632,
63 AddrModeReal,
64 AddrModeFlat
65 } ADDRESS_MODE;
67 #if !defined(_IMAGEHLP_SOURCE_) && defined(_IMAGEHLP64)
68 #define ADDRESS ADDRESS64
69 #define LPADDRESS LPADDRESS64
70 #else
71 typedef struct _tagADDRESS
73 DWORD Offset;
74 WORD Segment;
75 ADDRESS_MODE Mode;
76 } ADDRESS, *LPADDRESS;
77 #endif
79 typedef struct _tagADDRESS64
81 DWORD64 Offset;
82 WORD Segment;
83 ADDRESS_MODE Mode;
84 } ADDRESS64, *LPADDRESS64;
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
102 typedef enum
104 SymNone = 0,
105 SymCoff,
106 SymCv,
107 SymPdb,
108 SymExport,
109 SymDeferred,
110 SymSym,
111 SymDia,
112 SymVirtual,
113 NumSymTypes
114 } SYM_TYPE;
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
124 DWORD SizeOfStruct;
125 DWORD Address;
126 DWORD Size;
127 DWORD Flags;
128 DWORD MaxNameLength;
129 CHAR Name[1];
130 } IMAGEHLP_SYMBOL, *PIMAGEHLP_SYMBOL;
132 typedef struct _IMAGEHLP_SYMBOLW
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
143 typedef struct _IMAGEHLP_SYMBOL64
145 DWORD SizeOfStruct;
146 DWORD64 Address;
147 DWORD Size;
148 DWORD Flags;
149 DWORD MaxNameLength;
150 CHAR Name[1];
151 } IMAGEHLP_SYMBOL64, *PIMAGEHLP_SYMBOL64;
153 typedef struct _IMAGEHLP_SYMBOLW64
155 DWORD SizeOfStruct;
156 DWORD64 Address;
157 DWORD Size;
158 DWORD Flags;
159 DWORD MaxNameLength;
160 WCHAR Name[1];
161 } IMAGEHLP_SYMBOLW64, *PIMAGEHLP_SYMBOLW64;
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
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;
183 typedef struct _IMAGEHLP_MODULEW
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
198 typedef struct _IMAGEHLP_MODULE64
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 DWORD MachineType;
224 DWORD Reserved;
225 } IMAGEHLP_MODULE64, *PIMAGEHLP_MODULE64;
227 typedef struct _IMAGEHLP_MODULEW64
229 DWORD SizeOfStruct;
230 DWORD64 BaseOfImage;
231 DWORD ImageSize;
232 DWORD TimeDateStamp;
233 DWORD CheckSum;
234 DWORD NumSyms;
235 SYM_TYPE SymType;
236 WCHAR ModuleName[32];
237 WCHAR ImageName[256];
238 WCHAR LoadedImageName[256];
239 WCHAR LoadedPdbName[256];
240 DWORD CVSig;
241 WCHAR CVData[MAX_PATH*3];
242 DWORD PdbSig;
243 GUID PdbSig70;
244 DWORD PdbAge;
245 BOOL PdbUnmatched;
246 BOOL DbgUnmatched;
247 BOOL LineNumbers;
248 BOOL GlobalSymbols;
249 BOOL TypeInfo;
250 BOOL SourceIndexed;
251 BOOL Publics;
252 DWORD MachineType;
253 DWORD Reserved;
254 } IMAGEHLP_MODULEW64, *PIMAGEHLP_MODULEW64;
256 #if !defined(_IMAGEHLP_SOURCE_) && defined(_IMAGEHLP64)
257 #define IMAGEHLP_LINE IMAGEHLP_LINE64
258 #define PIMAGEHLP_LINE PIMAGEHLP_LINE64
259 #define IMAGEHLP_LINEW IMAGEHLP_LINEW64
260 #define PIMAGEHLP_LINEW PIMAGEHLP_LINEW64
261 #else
262 typedef struct _IMAGEHLP_LINE
264 DWORD SizeOfStruct;
265 PVOID Key;
266 DWORD LineNumber;
267 PCHAR FileName;
268 DWORD Address;
269 } IMAGEHLP_LINE, *PIMAGEHLP_LINE;
271 typedef struct _IMAGEHLP_LINEW
273 DWORD SizeOfStruct;
274 PVOID Key;
275 DWORD LineNumber;
276 PWSTR FileName;
277 DWORD Address;
278 } IMAGEHLP_LINEW, *PIMAGEHLP_LINEW;
279 #endif
281 typedef struct _IMAGEHLP_LINE64
283 DWORD SizeOfStruct;
284 PVOID Key;
285 DWORD LineNumber;
286 PCHAR FileName;
287 DWORD64 Address;
288 } IMAGEHLP_LINE64, *PIMAGEHLP_LINE64;
290 typedef struct _IMAGEHLP_LINEW64
292 DWORD SizeOfStruct;
293 PVOID Key;
294 DWORD LineNumber;
295 PWSTR FileName;
296 DWORD64 Address;
297 } IMAGEHLP_LINEW64, *PIMAGEHLP_LINEW64;
299 typedef struct _SOURCEFILE
301 DWORD64 ModBase;
302 PCHAR FileName;
303 } SOURCEFILE, *PSOURCEFILE;
305 typedef struct _SOURCEFILEW
307 DWORD64 ModBase;
308 PWSTR FileName;
309 } SOURCEFILEW, *PSOURCEFILEW;
311 #define CBA_DEFERRED_SYMBOL_LOAD_START 0x00000001
312 #define CBA_DEFERRED_SYMBOL_LOAD_COMPLETE 0x00000002
313 #define CBA_DEFERRED_SYMBOL_LOAD_FAILURE 0x00000003
314 #define CBA_SYMBOLS_UNLOADED 0x00000004
315 #define CBA_DUPLICATE_SYMBOL 0x00000005
316 #define CBA_READ_MEMORY 0x00000006
317 #define CBA_DEFERRED_SYMBOL_LOAD_CANCEL 0x00000007
318 #define CBA_SET_OPTIONS 0x00000008
319 #define CBA_EVENT 0x00000010
320 #define CBA_DEFERRED_SYMBOL_LOAD_PARTIAL 0x00000020
321 #define CBA_DEBUG_INFO 0x10000000
323 typedef struct _IMAGEHLP_CBA_READ_MEMORY
325 DWORD64 addr;
326 PVOID buf;
327 DWORD bytes;
328 DWORD *bytesread;
329 } IMAGEHLP_CBA_READ_MEMORY, *PIMAGEHLP_CBA_READ_MEMORY;
331 enum
333 sevInfo = 0,
334 sevProblem,
335 sevAttn,
336 sevFatal,
337 sevMax
340 #define EVENT_SRCSPEW_START 100
341 #define EVENT_SRCSPEW 100
342 #define EVENT_SRCSPEW_END 199
344 typedef struct _IMAGEHLP_CBA_EVENT
346 DWORD severity;
347 DWORD code;
348 PCHAR desc;
349 PVOID object;
350 } IMAGEHLP_CBA_EVENT, *PIMAGEHLP_CBA_EVENT;
352 typedef struct _IMAGEHLP_CBA_EVENTW
354 DWORD severity;
355 DWORD code;
356 PCWSTR desc;
357 PVOID object;
358 } IMAGEHLP_CBA_EVENTW, *PIMAGEHLP_CBA_EVENTW;
360 #if !defined(_IMAGEHLP_SOURCE_) && defined(_IMAGEHLP64)
361 #define IMAGEHLP_DEFERRED_SYMBOL_LOAD IMAGEHLP_DEFERRED_SYMBOL_LOAD64
362 #define PIMAGEHLP_DEFERRED_SYMBOL_LOAD PIMAGEHLP_DEFERRED_SYMBOL_LOAD64
363 #else
364 typedef struct _IMAGEHLP_DEFERRED_SYMBOL_LOAD
366 DWORD SizeOfStruct;
367 DWORD BaseOfImage;
368 DWORD CheckSum;
369 DWORD TimeDateStamp;
370 CHAR FileName[MAX_PATH];
371 BOOLEAN Reparse;
372 HANDLE hFile;
373 } IMAGEHLP_DEFERRED_SYMBOL_LOAD, *PIMAGEHLP_DEFERRED_SYMBOL_LOAD;
374 #endif
376 typedef struct _IMAGEHLP_DEFERRED_SYMBOL_LOAD64
378 DWORD SizeOfStruct;
379 DWORD64 BaseOfImage;
380 DWORD CheckSum;
381 DWORD TimeDateStamp;
382 CHAR FileName[MAX_PATH];
383 BOOLEAN Reparse;
384 HANDLE hFile;
385 DWORD Flags;
386 } IMAGEHLP_DEFERRED_SYMBOL_LOAD64, *PIMAGEHLP_DEFERRED_SYMBOL_LOAD64;
388 typedef struct _IMAGEHLP_DEFERRED_SYMBOL_LOADW64
390 DWORD SizeOfStruct;
391 DWORD64 BaseOfImage;
392 DWORD CheckSum;
393 DWORD TimeDateStamp;
394 WCHAR FileName[MAX_PATH + 1];
395 BOOLEAN Reparse;
396 HANDLE hFile;
397 DWORD Flags;
398 } IMAGEHLP_DEFERRED_SYMBOL_LOADW64, *PIMAGEHLP_DEFERRED_SYMBOL_LOADW64;
400 #if !defined(_IMAGEHLP_SOURCE_) && defined(_IMAGEHLP64)
401 #define IMAGEHLP_DUPLICATE_SYMBOL IMAGEHLP_DUPLICATE_SYMBOL64
402 #define PIMAGEHLP_DUPLICATE_SYMBOL PIMAGEHLP_DUPLICATE_SYMBOL64
403 #else
404 typedef struct _IMAGEHLP_DUPLICATE_SYMBOL
406 DWORD SizeOfStruct;
407 DWORD NumberOfDups;
408 PIMAGEHLP_SYMBOL Symbol;
409 DWORD SelectedSymbol;
410 } IMAGEHLP_DUPLICATE_SYMBOL, *PIMAGEHLP_DUPLICATE_SYMBOL;
411 #endif
413 typedef struct _IMAGEHLP_DUPLICATE_SYMBOL64
415 DWORD SizeOfStruct;
416 DWORD NumberOfDups;
417 PIMAGEHLP_SYMBOL64 Symbol;
418 DWORD SelectedSymbol;
419 } IMAGEHLP_DUPLICATE_SYMBOL64, *PIMAGEHLP_DUPLICATE_SYMBOL64;
421 #define SYMOPT_CASE_INSENSITIVE 0x00000001
422 #define SYMOPT_UNDNAME 0x00000002
423 #define SYMOPT_DEFERRED_LOADS 0x00000004
424 #define SYMOPT_NO_CPP 0x00000008
425 #define SYMOPT_LOAD_LINES 0x00000010
426 #define SYMOPT_OMAP_FIND_NEAREST 0x00000020
427 #define SYMOPT_LOAD_ANYTHING 0x00000040
428 #define SYMOPT_IGNORE_CVREC 0x00000080
429 #define SYMOPT_NO_UNQUALIFIED_LOADS 0x00000100
430 #define SYMOPT_FAIL_CRITICAL_ERRORS 0x00000200
431 #define SYMOPT_EXACT_SYMBOLS 0x00000400
432 #define SYMOPT_WILD_UNDERSCORE 0x00000800
433 #define SYMOPT_USE_DEFAULTS 0x00001000
434 /* latest SDK defines:
435 #define SYMOPT_ALLOW_ABSOLUTE_SYMBOLS 0x00000800
436 #define SYMOPT_IGNORE_NT_SYMPATH 0x00001000
438 #define SYMOPT_INCLUDE_32BIT_MODULES 0x00002000
439 #define SYMOPT_PUBLICS_ONLY 0x00004000
440 #define SYMOPT_NO_PUBLICS 0x00008000
441 #define SYMOPT_AUTO_PUBLICS 0x00010000
442 #define SYMOPT_NO_IMAGE_SEARCH 0x00020000
443 #define SYMOPT_SECURE 0x00040000
444 #define SYMOPT_NO_PROMPTS 0x00080000
445 #define SYMOPT_OVERWRITE 0x00100000
446 #define SYMOPT_IGNORE_IMAGEDIR 0x00200000
447 #define SYMOPT_FLAT_DIRECTORY 0x00400000
448 #define SYMOPT_FAVOR_COMPRESSED 0x00800000
449 #define SYMOPT_ALLOW_ZERO_ADDRESS 0x01000000
450 #define SYMOPT_DISABLE_SYMSRV_AUTODETECT 0x02000000
451 #define SYMOPT_READONLY_CACHE 0x04000000
452 #define SYMOPT_SYMPATH_LAST 0x08000000
453 #define SYMOPT_DISABLE_FAST_SYMBOLS 0x10000000
454 #define SYMOPT_DISABLE_SYMSRV_TIMEOUT 0x20000000
455 #define SYMOPT_DISABLE_SRVSTAR_ON_STARTUP 0x40000000
456 #define SYMOPT_DEBUG 0x80000000
458 typedef struct _IMAGEHLP_STACK_FRAME
460 ULONG64 InstructionOffset;
461 ULONG64 ReturnOffset;
462 ULONG64 FrameOffset;
463 ULONG64 StackOffset;
464 ULONG64 BackingStoreOffset;
465 ULONG64 FuncTableEntry;
466 ULONG64 Params[4];
467 ULONG64 Reserved[5];
468 BOOL Virtual;
469 ULONG Reserved2;
470 } IMAGEHLP_STACK_FRAME, *PIMAGEHLP_STACK_FRAME;
472 typedef VOID IMAGEHLP_CONTEXT, *PIMAGEHLP_CONTEXT;
474 #define DBHHEADER_DEBUGDIRS 0x1
475 typedef struct _DBGHELP_MODLOAD_DATA
477 DWORD ssize;
478 DWORD ssig;
479 PVOID data;
480 DWORD size;
481 DWORD flags;
482 } MODLOAD_DATA, *PMODLOAD_DATA;
484 /*************************
485 * MiniDUMP *
486 *************************/
488 #include <pshpack4.h>
489 /* DebugHelp */
491 #define MINIDUMP_SIGNATURE 0x504D444D /* 'MDMP' */
492 #define MINIDUMP_VERSION (42899)
494 typedef DWORD RVA;
495 typedef ULONG64 RVA64;
497 typedef enum _MINIDUMP_TYPE
499 MiniDumpNormal = 0x0000,
500 MiniDumpWithDataSegs = 0x0001,
501 MiniDumpWithFullMemory = 0x0002,
502 MiniDumpWithHandleData = 0x0004,
503 MiniDumpFilterMemory = 0x0008,
504 MiniDumpScanMemory = 0x0010,
505 MiniDumpWithUnloadedModules = 0x0020,
506 MiniDumpWithIndirectlyReferencedMemory = 0x0040,
507 MiniDumpFilterModulePaths = 0x0080,
508 MiniDumpWithProcessThreadData = 0x0100,
509 MiniDumpWithPrivateReadWriteMemory = 0x0200,
510 MiniDumpWithoutOptionalData = 0x0400,
511 MiniDumpWithFullMemoryInfo = 0x0800,
512 MiniDumpWithThreadInfo = 0x1000,
513 MiniDumpWithCodeSegs = 0x2000
514 } MINIDUMP_TYPE;
516 typedef enum _MINIDUMP_CALLBACK_TYPE
518 ModuleCallback,
519 ThreadCallback,
520 ThreadExCallback,
521 IncludeThreadCallback,
522 IncludeModuleCallback,
523 MemoryCallback,
524 } MINIDUMP_CALLBACK_TYPE;
526 typedef struct _MINIDUMP_THREAD_CALLBACK
528 ULONG ThreadId;
529 HANDLE ThreadHandle;
530 #if defined(__aarch64__)
531 ULONG Pad;
532 #endif
533 CONTEXT Context;
534 ULONG SizeOfContext;
535 ULONG64 StackBase;
536 ULONG64 StackEnd;
537 } MINIDUMP_THREAD_CALLBACK, *PMINIDUMP_THREAD_CALLBACK;
539 typedef struct _MINIDUMP_THREAD_EX_CALLBACK
541 ULONG ThreadId;
542 HANDLE ThreadHandle;
543 #if defined(__aarch64__)
544 ULONG Pad;
545 #endif
546 CONTEXT Context;
547 ULONG SizeOfContext;
548 ULONG64 StackBase;
549 ULONG64 StackEnd;
550 ULONG64 BackingStoreBase;
551 ULONG64 BackingStoreEnd;
552 } MINIDUMP_THREAD_EX_CALLBACK, *PMINIDUMP_THREAD_EX_CALLBACK;
554 typedef struct _MINIDUMP_INCLUDE_THREAD_CALLBACK
556 ULONG ThreadId;
557 } MINIDUMP_INCLUDE_THREAD_CALLBACK, *PMINIDUMP_INCLUDE_THREAD_CALLBACK;
559 typedef enum _THREAD_WRITE_FLAGS
561 ThreadWriteThread = 0x0001,
562 ThreadWriteStack = 0x0002,
563 ThreadWriteContext = 0x0004,
564 ThreadWriteBackingStore = 0x0008,
565 ThreadWriteInstructionWindow = 0x0010,
566 ThreadWriteThreadData = 0x0020,
567 ThreadWriteThreadInfo = 0x0040
568 } THREAD_WRITE_FLAGS;
570 typedef struct _MINIDUMP_MODULE_CALLBACK
572 PWCHAR FullPath;
573 ULONG64 BaseOfImage;
574 ULONG SizeOfImage;
575 ULONG CheckSum;
576 ULONG TimeDateStamp;
577 VS_FIXEDFILEINFO VersionInfo;
578 PVOID CvRecord;
579 ULONG SizeOfCvRecord;
580 PVOID MiscRecord;
581 ULONG SizeOfMiscRecord;
582 } MINIDUMP_MODULE_CALLBACK, *PMINIDUMP_MODULE_CALLBACK;
584 typedef struct _MINIDUMP_INCLUDE_MODULE_CALLBACK
586 ULONG64 BaseOfImage;
587 } MINIDUMP_INCLUDE_MODULE_CALLBACK, *PMINIDUMP_INCLUDE_MODULE_CALLBACK;
589 typedef enum _MODULE_WRITE_FLAGS
591 ModuleWriteModule = 0x0001,
592 ModuleWriteDataSeg = 0x0002,
593 ModuleWriteMiscRecord = 0x0004,
594 ModuleWriteCvRecord = 0x0008,
595 ModuleReferencedByMemory = 0x0010,
596 ModuleWriteTlsData = 0x0020,
597 ModuleWriteCodeSegs = 0x0040,
598 } MODULE_WRITE_FLAGS;
600 typedef struct _MINIDUMP_CALLBACK_INPUT
602 ULONG ProcessId;
603 HANDLE ProcessHandle;
604 ULONG CallbackType;
605 union
607 MINIDUMP_THREAD_CALLBACK Thread;
608 MINIDUMP_THREAD_EX_CALLBACK ThreadEx;
609 MINIDUMP_MODULE_CALLBACK Module;
610 MINIDUMP_INCLUDE_THREAD_CALLBACK IncludeThread;
611 MINIDUMP_INCLUDE_MODULE_CALLBACK IncludeModule;
612 } DUMMYUNIONNAME;
613 } MINIDUMP_CALLBACK_INPUT, *PMINIDUMP_CALLBACK_INPUT;
615 typedef struct _MINIDUMP_CALLBACK_OUTPUT
617 union
619 ULONG ModuleWriteFlags;
620 ULONG ThreadWriteFlags;
621 struct
623 ULONG64 MemoryBase;
624 ULONG MemorySize;
625 } DUMMYSTRUCTNAME;
626 } DUMMYUNIONNAME;
627 } MINIDUMP_CALLBACK_OUTPUT, *PMINIDUMP_CALLBACK_OUTPUT;
629 typedef BOOL (WINAPI* MINIDUMP_CALLBACK_ROUTINE)(PVOID, const PMINIDUMP_CALLBACK_INPUT, PMINIDUMP_CALLBACK_OUTPUT);
631 typedef struct _MINIDUMP_CALLBACK_INFORMATION
633 MINIDUMP_CALLBACK_ROUTINE CallbackRoutine;
634 void* CallbackParam;
635 } MINIDUMP_CALLBACK_INFORMATION, *PMINIDUMP_CALLBACK_INFORMATION;
637 typedef struct _MINIDUMP_LOCATION_DESCRIPTOR
639 ULONG DataSize;
640 RVA Rva;
641 } MINIDUMP_LOCATION_DESCRIPTOR;
643 typedef struct _MINIDUMP_LOCATION_DESCRIPTOR64
645 ULONG64 DataSize;
646 RVA64 Rva;
647 } MINIDUMP_LOCATION_DESCRIPTOR64;
649 typedef struct _MINIDUMP_DIRECTORY
651 ULONG StreamType;
652 MINIDUMP_LOCATION_DESCRIPTOR Location;
653 } MINIDUMP_DIRECTORY, *PMINIDUMP_DIRECTORY;
655 typedef struct _MINIDUMP_EXCEPTION
657 ULONG ExceptionCode;
658 ULONG ExceptionFlags;
659 ULONG64 ExceptionRecord;
660 ULONG64 ExceptionAddress;
661 ULONG NumberParameters;
662 ULONG __unusedAlignment;
663 ULONG64 ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS];
664 } MINIDUMP_EXCEPTION, *PMINIDUMP_EXCEPTION;
666 typedef struct _MINIDUMP_EXCEPTION_INFORMATION
668 DWORD ThreadId;
669 PEXCEPTION_POINTERS ExceptionPointers;
670 BOOL ClientPointers;
671 } MINIDUMP_EXCEPTION_INFORMATION, *PMINIDUMP_EXCEPTION_INFORMATION;
673 typedef struct MINIDUMP_EXCEPTION_STREAM
675 ULONG ThreadId;
676 ULONG __alignment;
677 MINIDUMP_EXCEPTION ExceptionRecord;
678 MINIDUMP_LOCATION_DESCRIPTOR ThreadContext;
679 } MINIDUMP_EXCEPTION_STREAM, *PMINIDUMP_EXCEPTION_STREAM;
681 typedef struct _MINIDUMP_HEADER
683 DWORD Signature;
684 DWORD Version;
685 DWORD NumberOfStreams;
686 RVA StreamDirectoryRva;
687 DWORD CheckSum;
688 union
690 DWORD Reserved;
691 DWORD TimeDateStamp;
692 } DUMMYUNIONNAME;
693 ULONG64 Flags;
694 } MINIDUMP_HEADER, *PMINIDUMP_HEADER;
696 typedef struct _MINIDUMP_MEMORY_DESCRIPTOR
698 ULONG64 StartOfMemoryRange;
699 MINIDUMP_LOCATION_DESCRIPTOR Memory;
700 } MINIDUMP_MEMORY_DESCRIPTOR, *PMINIDUMP_MEMORY_DESCRIPTOR;
702 typedef struct _MINIDUMP_MEMORY_LIST
704 ULONG NumberOfMemoryRanges;
705 MINIDUMP_MEMORY_DESCRIPTOR MemoryRanges[1]; /* FIXME: 0-sized array not supported */
706 } MINIDUMP_MEMORY_LIST, *PMINIDUMP_MEMORY_LIST;
708 typedef struct _MINIDUMP_MEMORY_DESCRIPTOR64
710 ULONG64 StartOfMemoryRange;
711 ULONG64 DataSize;
712 } MINIDUMP_MEMORY_DESCRIPTOR64, *PMINIDUMP_MEMORY_DESCRIPTOR64;
714 typedef struct _MINIDUMP_MEMORY64_LIST
716 ULONG64 NumberOfMemoryRanges;
717 RVA64 BaseRva;
718 MINIDUMP_MEMORY_DESCRIPTOR64 MemoryRanges[1]; /* FIXME: 0-sized array not supported */
719 } MINIDUMP_MEMORY64_LIST, *PMINIDUMP_MEMORY64_LIST;
721 #define MINIDUMP_MISC1_PROCESS_ID 0x00000001
722 #define MINIDUMP_MISC1_PROCESS_TIMES 0x00000002
724 typedef struct _MINIDUMP_MISC_INFO
726 ULONG SizeOfInfo;
727 ULONG Flags1;
728 ULONG ProcessId;
729 ULONG ProcessCreateTime;
730 ULONG ProcessUserTime;
731 ULONG ProcessKernelTime;
732 } MINIDUMP_MISC_INFO, *PMINIDUMP_MISC_INFO;
734 typedef struct _MINIDUMP_MODULE
736 ULONG64 BaseOfImage;
737 ULONG SizeOfImage;
738 ULONG CheckSum;
739 ULONG TimeDateStamp;
740 RVA ModuleNameRva;
741 VS_FIXEDFILEINFO VersionInfo;
742 MINIDUMP_LOCATION_DESCRIPTOR CvRecord;
743 MINIDUMP_LOCATION_DESCRIPTOR MiscRecord;
744 ULONG64 Reserved0;
745 ULONG64 Reserved1;
746 } MINIDUMP_MODULE, *PMINIDUMP_MODULE;
748 typedef struct _MINIDUMP_MODULE_LIST
750 ULONG NumberOfModules;
751 MINIDUMP_MODULE Modules[1]; /* FIXME: 0-sized array not supported */
752 } MINIDUMP_MODULE_LIST, *PMINIDUMP_MODULE_LIST;
754 typedef struct _MINIDUMP_STRING
756 ULONG Length;
757 WCHAR Buffer[1]; /* FIXME: O-sized array not supported */
758 } MINIDUMP_STRING, *PMINIDUMP_STRING;
760 typedef struct _MINIDUMP_SYSTEM_INFO
762 USHORT ProcessorArchitecture;
763 USHORT ProcessorLevel;
764 USHORT ProcessorRevision;
765 union
767 USHORT Reserved0;
768 struct
770 UCHAR NumberOfProcessors;
771 UCHAR ProductType;
772 } DUMMYSTRUCTNAME;
773 } DUMMYUNIONNAME;
775 ULONG MajorVersion;
776 ULONG MinorVersion;
777 ULONG BuildNumber;
778 ULONG PlatformId;
780 RVA CSDVersionRva;
781 union
783 ULONG Reserved1;
784 struct
786 USHORT SuiteMask;
787 USHORT Reserved2;
788 } DUMMYSTRUCTNAME;
789 } DUMMYUNIONNAME1;
790 union _CPU_INFORMATION
792 struct
794 ULONG VendorId[3];
795 ULONG VersionInformation;
796 ULONG FeatureInformation;
797 ULONG AMDExtendedCpuFeatures;
798 } X86CpuInfo;
799 struct
801 ULONG64 ProcessorFeatures[2];
802 } OtherCpuInfo;
803 } Cpu;
805 } MINIDUMP_SYSTEM_INFO, *PMINIDUMP_SYSTEM_INFO;
807 typedef struct _MINIDUMP_THREAD
809 ULONG ThreadId;
810 ULONG SuspendCount;
811 ULONG PriorityClass;
812 ULONG Priority;
813 ULONG64 Teb;
814 MINIDUMP_MEMORY_DESCRIPTOR Stack;
815 MINIDUMP_LOCATION_DESCRIPTOR ThreadContext;
816 } MINIDUMP_THREAD, *PMINIDUMP_THREAD;
818 typedef struct _MINIDUMP_THREAD_LIST
820 ULONG NumberOfThreads;
821 MINIDUMP_THREAD Threads[1]; /* FIXME: no support of 0 sized array */
822 } MINIDUMP_THREAD_LIST, *PMINIDUMP_THREAD_LIST;
824 typedef struct _MINIDUMP_USER_STREAM
826 ULONG Type;
827 ULONG BufferSize;
828 void* Buffer;
829 } MINIDUMP_USER_STREAM, *PMINIDUMP_USER_STREAM;
831 typedef struct _MINIDUMP_USER_STREAM_INFORMATION
833 ULONG UserStreamCount;
834 PMINIDUMP_USER_STREAM UserStreamArray;
835 } MINIDUMP_USER_STREAM_INFORMATION, *PMINIDUMP_USER_STREAM_INFORMATION;
837 typedef enum _MINIDUMP_STREAM_TYPE
839 UnusedStream = 0,
840 ReservedStream0 = 1,
841 ReservedStream1 = 2,
842 ThreadListStream = 3,
843 ModuleListStream = 4,
844 MemoryListStream = 5,
845 ExceptionStream = 6,
846 SystemInfoStream = 7,
847 ThreadExListStream = 8,
848 Memory64ListStream = 9,
849 CommentStreamA = 10,
850 CommentStreamW = 11,
851 HandleDataStream = 12,
852 FunctionTableStream = 13,
853 UnloadedModuleListStream = 14,
854 MiscInfoStream = 15,
855 MemoryInfoListStream = 16,
856 ThreadInfoListStream = 17,
858 LastReservedStream = 0xffff
859 } MINIDUMP_STREAM_TYPE;
861 BOOL WINAPI MiniDumpWriteDump(HANDLE, DWORD, HANDLE, MINIDUMP_TYPE,
862 const PMINIDUMP_EXCEPTION_INFORMATION,
863 const PMINIDUMP_USER_STREAM_INFORMATION,
864 const PMINIDUMP_CALLBACK_INFORMATION);
865 BOOL WINAPI MiniDumpReadDumpStream(PVOID, ULONG, PMINIDUMP_DIRECTORY*, PVOID*,
866 ULONG*);
868 #include <poppack.h>
870 /*************************
871 * MODULE handling *
872 *************************/
874 /* flags for SymLoadModuleEx */
875 #define SLMFLAG_VIRTUAL 0x1
876 #define SLMFLAG_NO_SYMBOLS 0x4
878 typedef BOOL (CALLBACK *PENUMLOADED_MODULES_CALLBACK64)(PCSTR, DWORD64, ULONG, PVOID);
879 BOOL WINAPI EnumerateLoadedModules64(HANDLE, PENUMLOADED_MODULES_CALLBACK64, PVOID);
880 typedef BOOL (CALLBACK *PENUMLOADED_MODULES_CALLBACKW64)(PCWSTR, DWORD64, ULONG, PVOID);
881 BOOL WINAPI EnumerateLoadedModulesW64(HANDLE, PENUMLOADED_MODULES_CALLBACKW64, PVOID);
882 BOOL WINAPI EnumerateLoadedModulesEx(HANDLE, PENUMLOADED_MODULES_CALLBACK64, PVOID);
883 BOOL WINAPI EnumerateLoadedModulesExW(HANDLE, PENUMLOADED_MODULES_CALLBACKW64, PVOID);
884 typedef BOOL (CALLBACK *PSYM_ENUMMODULES_CALLBACK64)(PCSTR, DWORD64, PVOID);
885 BOOL WINAPI SymEnumerateModules64(HANDLE, PSYM_ENUMMODULES_CALLBACK64, PVOID);
886 typedef BOOL (CALLBACK *PSYM_ENUMMODULES_CALLBACKW64)(PCWSTR, DWORD64, PVOID);
887 BOOL WINAPI SymEnumerateModulesW64(HANDLE, PSYM_ENUMMODULES_CALLBACKW64, PVOID);
888 BOOL WINAPI SymGetModuleInfo64(HANDLE, DWORD64, PIMAGEHLP_MODULE64);
889 BOOL WINAPI SymGetModuleInfoW64(HANDLE, DWORD64, PIMAGEHLP_MODULEW64);
890 DWORD64 WINAPI SymGetModuleBase64(HANDLE, DWORD64);
891 DWORD64 WINAPI SymLoadModule64(HANDLE, HANDLE, PCSTR, PCSTR, DWORD64, DWORD);
892 DWORD64 WINAPI SymLoadModuleEx(HANDLE, HANDLE, PCSTR, PCSTR, DWORD64, DWORD,
893 PMODLOAD_DATA, DWORD);
894 DWORD64 WINAPI SymLoadModuleExW(HANDLE, HANDLE, PCWSTR, PCWSTR, DWORD64, DWORD,
895 PMODLOAD_DATA, DWORD);
896 BOOL WINAPI SymUnloadModule64(HANDLE, DWORD64);
898 /*************************
899 * Symbol Handling *
900 *************************/
902 #define IMAGEHLP_SYMBOL_INFO_VALUEPRESENT 1
903 #define IMAGEHLP_SYMBOL_INFO_REGISTER SYMF_REGISTER /* 0x08 */
904 #define IMAGEHLP_SYMBOL_INFO_REGRELATIVE SYMF_REGREL /* 0x10 */
905 #define IMAGEHLP_SYMBOL_INFO_FRAMERELATIVE SYMF_FRAMEREL /* 0x20 */
906 #define IMAGEHLP_SYMBOL_INFO_PARAMETER SYMF_PARAMETER /* 0x40 */
907 #define IMAGEHLP_SYMBOL_INFO_LOCAL SYMF_LOCAL /* 0x80 */
908 #define IMAGEHLP_SYMBOL_INFO_CONSTANT SYMF_CONSTANT /* 0x100 */
909 #define IMAGEHLP_SYMBOL_FUNCTION SYMF_FUNCTION /* 0x800 */
911 #define SYMFLAG_VALUEPRESENT 0x00000001
912 #define SYMFLAG_REGISTER 0x00000008
913 #define SYMFLAG_REGREL 0x00000010
914 #define SYMFLAG_FRAMEREL 0x00000020
915 #define SYMFLAG_PARAMETER 0x00000040
916 #define SYMFLAG_LOCAL 0x00000080
917 #define SYMFLAG_CONSTANT 0x00000100
918 #define SYMFLAG_EXPORT 0x00000200
919 #define SYMFLAG_FORWARDER 0x00000400
920 #define SYMFLAG_FUNCTION 0x00000800
921 #define SYMFLAG_VIRTUAL 0x00001000
922 #define SYMFLAG_THUNK 0x00002000
923 #define SYMFLAG_TLSREL 0x00004000
924 #define SYMFLAG_SLOT 0x00008000
925 #define SYMFLAG_ILREL 0x00010000
926 #define SYMFLAG_METADATA 0x00020000
927 #define SYMFLAG_CLR_TOKEN 0x00040000
928 #define SYMFLAG_NULL 0x00080000
929 #define SYMFLAG_FUNC_NO_RETURN 0x00100000
930 #define SYMFLAG_SYNTHETIC_ZEROBASE 0x00200000
931 #define SYMFLAG_PUBLIC_CODE 0x00400000
933 #define MAX_SYM_NAME 2000
935 typedef struct _SYMBOL_INFO
937 ULONG SizeOfStruct;
938 ULONG TypeIndex;
939 ULONG64 Reserved[2];
940 ULONG Index;
941 ULONG Size;
942 ULONG64 ModBase;
943 ULONG Flags;
944 ULONG64 Value;
945 ULONG64 Address;
946 ULONG Register;
947 ULONG Scope;
948 ULONG Tag;
949 ULONG NameLen;
950 ULONG MaxNameLen;
951 CHAR Name[1];
952 } SYMBOL_INFO, *PSYMBOL_INFO;
954 typedef struct _SYMBOL_INFOW
956 ULONG SizeOfStruct;
957 ULONG TypeIndex;
958 ULONG64 Reserved[2];
959 ULONG Index;
960 ULONG Size;
961 ULONG64 ModBase;
962 ULONG Flags;
963 ULONG64 Value;
964 ULONG64 Address;
965 ULONG Register;
966 ULONG Scope;
967 ULONG Tag;
968 ULONG NameLen;
969 ULONG MaxNameLen;
970 WCHAR Name[1];
971 } SYMBOL_INFOW, *PSYMBOL_INFOW;
973 typedef struct _SYMBOL_INFO_PACKAGE
975 SYMBOL_INFO si;
976 CHAR name[MAX_SYM_NAME+1];
977 } SYMBOL_INFO_PACKAGE, *PSYMBOL_INFO_PACKAGE;
979 typedef struct _SYMBOL_INFO_PACKAGEW
981 SYMBOL_INFOW si;
982 WCHAR name[MAX_SYM_NAME+1];
983 } SYMBOL_INFO_PACKAGEW, *PSYMBOL_INFO_PACKAGEW;
985 typedef enum _IMAGEHLP_SYMBOL_TYPE_INFO
987 TI_GET_SYMTAG,
988 TI_GET_SYMNAME,
989 TI_GET_LENGTH,
990 TI_GET_TYPE,
991 TI_GET_TYPEID,
992 TI_GET_BASETYPE,
993 TI_GET_ARRAYINDEXTYPEID,
994 TI_FINDCHILDREN,
995 TI_GET_DATAKIND,
996 TI_GET_ADDRESSOFFSET,
997 TI_GET_OFFSET,
998 TI_GET_VALUE,
999 TI_GET_COUNT,
1000 TI_GET_CHILDRENCOUNT,
1001 TI_GET_BITPOSITION,
1002 TI_GET_VIRTUALBASECLASS,
1003 TI_GET_VIRTUALTABLESHAPEID,
1004 TI_GET_VIRTUALBASEPOINTEROFFSET,
1005 TI_GET_CLASSPARENTID,
1006 TI_GET_NESTED,
1007 TI_GET_SYMINDEX,
1008 TI_GET_LEXICALPARENT,
1009 TI_GET_ADDRESS,
1010 TI_GET_THISADJUST,
1011 TI_GET_UDTKIND,
1012 TI_IS_EQUIV_TO,
1013 TI_GET_CALLING_CONVENTION,
1014 TI_IS_CLOSE_EQUIV_TO,
1015 TI_GTIEX_REQS_VALID,
1016 TI_GET_VIRTUALBASEOFFSET,
1017 TI_GET_VIRTUALBASEDISPINDEX,
1018 TI_GET_IS_REFERENCE,
1019 TI_GET_INDIRECTVIRTUALBASECLASS,
1020 TI_GET_VIRTUALBASETABLETYPE,
1021 TI_GET_OBJECTPOINTERTYPE,
1022 IMAGEHLP_SYMBOL_TYPE_INFO_MAX
1023 } IMAGEHLP_SYMBOL_TYPE_INFO;
1025 #define IMAGEHLP_GET_TYPE_INFO_UNCACHED 0x00000001
1026 #define IMAGEHLP_GET_TYPE_INFO_CHILDREN 0x00000002
1027 typedef struct _IMAGEHLP_GET_TYPE_INFO_PARAMS
1029 ULONG SizeOfStruct;
1030 ULONG Flags;
1031 ULONG NumIds;
1032 PULONG TypeIds;
1033 ULONG64 TagFilter;
1034 ULONG NumReqs;
1035 IMAGEHLP_SYMBOL_TYPE_INFO* ReqKinds;
1036 PULONG_PTR ReqOffsets;
1037 PULONG ReqSizes;
1038 ULONG_PTR ReqStride;
1039 ULONG_PTR BufferSize;
1040 PVOID Buffer;
1041 ULONG EntriesMatched;
1042 ULONG EntriesFilled;
1043 ULONG64 TagsFound;
1044 ULONG64 AllReqsValid;
1045 ULONG NumReqsValid;
1046 PULONG64 ReqsValid;
1047 } IMAGEHLP_GET_TYPE_INFO_PARAMS, *PIMAGEHLP_GET_TYPE_INFO_PARAMS;
1049 typedef struct _TI_FINDCHILDREN_PARAMS
1051 ULONG Count;
1052 ULONG Start;
1053 ULONG ChildId[1];
1054 } TI_FINDCHILDREN_PARAMS;
1056 #define UNDNAME_COMPLETE (0x0000)
1057 #define UNDNAME_NO_LEADING_UNDERSCORES (0x0001)
1058 #define UNDNAME_NO_MS_KEYWORDS (0x0002)
1059 #define UNDNAME_NO_FUNCTION_RETURNS (0x0004)
1060 #define UNDNAME_NO_ALLOCATION_MODEL (0x0008)
1061 #define UNDNAME_NO_ALLOCATION_LANGUAGE (0x0010)
1062 #define UNDNAME_NO_MS_THISTYPE (0x0020)
1063 #define UNDNAME_NO_CV_THISTYPE (0x0040)
1064 #define UNDNAME_NO_THISTYPE (0x0060)
1065 #define UNDNAME_NO_ACCESS_SPECIFIERS (0x0080)
1066 #define UNDNAME_NO_THROW_SIGNATURES (0x0100)
1067 #define UNDNAME_NO_MEMBER_TYPE (0x0200)
1068 #define UNDNAME_NO_RETURN_UDT_MODEL (0x0400)
1069 #define UNDNAME_32_BIT_DECODE (0x0800)
1070 #define UNDNAME_NAME_ONLY (0x1000)
1071 #define UNDNAME_NO_ARGUMENTS (0x2000)
1072 #define UNDNAME_NO_SPECIAL_SYMS (0x4000)
1074 #define SYMSEARCH_MASKOBJS 0x01
1075 #define SYMSEARCH_RECURSE 0x02
1076 #define SYMSEARCH_GLOBALSONLY 0x04
1078 BOOL WINAPI SymGetTypeInfo(HANDLE, DWORD64, ULONG, IMAGEHLP_SYMBOL_TYPE_INFO, PVOID);
1079 BOOL WINAPI SymGetTypeInfoEx(HANDLE, DWORD64, PIMAGEHLP_GET_TYPE_INFO_PARAMS);
1080 typedef BOOL (CALLBACK *PSYM_ENUMERATESYMBOLS_CALLBACK)(PSYMBOL_INFO, ULONG, PVOID);
1081 typedef BOOL (CALLBACK *PSYM_ENUMERATESYMBOLS_CALLBACKW)(PSYMBOL_INFOW, ULONG, PVOID);
1082 BOOL WINAPI SymEnumTypes(HANDLE, ULONG64, PSYM_ENUMERATESYMBOLS_CALLBACK, PVOID);
1083 BOOL WINAPI SymEnumTypesW(HANDLE, ULONG64, PSYM_ENUMERATESYMBOLS_CALLBACKW, PVOID);
1084 BOOL WINAPI SymEnumTypesByName(HANDLE, ULONG64, PCSTR, PSYM_ENUMERATESYMBOLS_CALLBACK, PVOID);
1085 BOOL WINAPI SymEnumTypesByNameW(HANDLE, ULONG64, PCWSTR, PSYM_ENUMERATESYMBOLS_CALLBACKW, PVOID);
1086 BOOL WINAPI SymFromAddr(HANDLE, DWORD64, DWORD64*, SYMBOL_INFO*);
1087 BOOL WINAPI SymFromAddrW(HANDLE, DWORD64, DWORD64*, SYMBOL_INFOW*);
1088 BOOL WINAPI SymFromInlineContext(HANDLE, DWORD64, ULONG, PDWORD64, PSYMBOL_INFO);
1089 BOOL WINAPI SymFromInlineContextW(HANDLE, DWORD64, ULONG, PDWORD64, PSYMBOL_INFOW);
1090 BOOL WINAPI SymFromToken(HANDLE, DWORD64, DWORD, PSYMBOL_INFO);
1091 BOOL WINAPI SymFromTokenW(HANDLE, DWORD64, DWORD, PSYMBOL_INFOW);
1092 BOOL WINAPI SymFromName(HANDLE, PCSTR, PSYMBOL_INFO);
1093 BOOL WINAPI SymFromNameW(HANDLE, PCWSTR, PSYMBOL_INFOW);
1094 BOOL WINAPI SymGetSymFromAddr64(HANDLE, DWORD64, PDWORD64, PIMAGEHLP_SYMBOL64);
1095 BOOL WINAPI SymGetSymFromName64(HANDLE, PCSTR, PIMAGEHLP_SYMBOL64);
1096 BOOL WINAPI SymGetTypeFromName(HANDLE, ULONG64, PCSTR, PSYMBOL_INFO);
1097 BOOL WINAPI SymGetTypeFromNameW(HANDLE, ULONG64, PCWSTR, PSYMBOL_INFOW);
1098 BOOL WINAPI SymGetSymNext64(HANDLE, PIMAGEHLP_SYMBOL64);
1099 BOOL WINAPI SymGetSymNextW64(HANDLE, PIMAGEHLP_SYMBOLW64);
1100 BOOL WINAPI SymGetSymPrev64(HANDLE, PIMAGEHLP_SYMBOL64);
1101 BOOL WINAPI SymGetSymPrevW64(HANDLE, PIMAGEHLP_SYMBOLW64);
1102 BOOL WINAPI SymEnumSym(HANDLE,ULONG64,PSYM_ENUMERATESYMBOLS_CALLBACK,PVOID);
1103 BOOL WINAPI SymEnumSymbols(HANDLE, ULONG64, PCSTR, PSYM_ENUMERATESYMBOLS_CALLBACK,
1104 PVOID);
1105 BOOL WINAPI SymEnumSymbolsW(HANDLE, ULONG64, PCWSTR, PSYM_ENUMERATESYMBOLS_CALLBACKW,
1106 PVOID);
1107 typedef BOOL (CALLBACK *PSYM_ENUMSYMBOLS_CALLBACK64)(PCSTR, DWORD64, ULONG, PVOID);
1108 typedef BOOL (CALLBACK *PSYM_ENUMSYMBOLS_CALLBACK64W)(PCWSTR, DWORD64, ULONG, PVOID);
1109 BOOL WINAPI SymEnumerateSymbols64(HANDLE, ULONG64, PSYM_ENUMSYMBOLS_CALLBACK64, PVOID);
1110 BOOL WINAPI SymEnumerateSymbolsW64(HANDLE, ULONG64, PSYM_ENUMSYMBOLS_CALLBACK64W, PVOID);
1111 BOOL WINAPI SymEnumSymbolsForAddr(HANDLE, DWORD64, PSYM_ENUMERATESYMBOLS_CALLBACK, PVOID);
1112 BOOL WINAPI SymEnumSymbolsForAddrW(HANDLE, DWORD64, PSYM_ENUMERATESYMBOLS_CALLBACKW, PVOID);
1113 typedef BOOL (CALLBACK *PSYMBOL_REGISTERED_CALLBACK64)(HANDLE, ULONG, ULONG64, ULONG64);
1114 BOOL WINAPI SymRegisterCallback64(HANDLE, PSYMBOL_REGISTERED_CALLBACK64, ULONG64);
1115 BOOL WINAPI SymRegisterCallbackW64(HANDLE, PSYMBOL_REGISTERED_CALLBACK64, ULONG64);
1116 BOOL WINAPI SymUnDName64(PIMAGEHLP_SYMBOL64, PSTR, DWORD);
1117 BOOL WINAPI SymMatchString(PCSTR, PCSTR, BOOL);
1118 BOOL WINAPI SymMatchStringA(PCSTR, PCSTR, BOOL);
1119 BOOL WINAPI SymMatchStringW(PCWSTR, PCWSTR, BOOL);
1120 BOOL WINAPI SymSearch(HANDLE, ULONG64, DWORD, DWORD, PCSTR, DWORD64, PSYM_ENUMERATESYMBOLS_CALLBACK, PVOID, DWORD);
1121 BOOL WINAPI SymSearchW(HANDLE, ULONG64, DWORD, DWORD, PCWSTR, DWORD64, PSYM_ENUMERATESYMBOLS_CALLBACKW, PVOID, DWORD);
1122 DWORD WINAPI UnDecorateSymbolName(PCSTR, PSTR, DWORD, DWORD);
1123 DWORD WINAPI UnDecorateSymbolNameW(PCWSTR, PWSTR, DWORD, DWORD);
1124 BOOL WINAPI SymGetScope(HANDLE, ULONG64, DWORD, PSYMBOL_INFO);
1125 BOOL WINAPI SymGetScopeW(HANDLE, ULONG64, DWORD, PSYMBOL_INFOW);
1126 BOOL WINAPI SymFromIndex(HANDLE, ULONG64, DWORD, PSYMBOL_INFO);
1127 BOOL WINAPI SymFromIndexW(HANDLE, ULONG64, DWORD, PSYMBOL_INFOW);
1128 BOOL WINAPI SymAddSymbol(HANDLE, ULONG64, PCSTR, DWORD64, DWORD, DWORD);
1129 BOOL WINAPI SymAddSymbolW(HANDLE, ULONG64, PCWSTR, DWORD64, DWORD, DWORD);
1130 BOOL WINAPI SymDeleteSymbol(HANDLE, ULONG64, PCSTR, DWORD64, DWORD);
1131 BOOL WINAPI SymDeleteSymbolW(HANDLE, ULONG64, PCWSTR, DWORD64, DWORD);
1133 typedef struct _OMAP
1135 ULONG rva;
1136 ULONG rvaTo;
1137 } OMAP, *POMAP;
1139 BOOL WINAPI SymGetOmaps(HANDLE, DWORD64, POMAP*, PDWORD64, POMAP*, PDWORD64);
1141 /*************************
1142 * Source Files *
1143 *************************/
1144 typedef BOOL (CALLBACK *PSYM_ENUMSOURCEFILES_CALLBACK)(PSOURCEFILE, PVOID);
1145 typedef BOOL (CALLBACK *PSYM_ENUMSOURCEFILES_CALLBACKW)(PSOURCEFILEW, PVOID);
1147 BOOL WINAPI SymEnumSourceFiles(HANDLE, ULONG64, PCSTR, PSYM_ENUMSOURCEFILES_CALLBACK,
1148 PVOID);
1149 BOOL WINAPI SymEnumSourceFilesW(HANDLE, ULONG64, PCWSTR, PSYM_ENUMSOURCEFILES_CALLBACKW, PVOID);
1150 BOOL WINAPI SymGetLineFromAddr64(HANDLE, DWORD64, PDWORD, PIMAGEHLP_LINE64);
1151 BOOL WINAPI SymGetLineFromAddrW64(HANDLE, DWORD64, PDWORD, PIMAGEHLP_LINEW64);
1152 BOOL WINAPI SymGetLineFromInlineContext(HANDLE, DWORD64, ULONG, DWORD64, PDWORD, PIMAGEHLP_LINE64);
1153 BOOL WINAPI SymGetLineFromInlineContextW(HANDLE, DWORD64, ULONG, DWORD64, PDWORD, PIMAGEHLP_LINEW64);
1154 BOOL WINAPI SymGetLinePrev64(HANDLE, PIMAGEHLP_LINE64);
1155 BOOL WINAPI SymGetLinePrevW64(HANDLE, PIMAGEHLP_LINEW64);
1156 BOOL WINAPI SymGetLineNext64(HANDLE, PIMAGEHLP_LINE64);
1157 BOOL WINAPI SymGetLineNextW64(HANDLE, PIMAGEHLP_LINEW64);
1158 BOOL WINAPI SymGetLineFromName64(HANDLE, PCSTR, PCSTR, DWORD, PLONG, PIMAGEHLP_LINE64);
1159 BOOL WINAPI SymGetLineFromNameW64(HANDLE, PCWSTR, PCWSTR, DWORD, PLONG, PIMAGEHLP_LINEW64);
1160 ULONG WINAPI SymGetFileLineOffsets64(HANDLE, PCSTR, PCSTR, PDWORD64, ULONG);
1161 BOOL WINAPI SymGetSourceFile(HANDLE, ULONG64, PCSTR, PCSTR, PSTR, DWORD);
1162 BOOL WINAPI SymGetSourceFileW(HANDLE, ULONG64, PCWSTR, PCWSTR, PWSTR, DWORD);
1163 BOOL WINAPI SymGetSourceFileToken(HANDLE, ULONG64, PCSTR, PVOID*, DWORD*);
1164 BOOL WINAPI SymGetSourceFileTokenW(HANDLE, ULONG64, PCWSTR, PVOID*, DWORD*);
1165 BOOL WINAPI SymGetSourceFileFromToken(HANDLE, PVOID, PCSTR, PSTR, DWORD);
1166 BOOL WINAPI SymGetSourceFileFromTokenW(HANDLE, PVOID, PCWSTR, PWSTR, DWORD);
1167 BOOL WINAPI SymGetSourceVarFromToken(HANDLE, PVOID, PCSTR, PCSTR, PSTR, DWORD);
1168 BOOL WINAPI SymGetSourceVarFromTokenW(HANDLE, PVOID, PCWSTR, PCWSTR, PWSTR, DWORD);
1170 typedef struct _SRCCODEINFO
1172 DWORD SizeOfStruct;
1173 PVOID Key;
1174 DWORD64 ModBase;
1175 CHAR Obj[MAX_PATH+1];
1176 CHAR FileName[MAX_PATH+1];
1177 DWORD LineNumber;
1178 DWORD64 Address;
1179 } SRCCODEINFO, *PSRCCODEINFO;
1181 typedef struct _SRCCODEINFOW
1183 DWORD SizeOfStruct;
1184 PVOID Key;
1185 DWORD64 ModBase;
1186 WCHAR Obj[MAX_PATH+1];
1187 WCHAR FileName[MAX_PATH+1];
1188 DWORD LineNumber;
1189 DWORD64 Address;
1190 } SRCCODEINFOW, *PSRCCODEINFOW;
1192 typedef BOOL (CALLBACK* PSYM_ENUMLINES_CALLBACK)(PSRCCODEINFO, PVOID);
1193 typedef BOOL (CALLBACK* PSYM_ENUMLINES_CALLBACKW)(PSRCCODEINFOW, PVOID);
1194 BOOL WINAPI SymEnumLines(HANDLE, ULONG64, PCSTR, PCSTR, PSYM_ENUMLINES_CALLBACK, PVOID);
1195 BOOL WINAPI SymEnumLinesW(HANDLE, ULONG64, PCWSTR, PCWSTR, PSYM_ENUMLINES_CALLBACKW, PVOID);
1196 BOOL WINAPI SymEnumSourceLines(HANDLE, ULONG64, PCSTR, PCSTR, DWORD, DWORD, PSYM_ENUMLINES_CALLBACK, PVOID);
1197 BOOL WINAPI SymEnumSourceLinesW(HANDLE, ULONG64, PCWSTR, PCWSTR, DWORD, DWORD, PSYM_ENUMLINES_CALLBACKW, PVOID);
1199 /*************************
1200 * File & image handling *
1201 *************************/
1202 BOOL WINAPI SymInitialize(HANDLE, PCSTR, BOOL);
1203 BOOL WINAPI SymInitializeW(HANDLE, PCWSTR, BOOL);
1204 BOOL WINAPI SymCleanup(HANDLE);
1206 HANDLE WINAPI FindDebugInfoFile(PCSTR, PCSTR, PSTR);
1207 typedef BOOL (CALLBACK *PFIND_DEBUG_FILE_CALLBACK)(HANDLE, PCSTR, PVOID);
1208 typedef BOOL (CALLBACK *PFIND_DEBUG_FILE_CALLBACKW)(HANDLE, PCWSTR, PVOID);
1209 HANDLE WINAPI FindDebugInfoFileEx(PCSTR, PCSTR, PSTR, PFIND_DEBUG_FILE_CALLBACK, PVOID);
1210 HANDLE WINAPI FindDebugInfoFileExW(PCWSTR, PCWSTR, PWSTR, PFIND_DEBUG_FILE_CALLBACKW, PVOID);
1211 HANDLE WINAPI SymFindDebugInfoFile(HANDLE, PCSTR, PSTR, PFIND_DEBUG_FILE_CALLBACK, PVOID);
1212 HANDLE WINAPI SymFindDebugInfoFileW(HANDLE, PCWSTR, PWSTR, PFIND_DEBUG_FILE_CALLBACKW, PVOID);
1213 typedef BOOL (CALLBACK *PFINDFILEINPATHCALLBACK)(PCSTR, PVOID);
1214 typedef BOOL (CALLBACK *PFINDFILEINPATHCALLBACKW)(PCWSTR, PVOID);
1215 BOOL WINAPI FindFileInPath(HANDLE, PCSTR, PCSTR, PVOID, DWORD, DWORD, DWORD,
1216 PSTR, PFINDFILEINPATHCALLBACK, PVOID);
1217 BOOL WINAPI SymFindFileInPath(HANDLE, PCSTR, PCSTR, PVOID, DWORD, DWORD, DWORD,
1218 PSTR, PFINDFILEINPATHCALLBACK, PVOID);
1219 BOOL WINAPI SymFindFileInPathW(HANDLE, PCWSTR, PCWSTR, PVOID, DWORD, DWORD, DWORD,
1220 PWSTR, PFINDFILEINPATHCALLBACKW, PVOID);
1221 HANDLE WINAPI FindExecutableImage(PCSTR, PCSTR, PSTR);
1222 typedef BOOL (CALLBACK *PFIND_EXE_FILE_CALLBACK)(HANDLE, PCSTR, PVOID);
1223 typedef BOOL (CALLBACK *PFIND_EXE_FILE_CALLBACKW)(HANDLE, PCWSTR, PVOID);
1224 HANDLE WINAPI FindExecutableImageEx(PCSTR, PCSTR, PSTR, PFIND_EXE_FILE_CALLBACK, PVOID);
1225 HANDLE WINAPI FindExecutableImageExW(PCWSTR, PCWSTR, PWSTR, PFIND_EXE_FILE_CALLBACKW, PVOID);
1226 HANDLE WINAPI SymFindExecutableImage(HANDLE, PCSTR, PSTR, PFIND_EXE_FILE_CALLBACK, PVOID);
1227 HANDLE WINAPI SymFindExecutableImageW(HANDLE, PCWSTR, PWSTR, PFIND_EXE_FILE_CALLBACKW, PVOID);
1228 PIMAGE_NT_HEADERS WINAPI ImageNtHeader(PVOID);
1229 PVOID WINAPI ImageDirectoryEntryToDataEx(PVOID, BOOLEAN, USHORT, PULONG,
1230 PIMAGE_SECTION_HEADER *);
1231 PVOID WINAPI ImageDirectoryEntryToData(PVOID, BOOLEAN, USHORT, PULONG);
1232 PIMAGE_SECTION_HEADER WINAPI ImageRvaToSection(PIMAGE_NT_HEADERS, PVOID, ULONG);
1233 PVOID WINAPI ImageRvaToVa(PIMAGE_NT_HEADERS, PVOID, ULONG, PIMAGE_SECTION_HEADER*);
1234 BOOL WINAPI SymGetSearchPath(HANDLE, PSTR, DWORD);
1235 BOOL WINAPI SymGetSearchPathW(HANDLE, PWSTR, DWORD);
1236 BOOL WINAPI SymSetSearchPath(HANDLE, PCSTR);
1237 BOOL WINAPI SymSetSearchPathW(HANDLE, PCWSTR);
1238 DWORD WINAPI GetTimestampForLoadedLibrary(HMODULE);
1239 BOOL WINAPI MakeSureDirectoryPathExists(PCSTR);
1240 BOOL WINAPI SearchTreeForFile(PCSTR, PCSTR, PSTR);
1241 BOOL WINAPI SearchTreeForFileW(PCWSTR, PCWSTR, PWSTR);
1242 typedef BOOL (CALLBACK *PENUMDIRTREE_CALLBACK)(PCSTR, PVOID);
1243 typedef BOOL (CALLBACK *PENUMDIRTREE_CALLBACKW)(PCWSTR, PVOID);
1244 BOOL WINAPI EnumDirTree(HANDLE, PCSTR, PCSTR, PSTR, PENUMDIRTREE_CALLBACK, PVOID);
1245 BOOL WINAPI EnumDirTreeW(HANDLE, PCWSTR, PCWSTR, PWSTR, PENUMDIRTREE_CALLBACKW, PVOID);
1246 BOOL WINAPI SymMatchFileName(PCSTR, PCSTR, PSTR*, PSTR*);
1247 BOOL WINAPI SymMatchFileNameW(PCWSTR, PCWSTR, PWSTR*, PWSTR*);
1248 PCHAR WINAPI SymSetHomeDirectory(HANDLE, PCSTR);
1249 PWSTR WINAPI SymSetHomeDirectoryW(HANDLE, PCWSTR);
1250 PCHAR WINAPI SymGetHomeDirectory(DWORD, PSTR, size_t);
1251 PWSTR WINAPI SymGetHomeDirectoryW(DWORD, PWSTR, size_t);
1252 #define hdBase 0
1253 #define hdSym 1
1254 #define hdSrc 2
1255 #define hdMax 3
1257 /*************************
1258 * Context management *
1259 *************************/
1260 BOOL WINAPI SymSetContext(HANDLE, PIMAGEHLP_STACK_FRAME, PIMAGEHLP_CONTEXT);
1261 BOOL WINAPI SymSetScopeFromIndex(HANDLE, ULONG64, ULONG);
1262 BOOL WINAPI SymSetScopeFromAddr(HANDLE, ULONG64);
1263 BOOL WINAPI SymSetScopeFromInlineContext(HANDLE, ULONG64, ULONG);
1265 /*************************
1266 * Stack management *
1267 *************************/
1269 #if !defined(_IMAGEHLP_SOURCE_) && defined(_IMAGEHLP64)
1270 #define KDHELP KDHELP64
1271 #define PKDHELP PKDHELP64
1272 #else
1273 typedef struct _KDHELP
1275 DWORD Thread;
1276 DWORD ThCallbackStack;
1277 DWORD NextCallback;
1278 DWORD FramePointer;
1279 DWORD KiCallUserMode;
1280 DWORD KeUserCallbackDispatcher;
1281 DWORD SystemRangeStart;
1282 } KDHELP, *PKDHELP;
1283 #endif
1285 typedef struct _KDHELP64
1287 DWORD64 Thread;
1288 DWORD ThCallbackStack;
1289 DWORD ThCallbackBStore;
1290 DWORD NextCallback;
1291 DWORD FramePointer;
1292 DWORD64 KiCallUserMode;
1293 DWORD64 KeUserCallbackDispatcher;
1294 DWORD64 SystemRangeStart;
1295 DWORD64 Reserved[8];
1296 } KDHELP64, *PKDHELP64;
1298 #if !defined(_IMAGEHLP_SOURCE_) && defined(_IMAGEHLP64)
1299 #define STACKFRAME STACKFRAME64
1300 #define LPSTACKFRAME LPSTACKFRAME64
1301 #else
1302 typedef struct _STACKFRAME
1304 ADDRESS AddrPC;
1305 ADDRESS AddrReturn;
1306 ADDRESS AddrFrame;
1307 ADDRESS AddrStack;
1308 PVOID FuncTableEntry;
1309 DWORD Params[4];
1310 BOOL Far;
1311 BOOL Virtual;
1312 DWORD Reserved[3];
1313 KDHELP KdHelp;
1314 ADDRESS AddrBStore;
1315 } STACKFRAME, *LPSTACKFRAME;
1316 #endif
1318 typedef struct _STACKFRAME64
1320 ADDRESS64 AddrPC;
1321 ADDRESS64 AddrReturn;
1322 ADDRESS64 AddrFrame;
1323 ADDRESS64 AddrStack;
1324 ADDRESS64 AddrBStore;
1325 PVOID FuncTableEntry;
1326 DWORD64 Params[4];
1327 BOOL Far;
1328 BOOL Virtual;
1329 DWORD64 Reserved[3];
1330 KDHELP64 KdHelp;
1331 } STACKFRAME64, *LPSTACKFRAME64;
1333 #define INLINE_FRAME_CONTEXT_INIT 0
1334 #define INLINE_FRAME_CONTEXT_IGNORE 0xFFFFFFFF
1336 typedef struct _tagSTACKFRAME_EX
1338 ADDRESS64 AddrPC;
1339 ADDRESS64 AddrReturn;
1340 ADDRESS64 AddrFrame;
1341 ADDRESS64 AddrStack;
1342 ADDRESS64 AddrBStore;
1343 PVOID FuncTableEntry;
1344 DWORD64 Params[4];
1345 BOOL Far;
1346 BOOL Virtual;
1347 DWORD64 Reserved[3];
1348 KDHELP64 KdHelp;
1350 DWORD StackFrameSize;
1351 DWORD InlineFrameContext;
1352 } STACKFRAME_EX, *LPSTACKFRAME_EX;
1355 typedef BOOL (CALLBACK *PREAD_PROCESS_MEMORY_ROUTINE64)
1356 (HANDLE, DWORD64, PVOID, DWORD, PDWORD);
1357 typedef PVOID (CALLBACK *PFUNCTION_TABLE_ACCESS_ROUTINE64)(HANDLE, DWORD64);
1358 typedef DWORD64 (CALLBACK *PGET_MODULE_BASE_ROUTINE64)(HANDLE, DWORD64);
1359 typedef DWORD64 (CALLBACK *PTRANSLATE_ADDRESS_ROUTINE64)(HANDLE, HANDLE, LPADDRESS64);
1360 BOOL WINAPI StackWalk64(DWORD, HANDLE, HANDLE, LPSTACKFRAME64, PVOID,
1361 PREAD_PROCESS_MEMORY_ROUTINE64,
1362 PFUNCTION_TABLE_ACCESS_ROUTINE64,
1363 PGET_MODULE_BASE_ROUTINE64,
1364 PTRANSLATE_ADDRESS_ROUTINE64);
1365 #define SYM_STKWALK_DEFAULT 0x00000000
1366 #define SYM_STKWALK_FORCE_FRAMEPTR 0x00000001
1367 BOOL WINAPI StackWalkEx(DWORD, HANDLE, HANDLE, LPSTACKFRAME_EX, PVOID,
1368 PREAD_PROCESS_MEMORY_ROUTINE64,
1369 PFUNCTION_TABLE_ACCESS_ROUTINE64,
1370 PGET_MODULE_BASE_ROUTINE64,
1371 PTRANSLATE_ADDRESS_ROUTINE64,
1372 DWORD);
1373 PVOID WINAPI SymFunctionTableAccess64(HANDLE, DWORD64);
1375 typedef PVOID (CALLBACK *PSYMBOL_FUNCENTRY_CALLBACK64)(HANDLE, ULONG64, ULONG64);
1377 BOOL WINAPI SymRegisterFunctionEntryCallback64(HANDLE, PSYMBOL_FUNCENTRY_CALLBACK64, ULONG64);
1378 BOOL WINAPI SymGetUnwindInfo(HANDLE, DWORD64, PVOID, PULONG);
1380 /* Inline context related APIs */
1381 DWORD WINAPI SymAddrIncludeInlineTrace(HANDLE, DWORD64);
1383 #define SYM_INLINE_COMP_ERROR 0
1384 #define SYM_INLINE_COMP_IDENTICAL 1
1385 #define SYM_INLINE_COMP_STEPIN 2
1386 #define SYM_INLINE_COMP_STEPOUT 3
1387 #define SYM_INLINE_COMP_STEPOVER 4
1388 #define SYM_INLINE_COMP_DIFFERENT 5
1390 DWORD WINAPI SymCompareInlineTrace(HANDLE, DWORD64, DWORD, DWORD64, DWORD64, DWORD64);
1391 BOOL WINAPI SymQueryInlineTrace(HANDLE, DWORD64, DWORD, DWORD64, DWORD64, LPDWORD, LPDWORD);
1393 /*************************
1394 * Version, global stuff *
1395 *************************/
1397 #define API_VERSION_NUMBER 9
1399 typedef struct API_VERSION
1401 USHORT MajorVersion;
1402 USHORT MinorVersion;
1403 USHORT Revision;
1404 USHORT Reserved;
1405 } API_VERSION, *LPAPI_VERSION;
1407 LPAPI_VERSION WINAPI ImagehlpApiVersion(void);
1408 LPAPI_VERSION WINAPI ImagehlpApiVersionEx(LPAPI_VERSION);
1410 #ifndef _WIN64
1411 typedef struct _IMAGE_DEBUG_INFORMATION
1413 LIST_ENTRY List;
1414 DWORD ReservedSize;
1415 PVOID ReservedMappedBase;
1416 USHORT ReservedMachine;
1417 USHORT ReservedCharacteristics;
1418 DWORD ReservedCheckSum;
1419 DWORD ImageBase;
1420 DWORD SizeOfImage;
1421 DWORD ReservedNumberOfSections;
1422 PIMAGE_SECTION_HEADER ReservedSections;
1423 DWORD ReservedExportedNamesSize;
1424 PSTR ReservedExportedNames;
1425 DWORD ReservedNumberOfFunctionTableEntries;
1426 PIMAGE_FUNCTION_ENTRY ReservedFunctionTableEntries;
1427 DWORD ReservedLowestFunctionStartingAddress;
1428 DWORD ReservedHighestFunctionEndingAddress;
1429 DWORD ReservedNumberOfFpoTableEntries;
1430 PFPO_DATA ReservedFpoTableEntries;
1431 DWORD SizeOfCoffSymbols;
1432 PIMAGE_COFF_SYMBOLS_HEADER CoffSymbols;
1433 DWORD ReservedSizeOfCodeViewSymbols;
1434 PVOID ReservedCodeViewSymbols;
1435 PSTR ImageFilePath;
1436 PSTR ImageFileName;
1437 PSTR ReservedDebugFilePath;
1438 DWORD ReservedTimeDateStamp;
1439 BOOL ReservedRomImage;
1440 PIMAGE_DEBUG_DIRECTORY ReservedDebugDirectory;
1441 DWORD ReservedNumberOfDebugDirectories;
1442 DWORD ReservedOriginalFunctionTableBaseAddress;
1443 DWORD Reserved[ 2 ];
1444 } IMAGE_DEBUG_INFORMATION, *PIMAGE_DEBUG_INFORMATION;
1446 PIMAGE_DEBUG_INFORMATION WINAPI MapDebugInformation(HANDLE, PCSTR, PCSTR, ULONG);
1447 BOOL WINAPI UnmapDebugInformation(PIMAGE_DEBUG_INFORMATION);
1448 #endif
1450 typedef enum
1452 SYMOPT_EX_DISABLEACCESSTIMEUPDATE,
1453 SYMOPT_EX_MAX,
1455 #ifdef __WINESRC__
1456 SYMOPT_EX_WINE_NATIVE_MODULES = 1000,
1457 #endif
1458 } IMAGEHLP_EXTENDED_OPTIONS;
1460 DWORD WINAPI SymGetOptions(void);
1461 DWORD WINAPI SymSetOptions(DWORD);
1463 BOOL WINAPI SymGetExtendedOption(IMAGEHLP_EXTENDED_OPTIONS option);
1464 BOOL WINAPI SymSetExtendedOption(IMAGEHLP_EXTENDED_OPTIONS option, BOOL value);
1466 BOOL WINAPI SymSetParentWindow(HWND);
1468 /*************************
1469 * Version, global stuff *
1470 *************************/
1472 typedef BOOL (WINAPI* PSYMBOLSERVERPROC)(PCSTR, PCSTR, PVOID, DWORD, DWORD, PSTR);
1473 typedef BOOL (WINAPI* PSYMBOLSERVERPROCA)(PCSTR, PCSTR, PVOID, DWORD, DWORD, PSTR);
1474 typedef BOOL (WINAPI* PSYMBOLSERVERPROCW)(PCWSTR, PCWSTR, PVOID, DWORD, DWORD, PWSTR);
1475 typedef BOOL (WINAPI* PSYMBOLSERVEROPENPROC)(void);
1476 typedef BOOL (WINAPI* PSYMBOLSERVERCLOSEPROC)(void);
1477 typedef BOOL (WINAPI* PSYMBOLSERVERSETOPTIONSPROC)(UINT_PTR, ULONG64);
1478 typedef BOOL (CALLBACK* PSYMBOLSERVERCALLBACKPROC)(UINT_PTR, ULONG64, ULONG64);
1479 typedef UINT_PTR (WINAPI* PSYMBOLSERVERGETOPTIONSPROC)(void);
1480 typedef BOOL (WINAPI* PSYMBOLSERVERPINGPROC)(PCSTR);
1481 typedef BOOL (WINAPI* PSYMBOLSERVERPINGPROCA)(PCSTR);
1482 typedef BOOL (WINAPI* PSYMBOLSERVERPINGPROCW)(PCWSTR);
1484 #define SSRVOPT_CALLBACK 0x0001
1485 #define SSRVOPT_DWORD 0x0002
1486 #define SSRVOPT_DWORDPTR 0x0004
1487 #define SSRVOPT_GUIDPTR 0x0008
1488 #define SSRVOPT_OLDGUIDPTR 0x0010
1489 #define SSRVOPT_UNATTENDED 0x0020
1490 #define SSRVOPT_NOCOPY 0x0040
1491 #define SSRVOPT_PARENTWIN 0x0080
1492 #define SSRVOPT_PARAMTYPE 0x0100
1493 #define SSRVOPT_SECURE 0x0200
1494 #define SSRVOPT_TRACE 0x0400
1495 #define SSRVOPT_SETCONTEXT 0x0800
1496 #define SSRVOPT_PROXY 0x1000
1497 #define SSRVOPT_DOWNSTREAM_STORE 0x2000
1498 #define SSRVOPT_RESET ((ULONG_PTR)-1)
1500 #define SSRVACTION_TRACE 1
1501 #define SSRVACTION_QUERYCANCEL 2
1502 #define SSRVACTION_EVENT 3
1504 /* 32-bit functions */
1506 #if !defined(_IMAGEHLP_SOURCE_) && defined(_IMAGEHLP64)
1508 #define PENUMLOADED_MODULES_CALLBACK PENUMLOADED_MODULES_CALLBACK64
1509 #define PFUNCTION_TABLE_ACCESS_ROUTINE PFUNCTION_TABLE_ACCESS_ROUTINE64
1510 #define PGET_MODULE_BASE_ROUTINE PGET_MODULE_BASE_ROUTINE64
1511 #define PREAD_PROCESS_MEMORY_ROUTINE PREAD_PROCESS_MEMORY_ROUTINE64
1512 #define PSYMBOL_FUNCENTRY_CALLBACK PSYMBOL_FUNCENTRY_CALLBACK64
1513 #define PSYMBOL_REGISTERED_CALLBACK PSYMBOL_REGISTERED_CALLBACK64
1514 #define PSYM_ENUMMODULES_CALLBACK PSYM_ENUMMODULES_CALLBACK64
1515 #define PSYM_ENUMSYMBOLS_CALLBACK PSYM_ENUMSYMBOLS_CALLBACK64
1516 #define PSYM_ENUMSYMBOLS_CALLBACKW PSYM_ENUMSYMBOLS_CALLBACKW64
1517 #define PTRANSLATE_ADDRESS_ROUTINE PTRANSLATE_ADDRESS_ROUTINE64
1519 #define EnumerateLoadedModules EnumerateLoadedModules64
1520 #define StackWalk StackWalk64
1521 #define SymEnumerateModules SymEnumerateModules64
1522 #define SymEnumerateSymbols SymEnumerateSymbols64
1523 #define SymEnumerateSymbolsW SymEnumerateSymbolsW64
1524 #define SymFunctionTableAccess SymFunctionTableAccess64
1525 #define SymGetLineFromAddr SymGetLineFromAddr64
1526 #define SymGetLineFromAddrW SymGetLineFromAddrW64
1527 #define SymGetLineFromName SymGetLineFromName64
1528 #define SymGetLineNext SymGetLineNext64
1529 #define SymGetLineNextW SymGetLineNextW64
1530 #define SymGetLinePrev SymGetLinePrev64
1531 #define SymGetLinePrevW SymGetLinePrevW64
1532 #define SymGetModuleBase SymGetModuleBase64
1533 #define SymGetModuleInfo SymGetModuleInfo64
1534 #define SymGetModuleInfoW SymGetModuleInfoW64
1535 #define SymGetSymFromAddr SymGetSymFromAddr64
1536 #define SymGetSymFromName SymGetSymFromName64
1537 #define SymGetSymNext SymGetSymNext64
1538 #define SymGetSymNextW SymGetSymNextW64
1539 #define SymGetSymPrev SymGetSymPrev64
1540 #define SymGetSymPrevW SymGetSymPrevW64
1541 #define SymLoadModule SymLoadModule64
1542 #define SymRegisterCallback SymRegisterCallback64
1543 #define SymRegisterFunctionEntryCallback SymRegisterFunctionEntryCallback64
1544 #define SymUnDName SymUnDName64
1545 #define SymUnloadModule SymUnloadModule64
1547 #else
1549 typedef BOOL (CALLBACK *PENUMLOADED_MODULES_CALLBACK)(PCSTR, ULONG, ULONG, PVOID);
1550 typedef PVOID (CALLBACK *PFUNCTION_TABLE_ACCESS_ROUTINE)(HANDLE, DWORD);
1551 typedef DWORD (CALLBACK *PGET_MODULE_BASE_ROUTINE)(HANDLE, DWORD);
1552 typedef BOOL (CALLBACK *PREAD_PROCESS_MEMORY_ROUTINE)(HANDLE, DWORD, PVOID, DWORD, PDWORD);
1553 typedef BOOL (CALLBACK *PSYM_ENUMMODULES_CALLBACK)(PCSTR, ULONG, PVOID);
1554 typedef BOOL (CALLBACK *PSYM_ENUMSYMBOLS_CALLBACK)(PCSTR, ULONG, ULONG, PVOID);
1555 typedef BOOL (CALLBACK *PSYM_ENUMSYMBOLS_CALLBACKW)(PCWSTR, ULONG, ULONG, PVOID);
1556 typedef BOOL (CALLBACK *PSYMBOL_REGISTERED_CALLBACK)(HANDLE, ULONG, PVOID, PVOID);
1557 typedef PVOID (CALLBACK *PSYMBOL_FUNCENTRY_CALLBACK)(HANDLE, DWORD, PVOID);
1558 typedef DWORD (CALLBACK *PTRANSLATE_ADDRESS_ROUTINE)(HANDLE, HANDLE, LPADDRESS);
1560 BOOL WINAPI EnumerateLoadedModules(HANDLE, PENUMLOADED_MODULES_CALLBACK, PVOID);
1561 BOOL WINAPI StackWalk(DWORD, HANDLE, HANDLE, LPSTACKFRAME, PVOID, PREAD_PROCESS_MEMORY_ROUTINE, PFUNCTION_TABLE_ACCESS_ROUTINE, PGET_MODULE_BASE_ROUTINE, PTRANSLATE_ADDRESS_ROUTINE);
1562 BOOL WINAPI SymEnumerateModules(HANDLE, PSYM_ENUMMODULES_CALLBACK, PVOID);
1563 BOOL WINAPI SymEnumerateSymbols(HANDLE, ULONG, PSYM_ENUMSYMBOLS_CALLBACK, PVOID);
1564 BOOL WINAPI SymEnumerateSymbolsW(HANDLE, ULONG, PSYM_ENUMSYMBOLS_CALLBACKW, PVOID);
1565 PVOID WINAPI SymFunctionTableAccess(HANDLE, DWORD);
1566 BOOL WINAPI SymGetLineFromAddr(HANDLE, DWORD, PDWORD, PIMAGEHLP_LINE);
1567 BOOL WINAPI SymGetLineFromAddrW(HANDLE, DWORD, PDWORD, PIMAGEHLP_LINEW);
1568 BOOL WINAPI SymGetLineFromName(HANDLE, PCSTR, PCSTR, DWORD, PLONG, PIMAGEHLP_LINE);
1569 BOOL WINAPI SymGetLineNext(HANDLE, PIMAGEHLP_LINE);
1570 BOOL WINAPI SymGetLineNextW(HANDLE, PIMAGEHLP_LINEW);
1571 BOOL WINAPI SymGetLinePrev(HANDLE, PIMAGEHLP_LINE);
1572 BOOL WINAPI SymGetLinePrevW(HANDLE, PIMAGEHLP_LINEW);
1573 DWORD WINAPI SymGetModuleBase(HANDLE, DWORD);
1574 BOOL WINAPI SymGetModuleInfo(HANDLE, DWORD, PIMAGEHLP_MODULE);
1575 BOOL WINAPI SymGetModuleInfoW(HANDLE, DWORD, PIMAGEHLP_MODULEW);
1576 BOOL WINAPI SymGetSymFromAddr(HANDLE, DWORD, PDWORD, PIMAGEHLP_SYMBOL);
1577 BOOL WINAPI SymGetSymFromName(HANDLE, PCSTR, PIMAGEHLP_SYMBOL);
1578 BOOL WINAPI SymGetSymNext(HANDLE, PIMAGEHLP_SYMBOL);
1579 BOOL WINAPI SymGetSymNextW(HANDLE, PIMAGEHLP_SYMBOLW);
1580 BOOL WINAPI SymGetSymPrev(HANDLE, PIMAGEHLP_SYMBOL);
1581 BOOL WINAPI SymGetSymPrevW(HANDLE, PIMAGEHLP_SYMBOLW);
1582 DWORD WINAPI SymLoadModule(HANDLE, HANDLE, PCSTR, PCSTR, DWORD, DWORD);
1583 BOOL WINAPI SymRegisterCallback(HANDLE, PSYMBOL_REGISTERED_CALLBACK, PVOID);
1584 BOOL WINAPI SymRegisterFunctionEntryCallback(HANDLE, PSYMBOL_FUNCENTRY_CALLBACK, PVOID);
1585 BOOL WINAPI SymRefreshModuleList(HANDLE);
1586 BOOL WINAPI SymUnDName(PIMAGEHLP_SYMBOL, PSTR, DWORD);
1587 BOOL WINAPI SymUnloadModule(HANDLE, DWORD);
1589 #endif
1591 #ifdef __cplusplus
1592 } /* extern "C" */
1593 #endif /* defined(__cplusplus) */
1595 #endif /* __WINE_DBGHELP_H */