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