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) */
28 #ifndef __deref_out_opt
29 # define __deref_out_opt
31 #ifndef __deref_opt_out
32 # define __deref_opt_out
41 # define __in_bcount(x)
43 #ifndef __in_bcount_opt
44 # define __in_bcount_opt(x)
47 # define __in_ecount(x)
55 #ifndef __inout_bcount
56 # define __inout_bcount(x)
58 #ifndef __inout_ecount
59 # define __inout_ecount(x)
68 # define __out_bcount(x)
70 #ifndef __out_bcount_opt
71 # define __out_bcount_opt(x)
74 # define __out_ecount(x)
76 #ifndef __out_ecount_opt
77 # define __out_ecount_opt(x)
80 # define __out_xcount(x)
86 #endif /* defined(__cplusplus) */
94 #define IMAGEAPI WINAPI
95 #define DBHLPAPI IMAGEAPI
97 typedef struct _LOADED_IMAGE
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
;
113 } LOADED_IMAGE
, *PLOADED_IMAGE
;
115 /*************************
117 *************************/
127 #if !defined(_IMAGEHLP_SOURCE_) && defined(_IMAGEHLP64)
128 #define ADDRESS ADDRESS64
129 #define LPADDRESS LPADDRESS64
131 typedef struct _tagADDRESS
136 } ADDRESS
, *LPADDRESS
;
139 typedef struct _tagADDRESS64
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
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
182 typedef struct _IMAGEHLP_SYMBOL
190 } IMAGEHLP_SYMBOL
, *PIMAGEHLP_SYMBOL
;
192 typedef struct _IMAGEHLP_SYMBOLW
200 } IMAGEHLP_SYMBOLW
, *PIMAGEHLP_SYMBOLW
;
203 typedef struct _IMAGEHLP_SYMBOL64
211 } IMAGEHLP_SYMBOL64
, *PIMAGEHLP_SYMBOL64
;
213 typedef struct _IMAGEHLP_SYMBOLW64
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
229 typedef struct _IMAGEHLP_MODULE
240 CHAR LoadedImageName
[256];
241 } IMAGEHLP_MODULE
, *PIMAGEHLP_MODULE
;
243 typedef struct _IMAGEHLP_MODULEW
252 WCHAR ModuleName
[32];
253 WCHAR ImageName
[256];
254 WCHAR LoadedImageName
[256];
255 } IMAGEHLP_MODULEW
, *PIMAGEHLP_MODULEW
;
258 typedef struct _IMAGEHLP_MODULE64
269 CHAR LoadedImageName
[256];
270 CHAR LoadedPdbName
[256];
272 CHAR CVData
[MAX_PATH
*3];
285 } IMAGEHLP_MODULE64
, *PIMAGEHLP_MODULE64
;
287 typedef struct _IMAGEHLP_MODULEW64
296 WCHAR ModuleName
[32];
297 WCHAR ImageName
[256];
298 WCHAR LoadedImageName
[256];
299 WCHAR LoadedPdbName
[256];
301 WCHAR CVData
[MAX_PATH
*3];
314 } IMAGEHLP_MODULEW64
, *PIMAGEHLP_MODULEW64
;
316 #if !defined(_IMAGEHLP_SOURCE_) && defined(_IMAGEHLP64)
317 #define IMAGEHLP_LINE IMAGEHLP_LINE64
318 #define PIMAGEHLP_LINE PIMAGEHLP_LINE64
319 #define IMAGEHLP_LINEW IMAGEHLP_LINEW64
320 #define PIMAGEHLP_LINEW PIMAGEHLP_LINEW64
322 typedef struct _IMAGEHLP_LINE
329 } IMAGEHLP_LINE
, *PIMAGEHLP_LINE
;
331 typedef struct _IMAGEHLP_LINEW
338 } IMAGEHLP_LINEW
, *PIMAGEHLP_LINEW
;
341 typedef struct _IMAGEHLP_LINE64
348 } IMAGEHLP_LINE64
, *PIMAGEHLP_LINE64
;
350 typedef struct _IMAGEHLP_LINEW64
357 } IMAGEHLP_LINEW64
, *PIMAGEHLP_LINEW64
;
359 typedef struct _SOURCEFILE
363 } SOURCEFILE
, *PSOURCEFILE
;
365 typedef struct _SOURCEFILEW
369 } SOURCEFILEW
, *PSOURCEFILEW
;
371 #define CBA_DEFERRED_SYMBOL_LOAD_START 0x00000001
372 #define CBA_DEFERRED_SYMBOL_LOAD_COMPLETE 0x00000002
373 #define CBA_DEFERRED_SYMBOL_LOAD_FAILURE 0x00000003
374 #define CBA_SYMBOLS_UNLOADED 0x00000004
375 #define CBA_DUPLICATE_SYMBOL 0x00000005
376 #define CBA_READ_MEMORY 0x00000006
377 #define CBA_DEFERRED_SYMBOL_LOAD_CANCEL 0x00000007
378 #define CBA_SET_OPTIONS 0x00000008
379 #define CBA_EVENT 0x00000010
380 #define CBA_DEFERRED_SYMBOL_LOAD_PARTIAL 0x00000020
381 #define CBA_DEBUG_INFO 0x10000000
383 typedef struct _IMAGEHLP_CBA_READ_MEMORY
389 } IMAGEHLP_CBA_READ_MEMORY
, *PIMAGEHLP_CBA_READ_MEMORY
;
400 #define EVENT_SRCSPEW_START 100
401 #define EVENT_SRCSPEW 100
402 #define EVENT_SRCSPEW_END 199
404 typedef struct _IMAGEHLP_CBA_EVENT
410 } IMAGEHLP_CBA_EVENT
, *PIMAGEHLP_CBA_EVENT
;
412 typedef struct _IMAGEHLP_CBA_EVENTW
418 } IMAGEHLP_CBA_EVENTW
, *PIMAGEHLP_CBA_EVENTW
;
420 #if !defined(_IMAGEHLP_SOURCE_) && defined(_IMAGEHLP64)
421 #define IMAGEHLP_DEFERRED_SYMBOL_LOAD IMAGEHLP_DEFERRED_SYMBOL_LOAD64
422 #define PIMAGEHLP_DEFERRED_SYMBOL_LOAD PIMAGEHLP_DEFERRED_SYMBOL_LOAD64
424 typedef struct _IMAGEHLP_DEFERRED_SYMBOL_LOAD
430 CHAR FileName
[MAX_PATH
];
433 } IMAGEHLP_DEFERRED_SYMBOL_LOAD
, *PIMAGEHLP_DEFERRED_SYMBOL_LOAD
;
436 typedef struct _IMAGEHLP_DEFERRED_SYMBOL_LOAD64
442 CHAR FileName
[MAX_PATH
];
446 } IMAGEHLP_DEFERRED_SYMBOL_LOAD64
, *PIMAGEHLP_DEFERRED_SYMBOL_LOAD64
;
448 typedef struct _IMAGEHLP_DEFERRED_SYMBOL_LOADW64
454 WCHAR FileName
[MAX_PATH
+ 1];
458 } IMAGEHLP_DEFERRED_SYMBOL_LOADW64
, *PIMAGEHLP_DEFERRED_SYMBOL_LOADW64
;
460 #if !defined(_IMAGEHLP_SOURCE_) && defined(_IMAGEHLP64)
461 #define IMAGEHLP_DUPLICATE_SYMBOL IMAGEHLP_DUPLICATE_SYMBOL64
462 #define PIMAGEHLP_DUPLICATE_SYMBOL PIMAGEHLP_DUPLICATE_SYMBOL64
464 typedef struct _IMAGEHLP_DUPLICATE_SYMBOL
468 PIMAGEHLP_SYMBOL Symbol
;
469 DWORD SelectedSymbol
;
470 } IMAGEHLP_DUPLICATE_SYMBOL
, *PIMAGEHLP_DUPLICATE_SYMBOL
;
473 typedef struct _IMAGEHLP_DUPLICATE_SYMBOL64
477 PIMAGEHLP_SYMBOL64 Symbol
;
478 DWORD SelectedSymbol
;
479 } IMAGEHLP_DUPLICATE_SYMBOL64
, *PIMAGEHLP_DUPLICATE_SYMBOL64
;
481 #define SYMOPT_CASE_INSENSITIVE 0x00000001
482 #define SYMOPT_UNDNAME 0x00000002
483 #define SYMOPT_DEFERRED_LOADS 0x00000004
484 #define SYMOPT_NO_CPP 0x00000008
485 #define SYMOPT_LOAD_LINES 0x00000010
486 #define SYMOPT_OMAP_FIND_NEAREST 0x00000020
487 #define SYMOPT_LOAD_ANYTHING 0x00000040
488 #define SYMOPT_IGNORE_CVREC 0x00000080
489 #define SYMOPT_NO_UNQUALIFIED_LOADS 0x00000100
490 #define SYMOPT_FAIL_CRITICAL_ERRORS 0x00000200
491 #define SYMOPT_EXACT_SYMBOLS 0x00000400
492 #define SYMOPT_WILD_UNDERSCORE 0x00000800
493 #define SYMOPT_USE_DEFAULTS 0x00001000
494 /* latest SDK defines:
495 #define SYMOPT_ALLOW_ABSOLUTE_SYMBOLS 0x00000800
496 #define SYMOPT_IGNORE_NT_SYMPATH 0x00001000
498 #define SYMOPT_INCLUDE_32BIT_MODULES 0x00002000
499 #define SYMOPT_PUBLICS_ONLY 0x00004000
500 #define SYMOPT_NO_PUBLICS 0x00008000
501 #define SYMOPT_AUTO_PUBLICS 0x00010000
502 #define SYMOPT_NO_IMAGE_SEARCH 0x00020000
503 #define SYMOPT_SECURE 0x00040000
504 #define SYMOPT_NO_PROMPTS 0x00080000
505 #define SYMOPT_OVERWRITE 0x00100000
506 #define SYMOPT_IGNORE_IMAGEDIR 0x00200000
507 #define SYMOPT_FLAT_DIRECTORY 0x00400000
508 #define SYMOPT_FAVOR_COMPRESSED 0x00800000
509 #define SYMOPT_ALLOW_ZERO_ADDRESS 0x01000000
510 #define SYMOPT_DISABLE_SYMSRV_AUTODETECT 0x02000000
511 #define SYMOPT_READONLY_CACHE 0x04000000
512 #define SYMOPT_SYMPATH_LAST 0x08000000
513 #define SYMOPT_DISABLE_FAST_SYMBOLS 0x10000000
514 #define SYMOPT_DISABLE_SYMSRV_TIMEOUT 0x20000000
515 #define SYMOPT_DISABLE_SRVSTAR_ON_STARTUP 0x40000000
516 #define SYMOPT_DEBUG 0x80000000
518 typedef struct _IMAGEHLP_STACK_FRAME
520 ULONG64 InstructionOffset
;
521 ULONG64 ReturnOffset
;
524 ULONG64 BackingStoreOffset
;
525 ULONG64 FuncTableEntry
;
530 } IMAGEHLP_STACK_FRAME
, *PIMAGEHLP_STACK_FRAME
;
532 typedef VOID IMAGEHLP_CONTEXT
, *PIMAGEHLP_CONTEXT
;
534 #define DBHHEADER_DEBUGDIRS 0x1
535 typedef struct _DBGHELP_MODLOAD_DATA
542 } MODLOAD_DATA
, *PMODLOAD_DATA
;
544 /*************************
546 *************************/
548 #include <pshpack4.h>
551 #define MINIDUMP_SIGNATURE 0x504D444D /* 'MDMP' */
552 #define MINIDUMP_VERSION (42899)
555 typedef ULONG64 RVA64
;
557 typedef enum _MINIDUMP_TYPE
559 MiniDumpNormal
= 0x0000,
560 MiniDumpWithDataSegs
= 0x0001,
561 MiniDumpWithFullMemory
= 0x0002,
562 MiniDumpWithHandleData
= 0x0004,
563 MiniDumpFilterMemory
= 0x0008,
564 MiniDumpScanMemory
= 0x0010,
565 MiniDumpWithUnloadedModules
= 0x0020,
566 MiniDumpWithIndirectlyReferencedMemory
= 0x0040,
567 MiniDumpFilterModulePaths
= 0x0080,
568 MiniDumpWithProcessThreadData
= 0x0100,
569 MiniDumpWithPrivateReadWriteMemory
= 0x0200,
570 MiniDumpWithoutOptionalData
= 0x0400,
571 MiniDumpWithFullMemoryInfo
= 0x0800,
572 MiniDumpWithThreadInfo
= 0x1000,
573 MiniDumpWithCodeSegs
= 0x2000
576 typedef enum _MINIDUMP_CALLBACK_TYPE
581 IncludeThreadCallback
,
582 IncludeModuleCallback
,
584 } MINIDUMP_CALLBACK_TYPE
;
586 typedef struct _MINIDUMP_THREAD_CALLBACK
590 #if defined(__aarch64__)
597 } MINIDUMP_THREAD_CALLBACK
, *PMINIDUMP_THREAD_CALLBACK
;
599 typedef struct _MINIDUMP_THREAD_EX_CALLBACK
603 #if defined(__aarch64__)
610 ULONG64 BackingStoreBase
;
611 ULONG64 BackingStoreEnd
;
612 } MINIDUMP_THREAD_EX_CALLBACK
, *PMINIDUMP_THREAD_EX_CALLBACK
;
614 typedef struct _MINIDUMP_INCLUDE_THREAD_CALLBACK
617 } MINIDUMP_INCLUDE_THREAD_CALLBACK
, *PMINIDUMP_INCLUDE_THREAD_CALLBACK
;
619 typedef enum _THREAD_WRITE_FLAGS
621 ThreadWriteThread
= 0x0001,
622 ThreadWriteStack
= 0x0002,
623 ThreadWriteContext
= 0x0004,
624 ThreadWriteBackingStore
= 0x0008,
625 ThreadWriteInstructionWindow
= 0x0010,
626 ThreadWriteThreadData
= 0x0020,
627 ThreadWriteThreadInfo
= 0x0040
628 } THREAD_WRITE_FLAGS
;
630 typedef struct _MINIDUMP_MODULE_CALLBACK
637 VS_FIXEDFILEINFO VersionInfo
;
639 ULONG SizeOfCvRecord
;
641 ULONG SizeOfMiscRecord
;
642 } MINIDUMP_MODULE_CALLBACK
, *PMINIDUMP_MODULE_CALLBACK
;
644 typedef struct _MINIDUMP_INCLUDE_MODULE_CALLBACK
647 } MINIDUMP_INCLUDE_MODULE_CALLBACK
, *PMINIDUMP_INCLUDE_MODULE_CALLBACK
;
649 typedef enum _MODULE_WRITE_FLAGS
651 ModuleWriteModule
= 0x0001,
652 ModuleWriteDataSeg
= 0x0002,
653 ModuleWriteMiscRecord
= 0x0004,
654 ModuleWriteCvRecord
= 0x0008,
655 ModuleReferencedByMemory
= 0x0010,
656 ModuleWriteTlsData
= 0x0020,
657 ModuleWriteCodeSegs
= 0x0040,
658 } MODULE_WRITE_FLAGS
;
660 typedef struct _MINIDUMP_CALLBACK_INPUT
663 HANDLE ProcessHandle
;
667 MINIDUMP_THREAD_CALLBACK Thread
;
668 MINIDUMP_THREAD_EX_CALLBACK ThreadEx
;
669 MINIDUMP_MODULE_CALLBACK Module
;
670 MINIDUMP_INCLUDE_THREAD_CALLBACK IncludeThread
;
671 MINIDUMP_INCLUDE_MODULE_CALLBACK IncludeModule
;
673 } MINIDUMP_CALLBACK_INPUT
, *PMINIDUMP_CALLBACK_INPUT
;
675 typedef struct _MINIDUMP_CALLBACK_OUTPUT
679 ULONG ModuleWriteFlags
;
680 ULONG ThreadWriteFlags
;
687 } MINIDUMP_CALLBACK_OUTPUT
, *PMINIDUMP_CALLBACK_OUTPUT
;
689 typedef BOOL (WINAPI
* MINIDUMP_CALLBACK_ROUTINE
)(PVOID
, const PMINIDUMP_CALLBACK_INPUT
, PMINIDUMP_CALLBACK_OUTPUT
);
691 typedef struct _MINIDUMP_CALLBACK_INFORMATION
693 MINIDUMP_CALLBACK_ROUTINE CallbackRoutine
;
695 } MINIDUMP_CALLBACK_INFORMATION
, *PMINIDUMP_CALLBACK_INFORMATION
;
697 typedef struct _MINIDUMP_LOCATION_DESCRIPTOR
701 } MINIDUMP_LOCATION_DESCRIPTOR
;
703 typedef struct _MINIDUMP_LOCATION_DESCRIPTOR64
707 } MINIDUMP_LOCATION_DESCRIPTOR64
;
709 typedef struct _MINIDUMP_DIRECTORY
712 MINIDUMP_LOCATION_DESCRIPTOR Location
;
713 } MINIDUMP_DIRECTORY
, *PMINIDUMP_DIRECTORY
;
715 typedef struct _MINIDUMP_EXCEPTION
718 ULONG ExceptionFlags
;
719 ULONG64 ExceptionRecord
;
720 ULONG64 ExceptionAddress
;
721 ULONG NumberParameters
;
722 ULONG __unusedAlignment
;
723 ULONG64 ExceptionInformation
[EXCEPTION_MAXIMUM_PARAMETERS
];
724 } MINIDUMP_EXCEPTION
, *PMINIDUMP_EXCEPTION
;
726 typedef struct _MINIDUMP_EXCEPTION_INFORMATION
729 PEXCEPTION_POINTERS ExceptionPointers
;
731 } MINIDUMP_EXCEPTION_INFORMATION
, *PMINIDUMP_EXCEPTION_INFORMATION
;
733 typedef struct MINIDUMP_EXCEPTION_STREAM
737 MINIDUMP_EXCEPTION ExceptionRecord
;
738 MINIDUMP_LOCATION_DESCRIPTOR ThreadContext
;
739 } MINIDUMP_EXCEPTION_STREAM
, *PMINIDUMP_EXCEPTION_STREAM
;
741 typedef struct _MINIDUMP_HEADER
745 DWORD NumberOfStreams
;
746 RVA StreamDirectoryRva
;
754 } MINIDUMP_HEADER
, *PMINIDUMP_HEADER
;
756 typedef struct _MINIDUMP_MEMORY_DESCRIPTOR
758 ULONG64 StartOfMemoryRange
;
759 MINIDUMP_LOCATION_DESCRIPTOR Memory
;
760 } MINIDUMP_MEMORY_DESCRIPTOR
, *PMINIDUMP_MEMORY_DESCRIPTOR
;
762 typedef struct _MINIDUMP_MEMORY_LIST
764 ULONG NumberOfMemoryRanges
;
765 MINIDUMP_MEMORY_DESCRIPTOR MemoryRanges
[1]; /* FIXME: 0-sized array not supported */
766 } MINIDUMP_MEMORY_LIST
, *PMINIDUMP_MEMORY_LIST
;
768 typedef struct _MINIDUMP_MEMORY_DESCRIPTOR64
770 ULONG64 StartOfMemoryRange
;
772 } MINIDUMP_MEMORY_DESCRIPTOR64
, *PMINIDUMP_MEMORY_DESCRIPTOR64
;
774 typedef struct _MINIDUMP_MEMORY64_LIST
776 ULONG64 NumberOfMemoryRanges
;
778 MINIDUMP_MEMORY_DESCRIPTOR64 MemoryRanges
[1]; /* FIXME: 0-sized array not supported */
779 } MINIDUMP_MEMORY64_LIST
, *PMINIDUMP_MEMORY64_LIST
;
781 #define MINIDUMP_MISC1_PROCESS_ID 0x00000001
782 #define MINIDUMP_MISC1_PROCESS_TIMES 0x00000002
784 typedef struct _MINIDUMP_MISC_INFO
789 ULONG ProcessCreateTime
;
790 ULONG ProcessUserTime
;
791 ULONG ProcessKernelTime
;
792 } MINIDUMP_MISC_INFO
, *PMINIDUMP_MISC_INFO
;
794 typedef struct _MINIDUMP_MODULE
801 VS_FIXEDFILEINFO VersionInfo
;
802 MINIDUMP_LOCATION_DESCRIPTOR CvRecord
;
803 MINIDUMP_LOCATION_DESCRIPTOR MiscRecord
;
806 } MINIDUMP_MODULE
, *PMINIDUMP_MODULE
;
808 typedef struct _MINIDUMP_MODULE_LIST
810 ULONG NumberOfModules
;
811 MINIDUMP_MODULE Modules
[1]; /* FIXME: 0-sized array not supported */
812 } MINIDUMP_MODULE_LIST
, *PMINIDUMP_MODULE_LIST
;
814 typedef struct _MINIDUMP_STRING
817 WCHAR Buffer
[1]; /* FIXME: O-sized array not supported */
818 } MINIDUMP_STRING
, *PMINIDUMP_STRING
;
820 typedef struct _MINIDUMP_SYSTEM_INFO
822 USHORT ProcessorArchitecture
;
823 USHORT ProcessorLevel
;
824 USHORT ProcessorRevision
;
830 UCHAR NumberOfProcessors
;
850 union _CPU_INFORMATION
855 ULONG VersionInformation
;
856 ULONG FeatureInformation
;
857 ULONG AMDExtendedCpuFeatures
;
861 ULONG64 ProcessorFeatures
[2];
865 } MINIDUMP_SYSTEM_INFO
, *PMINIDUMP_SYSTEM_INFO
;
867 typedef struct _MINIDUMP_THREAD
874 MINIDUMP_MEMORY_DESCRIPTOR Stack
;
875 MINIDUMP_LOCATION_DESCRIPTOR ThreadContext
;
876 } MINIDUMP_THREAD
, *PMINIDUMP_THREAD
;
878 typedef struct _MINIDUMP_THREAD_LIST
880 ULONG NumberOfThreads
;
881 MINIDUMP_THREAD Threads
[1]; /* FIXME: no support of 0 sized array */
882 } MINIDUMP_THREAD_LIST
, *PMINIDUMP_THREAD_LIST
;
884 typedef struct _MINIDUMP_USER_STREAM
889 } MINIDUMP_USER_STREAM
, *PMINIDUMP_USER_STREAM
;
891 typedef struct _MINIDUMP_USER_STREAM_INFORMATION
893 ULONG UserStreamCount
;
894 PMINIDUMP_USER_STREAM UserStreamArray
;
895 } MINIDUMP_USER_STREAM_INFORMATION
, *PMINIDUMP_USER_STREAM_INFORMATION
;
897 typedef enum _MINIDUMP_STREAM_TYPE
902 ThreadListStream
= 3,
903 ModuleListStream
= 4,
904 MemoryListStream
= 5,
906 SystemInfoStream
= 7,
907 ThreadExListStream
= 8,
908 Memory64ListStream
= 9,
911 HandleDataStream
= 12,
912 FunctionTableStream
= 13,
913 UnloadedModuleListStream
= 14,
915 MemoryInfoListStream
= 16,
916 ThreadInfoListStream
= 17,
918 LastReservedStream
= 0xffff
919 } MINIDUMP_STREAM_TYPE
;
921 BOOL WINAPI
MiniDumpWriteDump(HANDLE
, DWORD
, HANDLE
, MINIDUMP_TYPE
,
922 const PMINIDUMP_EXCEPTION_INFORMATION
,
923 const PMINIDUMP_USER_STREAM_INFORMATION
,
924 const PMINIDUMP_CALLBACK_INFORMATION
);
925 BOOL WINAPI
MiniDumpReadDumpStream(PVOID
, ULONG
, PMINIDUMP_DIRECTORY
*, PVOID
*,
930 /*************************
932 *************************/
934 /* flags for SymLoadModuleEx */
935 #define SLMFLAG_VIRTUAL 0x1
936 #define SLMFLAG_NO_SYMBOLS 0x4
938 typedef BOOL (CALLBACK
*PENUMLOADED_MODULES_CALLBACK64
)(PCSTR
, DWORD64
, ULONG
, PVOID
);
939 BOOL WINAPI
EnumerateLoadedModules64(HANDLE
, PENUMLOADED_MODULES_CALLBACK64
, PVOID
);
940 typedef BOOL (CALLBACK
*PENUMLOADED_MODULES_CALLBACKW64
)(PCWSTR
, DWORD64
, ULONG
, PVOID
);
941 BOOL WINAPI
EnumerateLoadedModulesW64(HANDLE
, PENUMLOADED_MODULES_CALLBACKW64
, PVOID
);
942 BOOL WINAPI
EnumerateLoadedModulesEx(HANDLE
, PENUMLOADED_MODULES_CALLBACK64
, PVOID
);
943 BOOL WINAPI
EnumerateLoadedModulesExW(HANDLE
, PENUMLOADED_MODULES_CALLBACKW64
, PVOID
);
944 typedef BOOL (CALLBACK
*PSYM_ENUMMODULES_CALLBACK64
)(PCSTR
, DWORD64
, PVOID
);
945 BOOL WINAPI
SymEnumerateModules64(HANDLE
, PSYM_ENUMMODULES_CALLBACK64
, PVOID
);
946 typedef BOOL (CALLBACK
*PSYM_ENUMMODULES_CALLBACKW64
)(PCWSTR
, DWORD64
, PVOID
);
947 BOOL WINAPI
SymEnumerateModulesW64(HANDLE
, PSYM_ENUMMODULES_CALLBACKW64
, PVOID
);
948 BOOL WINAPI
SymGetModuleInfo64(HANDLE
, DWORD64
, PIMAGEHLP_MODULE64
);
949 BOOL WINAPI
SymGetModuleInfoW64(HANDLE
, DWORD64
, PIMAGEHLP_MODULEW64
);
950 DWORD64 WINAPI
SymGetModuleBase64(HANDLE
, DWORD64
);
951 DWORD64 WINAPI
SymLoadModule64(HANDLE
, HANDLE
, PCSTR
, PCSTR
, DWORD64
, DWORD
);
952 DWORD64 WINAPI
SymLoadModuleEx(HANDLE
, HANDLE
, PCSTR
, PCSTR
, DWORD64
, DWORD
,
953 PMODLOAD_DATA
, DWORD
);
954 DWORD64 WINAPI
SymLoadModuleExW(HANDLE
, HANDLE
, PCWSTR
, PCWSTR
, DWORD64
, DWORD
,
955 PMODLOAD_DATA
, DWORD
);
956 BOOL WINAPI
SymUnloadModule64(HANDLE
, DWORD64
);
958 /*************************
960 *************************/
962 #define IMAGEHLP_SYMBOL_INFO_VALUEPRESENT 1
963 #define IMAGEHLP_SYMBOL_INFO_REGISTER SYMF_REGISTER /* 0x08 */
964 #define IMAGEHLP_SYMBOL_INFO_REGRELATIVE SYMF_REGREL /* 0x10 */
965 #define IMAGEHLP_SYMBOL_INFO_FRAMERELATIVE SYMF_FRAMEREL /* 0x20 */
966 #define IMAGEHLP_SYMBOL_INFO_PARAMETER SYMF_PARAMETER /* 0x40 */
967 #define IMAGEHLP_SYMBOL_INFO_LOCAL SYMF_LOCAL /* 0x80 */
968 #define IMAGEHLP_SYMBOL_INFO_CONSTANT SYMF_CONSTANT /* 0x100 */
969 #define IMAGEHLP_SYMBOL_FUNCTION SYMF_FUNCTION /* 0x800 */
971 #define SYMFLAG_VALUEPRESENT 0x00000001
972 #define SYMFLAG_REGISTER 0x00000008
973 #define SYMFLAG_REGREL 0x00000010
974 #define SYMFLAG_FRAMEREL 0x00000020
975 #define SYMFLAG_PARAMETER 0x00000040
976 #define SYMFLAG_LOCAL 0x00000080
977 #define SYMFLAG_CONSTANT 0x00000100
978 #define SYMFLAG_EXPORT 0x00000200
979 #define SYMFLAG_FORWARDER 0x00000400
980 #define SYMFLAG_FUNCTION 0x00000800
981 #define SYMFLAG_VIRTUAL 0x00001000
982 #define SYMFLAG_THUNK 0x00002000
983 #define SYMFLAG_TLSREL 0x00004000
984 #define SYMFLAG_SLOT 0x00008000
985 #define SYMFLAG_ILREL 0x00010000
986 #define SYMFLAG_METADATA 0x00020000
987 #define SYMFLAG_CLR_TOKEN 0x00040000
988 #define SYMFLAG_NULL 0x00080000
989 #define SYMFLAG_FUNC_NO_RETURN 0x00100000
990 #define SYMFLAG_SYNTHETIC_ZEROBASE 0x00200000
991 #define SYMFLAG_PUBLIC_CODE 0x00400000
993 #define MAX_SYM_NAME 2000
995 typedef struct _SYMBOL_INFO
1012 } SYMBOL_INFO
, *PSYMBOL_INFO
;
1014 typedef struct _SYMBOL_INFOW
1018 ULONG64 Reserved
[2];
1031 } SYMBOL_INFOW
, *PSYMBOL_INFOW
;
1033 typedef struct _SYMBOL_INFO_PACKAGE
1036 CHAR name
[MAX_SYM_NAME
+1];
1037 } SYMBOL_INFO_PACKAGE
, *PSYMBOL_INFO_PACKAGE
;
1039 typedef struct _SYMBOL_INFO_PACKAGEW
1042 WCHAR name
[MAX_SYM_NAME
+1];
1043 } SYMBOL_INFO_PACKAGEW
, *PSYMBOL_INFO_PACKAGEW
;
1045 typedef enum _IMAGEHLP_SYMBOL_TYPE_INFO
1053 TI_GET_ARRAYINDEXTYPEID
,
1056 TI_GET_ADDRESSOFFSET
,
1060 TI_GET_CHILDRENCOUNT
,
1062 TI_GET_VIRTUALBASECLASS
,
1063 TI_GET_VIRTUALTABLESHAPEID
,
1064 TI_GET_VIRTUALBASEPOINTEROFFSET
,
1065 TI_GET_CLASSPARENTID
,
1068 TI_GET_LEXICALPARENT
,
1073 TI_GET_CALLING_CONVENTION
,
1074 } IMAGEHLP_SYMBOL_TYPE_INFO
;
1076 #define IMAGEHLP_GET_TYPE_INFO_UNCACHED 0x00000001
1077 #define IMAGEHLP_GET_TYPE_INFO_CHILDREN 0x00000002
1078 typedef struct _IMAGEHLP_GET_TYPE_INFO_PARAMS
1086 IMAGEHLP_SYMBOL_TYPE_INFO
* ReqKinds
;
1087 PULONG_PTR ReqOffsets
;
1089 ULONG_PTR ReqStride
;
1090 ULONG_PTR BufferSize
;
1092 ULONG EntriesMatched
;
1093 ULONG EntriesFilled
;
1095 ULONG64 AllReqsValid
;
1098 } IMAGEHLP_GET_TYPE_INFO_PARAMS
, *PIMAGEHLP_GET_TYPE_INFO_PARAMS
;
1100 typedef struct _TI_FINDCHILDREN_PARAMS
1105 } TI_FINDCHILDREN_PARAMS
;
1107 #define UNDNAME_COMPLETE (0x0000)
1108 #define UNDNAME_NO_LEADING_UNDERSCORES (0x0001)
1109 #define UNDNAME_NO_MS_KEYWORDS (0x0002)
1110 #define UNDNAME_NO_FUNCTION_RETURNS (0x0004)
1111 #define UNDNAME_NO_ALLOCATION_MODEL (0x0008)
1112 #define UNDNAME_NO_ALLOCATION_LANGUAGE (0x0010)
1113 #define UNDNAME_NO_MS_THISTYPE (0x0020)
1114 #define UNDNAME_NO_CV_THISTYPE (0x0040)
1115 #define UNDNAME_NO_THISTYPE (0x0060)
1116 #define UNDNAME_NO_ACCESS_SPECIFIERS (0x0080)
1117 #define UNDNAME_NO_THROW_SIGNATURES (0x0100)
1118 #define UNDNAME_NO_MEMBER_TYPE (0x0200)
1119 #define UNDNAME_NO_RETURN_UDT_MODEL (0x0400)
1120 #define UNDNAME_32_BIT_DECODE (0x0800)
1121 #define UNDNAME_NAME_ONLY (0x1000)
1122 #define UNDNAME_NO_ARGUMENTS (0x2000)
1123 #define UNDNAME_NO_SPECIAL_SYMS (0x4000)
1125 #define SYMSEARCH_MASKOBJS 0x01
1126 #define SYMSEARCH_RECURSE 0x02
1127 #define SYMSEARCH_GLOBALSONLY 0x04
1129 BOOL WINAPI
SymGetTypeInfo(HANDLE
, DWORD64
, ULONG
, IMAGEHLP_SYMBOL_TYPE_INFO
, PVOID
);
1130 BOOL WINAPI
SymGetTypeInfoEx(HANDLE
, DWORD64
, PIMAGEHLP_GET_TYPE_INFO_PARAMS
);
1131 typedef BOOL (CALLBACK
*PSYM_ENUMERATESYMBOLS_CALLBACK
)(PSYMBOL_INFO
, ULONG
, PVOID
);
1132 typedef BOOL (CALLBACK
*PSYM_ENUMERATESYMBOLS_CALLBACKW
)(PSYMBOL_INFOW
, ULONG
, PVOID
);
1133 BOOL WINAPI
SymEnumTypes(HANDLE
, ULONG64
, PSYM_ENUMERATESYMBOLS_CALLBACK
, PVOID
);
1134 BOOL WINAPI
SymEnumTypesW(HANDLE
, ULONG64
, PSYM_ENUMERATESYMBOLS_CALLBACKW
, PVOID
);
1135 BOOL WINAPI
SymFromAddr(HANDLE
, DWORD64
, DWORD64
*, SYMBOL_INFO
*);
1136 BOOL WINAPI
SymFromAddrW(HANDLE
, DWORD64
, DWORD64
*, SYMBOL_INFOW
*);
1137 BOOL WINAPI
SymFromToken(HANDLE
, DWORD64
, DWORD
, PSYMBOL_INFO
);
1138 BOOL WINAPI
SymFromTokenW(HANDLE
, DWORD64
, DWORD
, PSYMBOL_INFOW
);
1139 BOOL WINAPI
SymFromName(HANDLE
, PCSTR
, PSYMBOL_INFO
);
1140 BOOL WINAPI
SymFromNameW(HANDLE
, PCWSTR
, PSYMBOL_INFOW
);
1141 BOOL WINAPI
SymGetSymFromAddr64(HANDLE
, DWORD64
, PDWORD64
, PIMAGEHLP_SYMBOL64
);
1142 BOOL WINAPI
SymGetSymFromName64(HANDLE
, PCSTR
, PIMAGEHLP_SYMBOL64
);
1143 BOOL WINAPI
SymGetTypeFromName(HANDLE
, ULONG64
, PCSTR
, PSYMBOL_INFO
);
1144 BOOL WINAPI
SymGetTypeFromNameW(HANDLE
, ULONG64
, PCWSTR
, PSYMBOL_INFOW
);
1145 BOOL WINAPI
SymGetSymNext64(HANDLE
, PIMAGEHLP_SYMBOL64
);
1146 BOOL WINAPI
SymGetSymNextW64(HANDLE
, PIMAGEHLP_SYMBOLW64
);
1147 BOOL WINAPI
SymGetSymPrev64(HANDLE
, PIMAGEHLP_SYMBOL64
);
1148 BOOL WINAPI
SymGetSymPrevW64(HANDLE
, PIMAGEHLP_SYMBOLW64
);
1149 BOOL WINAPI
SymEnumSym(HANDLE
,ULONG64
,PSYM_ENUMERATESYMBOLS_CALLBACK
,PVOID
);
1150 BOOL WINAPI
SymEnumSymbols(HANDLE
, ULONG64
, PCSTR
, PSYM_ENUMERATESYMBOLS_CALLBACK
,
1152 BOOL WINAPI
SymEnumSymbolsW(HANDLE
, ULONG64
, PCWSTR
, PSYM_ENUMERATESYMBOLS_CALLBACKW
,
1154 typedef BOOL (CALLBACK
*PSYM_ENUMSYMBOLS_CALLBACK64
)(PCSTR
, DWORD64
, ULONG
, PVOID
);
1155 typedef BOOL (CALLBACK
*PSYM_ENUMSYMBOLS_CALLBACK64W
)(PCWSTR
, DWORD64
, ULONG
, PVOID
);
1156 BOOL WINAPI
SymEnumerateSymbols64(HANDLE
, ULONG64
, PSYM_ENUMSYMBOLS_CALLBACK64
, PVOID
);
1157 BOOL WINAPI
SymEnumerateSymbolsW64(HANDLE
, ULONG64
, PSYM_ENUMSYMBOLS_CALLBACK64W
, PVOID
);
1158 BOOL WINAPI
SymEnumSymbolsForAddr(HANDLE
, DWORD64
, PSYM_ENUMERATESYMBOLS_CALLBACK
, PVOID
);
1159 BOOL WINAPI
SymEnumSymbolsForAddrW(HANDLE
, DWORD64
, PSYM_ENUMERATESYMBOLS_CALLBACKW
, PVOID
);
1160 typedef BOOL (CALLBACK
*PSYMBOL_REGISTERED_CALLBACK64
)(HANDLE
, ULONG
, ULONG64
, ULONG64
);
1161 BOOL WINAPI
SymRegisterCallback64(HANDLE
, PSYMBOL_REGISTERED_CALLBACK64
, ULONG64
);
1162 BOOL WINAPI
SymRegisterCallbackW64(HANDLE
, PSYMBOL_REGISTERED_CALLBACK64
, ULONG64
);
1163 BOOL WINAPI
SymUnDName64(PIMAGEHLP_SYMBOL64
, PSTR
, DWORD
);
1164 BOOL WINAPI
SymMatchString(PCSTR
, PCSTR
, BOOL
);
1165 BOOL WINAPI
SymMatchStringA(PCSTR
, PCSTR
, BOOL
);
1166 BOOL WINAPI
SymMatchStringW(PCWSTR
, PCWSTR
, BOOL
);
1167 BOOL WINAPI
SymSearch(HANDLE
, ULONG64
, DWORD
, DWORD
, PCSTR
, DWORD64
, PSYM_ENUMERATESYMBOLS_CALLBACK
, PVOID
, DWORD
);
1168 BOOL WINAPI
SymSearchW(HANDLE
, ULONG64
, DWORD
, DWORD
, PCWSTR
, DWORD64
, PSYM_ENUMERATESYMBOLS_CALLBACKW
, PVOID
, DWORD
);
1169 DWORD WINAPI
UnDecorateSymbolName(PCSTR
, PSTR
, DWORD
, DWORD
);
1170 DWORD WINAPI
UnDecorateSymbolNameW(PCWSTR
, PWSTR
, DWORD
, DWORD
);
1171 BOOL WINAPI
SymGetScope(HANDLE
, ULONG64
, DWORD
, PSYMBOL_INFO
);
1172 BOOL WINAPI
SymGetScopeW(HANDLE
, ULONG64
, DWORD
, PSYMBOL_INFOW
);
1173 BOOL WINAPI
SymFromIndex(HANDLE
, ULONG64
, DWORD
, PSYMBOL_INFO
);
1174 BOOL WINAPI
SymFromIndexW(HANDLE
, ULONG64
, DWORD
, PSYMBOL_INFOW
);
1175 BOOL WINAPI
SymAddSymbol(HANDLE
, ULONG64
, PCSTR
, DWORD64
, DWORD
, DWORD
);
1176 BOOL WINAPI
SymAddSymbolW(HANDLE
, ULONG64
, PCWSTR
, DWORD64
, DWORD
, DWORD
);
1177 BOOL WINAPI
SymDeleteSymbol(HANDLE
, ULONG64
, PCSTR
, DWORD64
, DWORD
);
1178 BOOL WINAPI
SymDeleteSymbolW(HANDLE
, ULONG64
, PCWSTR
, DWORD64
, DWORD
);
1180 /*************************
1182 *************************/
1183 typedef BOOL (CALLBACK
*PSYM_ENUMSOURCEFILES_CALLBACK
)(PSOURCEFILE
, PVOID
);
1184 typedef BOOL (CALLBACK
*PSYM_ENUMSOURCEFILES_CALLBACKW
)(PSOURCEFILEW
, PVOID
);
1186 BOOL WINAPI
SymEnumSourceFiles(HANDLE
, ULONG64
, PCSTR
, PSYM_ENUMSOURCEFILES_CALLBACK
,
1188 BOOL WINAPI
SymEnumSourceFilesW(HANDLE
, ULONG64
, PCWSTR
, PSYM_ENUMSOURCEFILES_CALLBACKW
, PVOID
);
1189 BOOL WINAPI
SymGetLineFromAddr64(HANDLE
, DWORD64
, PDWORD
, PIMAGEHLP_LINE64
);
1190 BOOL WINAPI
SymGetLineFromAddrW64(HANDLE
, DWORD64
, PDWORD
, PIMAGEHLP_LINEW64
);
1191 BOOL WINAPI
SymGetLinePrev64(HANDLE
, PIMAGEHLP_LINE64
);
1192 BOOL WINAPI
SymGetLinePrevW64(HANDLE
, PIMAGEHLP_LINEW64
);
1193 BOOL WINAPI
SymGetLineNext64(HANDLE
, PIMAGEHLP_LINE64
);
1194 BOOL WINAPI
SymGetLineNextW64(HANDLE
, PIMAGEHLP_LINEW64
);
1195 BOOL WINAPI
SymGetLineFromName64(HANDLE
, PCSTR
, PCSTR
, DWORD
, PLONG
, PIMAGEHLP_LINE64
);
1196 BOOL WINAPI
SymGetLineFromNameW64(HANDLE
, PCWSTR
, PCWSTR
, DWORD
, PLONG
, PIMAGEHLP_LINEW64
);
1197 ULONG WINAPI
SymGetFileLineOffsets64(HANDLE
, PCSTR
, PCSTR
, PDWORD64
, ULONG
);
1198 BOOL WINAPI
SymGetSourceFile(HANDLE
, ULONG64
, PCSTR
, PCSTR
, PSTR
, DWORD
);
1199 BOOL WINAPI
SymGetSourceFileW(HANDLE
, ULONG64
, PCWSTR
, PCWSTR
, PWSTR
, DWORD
);
1200 BOOL WINAPI
SymGetSourceFileToken(HANDLE
, ULONG64
, PCSTR
, PVOID
*, DWORD
*);
1201 BOOL WINAPI
SymGetSourceFileTokenW(HANDLE
, ULONG64
, PCWSTR
, PVOID
*, DWORD
*);
1202 BOOL WINAPI
SymGetSourceFileFromToken(HANDLE
, PVOID
, PCSTR
, PSTR
, DWORD
);
1203 BOOL WINAPI
SymGetSourceFileFromTokenW(HANDLE
, PVOID
, PCWSTR
, PWSTR
, DWORD
);
1204 BOOL WINAPI
SymGetSourceVarFromToken(HANDLE
, PVOID
, PCSTR
, PCSTR
, PSTR
, DWORD
);
1205 BOOL WINAPI
SymGetSourceVarFromTokenW(HANDLE
, PVOID
, PCWSTR
, PCWSTR
, PWSTR
, DWORD
);
1207 typedef struct _SRCCODEINFO
1212 CHAR Obj
[MAX_PATH
+1];
1213 CHAR FileName
[MAX_PATH
+1];
1216 } SRCCODEINFO
, *PSRCCODEINFO
;
1218 typedef struct _SRCCODEINFOW
1223 WCHAR Obj
[MAX_PATH
+1];
1224 WCHAR FileName
[MAX_PATH
+1];
1227 } SRCCODEINFOW
, *PSRCCODEINFOW
;
1229 typedef BOOL (CALLBACK
* PSYM_ENUMLINES_CALLBACK
)(PSRCCODEINFO
, PVOID
);
1230 typedef BOOL (CALLBACK
* PSYM_ENUMLINES_CALLBACKW
)(PSRCCODEINFOW
, PVOID
);
1231 BOOL WINAPI
SymEnumLines(HANDLE
, ULONG64
, PCSTR
, PCSTR
, PSYM_ENUMLINES_CALLBACK
, PVOID
);
1232 BOOL WINAPI
SymEnumLinesW(HANDLE
, ULONG64
, PCWSTR
, PCWSTR
, PSYM_ENUMLINES_CALLBACKW
, PVOID
);
1233 BOOL WINAPI
SymEnumSourceLines(HANDLE
, ULONG64
, PCSTR
, PCSTR
, DWORD
, DWORD
, PSYM_ENUMLINES_CALLBACK
, PVOID
);
1234 BOOL WINAPI
SymEnumSourceLinesW(HANDLE
, ULONG64
, PCWSTR
, PCWSTR
, DWORD
, DWORD
, PSYM_ENUMLINES_CALLBACKW
, PVOID
);
1236 /*************************
1237 * File & image handling *
1238 *************************/
1239 BOOL WINAPI
SymInitialize(HANDLE
, PCSTR
, BOOL
);
1240 BOOL WINAPI
SymInitializeW(HANDLE
, PCWSTR
, BOOL
);
1241 BOOL WINAPI
SymCleanup(HANDLE
);
1243 HANDLE WINAPI
FindDebugInfoFile(PCSTR
, PCSTR
, PSTR
);
1244 typedef BOOL (CALLBACK
*PFIND_DEBUG_FILE_CALLBACK
)(HANDLE
, PCSTR
, PVOID
);
1245 typedef BOOL (CALLBACK
*PFIND_DEBUG_FILE_CALLBACKW
)(HANDLE
, PCWSTR
, PVOID
);
1246 HANDLE WINAPI
FindDebugInfoFileEx(PCSTR
, PCSTR
, PSTR
, PFIND_DEBUG_FILE_CALLBACK
, PVOID
);
1247 HANDLE WINAPI
FindDebugInfoFileExW(PCWSTR
, PCWSTR
, PWSTR
, PFIND_DEBUG_FILE_CALLBACKW
, PVOID
);
1248 HANDLE WINAPI
SymFindDebugInfoFile(HANDLE
, PCSTR
, PSTR
, PFIND_DEBUG_FILE_CALLBACK
, PVOID
);
1249 HANDLE WINAPI
SymFindDebugInfoFileW(HANDLE
, PCWSTR
, PWSTR
, PFIND_DEBUG_FILE_CALLBACKW
, PVOID
);
1250 typedef BOOL (CALLBACK
*PFINDFILEINPATHCALLBACK
)(PCSTR
, PVOID
);
1251 typedef BOOL (CALLBACK
*PFINDFILEINPATHCALLBACKW
)(PCWSTR
, PVOID
);
1252 BOOL WINAPI
FindFileInPath(HANDLE
, PCSTR
, PCSTR
, PVOID
, DWORD
, DWORD
, DWORD
,
1253 PSTR
, PFINDFILEINPATHCALLBACK
, PVOID
);
1254 BOOL WINAPI
SymFindFileInPath(HANDLE
, PCSTR
, PCSTR
, PVOID
, DWORD
, DWORD
, DWORD
,
1255 PSTR
, PFINDFILEINPATHCALLBACK
, PVOID
);
1256 BOOL WINAPI
SymFindFileInPathW(HANDLE
, PCWSTR
, PCWSTR
, PVOID
, DWORD
, DWORD
, DWORD
,
1257 PWSTR
, PFINDFILEINPATHCALLBACKW
, PVOID
);
1258 HANDLE WINAPI
FindExecutableImage(PCSTR
, PCSTR
, PSTR
);
1259 typedef BOOL (CALLBACK
*PFIND_EXE_FILE_CALLBACK
)(HANDLE
, PCSTR
, PVOID
);
1260 typedef BOOL (CALLBACK
*PFIND_EXE_FILE_CALLBACKW
)(HANDLE
, PCWSTR
, PVOID
);
1261 HANDLE WINAPI
FindExecutableImageEx(PCSTR
, PCSTR
, PSTR
, PFIND_EXE_FILE_CALLBACK
, PVOID
);
1262 HANDLE WINAPI
FindExecutableImageExW(PCWSTR
, PCWSTR
, PWSTR
, PFIND_EXE_FILE_CALLBACKW
, PVOID
);
1263 HANDLE WINAPI
SymFindExecutableImage(HANDLE
, PCSTR
, PSTR
, PFIND_EXE_FILE_CALLBACK
, PVOID
);
1264 HANDLE WINAPI
SymFindExecutableImageW(HANDLE
, PCWSTR
, PWSTR
, PFIND_EXE_FILE_CALLBACKW
, PVOID
);
1265 PIMAGE_NT_HEADERS WINAPI
ImageNtHeader(PVOID
);
1266 PVOID WINAPI
ImageDirectoryEntryToDataEx(PVOID
, BOOLEAN
, USHORT
, PULONG
,
1267 PIMAGE_SECTION_HEADER
*);
1268 PVOID WINAPI
ImageDirectoryEntryToData(PVOID
, BOOLEAN
, USHORT
, PULONG
);
1269 PIMAGE_SECTION_HEADER WINAPI
ImageRvaToSection(PIMAGE_NT_HEADERS
, PVOID
, ULONG
);
1270 PVOID WINAPI
ImageRvaToVa(PIMAGE_NT_HEADERS
, PVOID
, ULONG
, PIMAGE_SECTION_HEADER
*);
1271 BOOL WINAPI
SymGetSearchPath(HANDLE
, PSTR
, DWORD
);
1272 BOOL WINAPI
SymGetSearchPathW(HANDLE
, PWSTR
, DWORD
);
1273 BOOL WINAPI
SymSetSearchPath(HANDLE
, PCSTR
);
1274 BOOL WINAPI
SymSetSearchPathW(HANDLE
, PCWSTR
);
1275 DWORD WINAPI
GetTimestampForLoadedLibrary(HMODULE
);
1276 BOOL WINAPI
MakeSureDirectoryPathExists(PCSTR
);
1277 BOOL WINAPI
SearchTreeForFile(PCSTR
, PCSTR
, PSTR
);
1278 BOOL WINAPI
SearchTreeForFileW(PCWSTR
, PCWSTR
, PWSTR
);
1279 typedef BOOL (CALLBACK
*PENUMDIRTREE_CALLBACK
)(PCSTR
, PVOID
);
1280 typedef BOOL (CALLBACK
*PENUMDIRTREE_CALLBACKW
)(PCWSTR
, PVOID
);
1281 BOOL WINAPI
EnumDirTree(HANDLE
, PCSTR
, PCSTR
, PSTR
, PENUMDIRTREE_CALLBACK
, PVOID
);
1282 BOOL WINAPI
EnumDirTreeW(HANDLE
, PCWSTR
, PCWSTR
, PWSTR
, PENUMDIRTREE_CALLBACKW
, PVOID
);
1283 BOOL WINAPI
SymMatchFileName(PCSTR
, PCSTR
, PSTR
*, PSTR
*);
1284 BOOL WINAPI
SymMatchFileNameW(PCWSTR
, PCWSTR
, PWSTR
*, PWSTR
*);
1285 PCHAR WINAPI
SymSetHomeDirectory(HANDLE
, PCSTR
);
1286 PWSTR WINAPI
SymSetHomeDirectoryW(HANDLE
, PCWSTR
);
1287 PCHAR WINAPI
SymGetHomeDirectory(DWORD
, PSTR
, size_t);
1288 PWSTR WINAPI
SymGetHomeDirectoryW(DWORD
, PWSTR
, size_t);
1294 /*************************
1295 * Context management *
1296 *************************/
1297 BOOL WINAPI
SymSetContext(HANDLE
, PIMAGEHLP_STACK_FRAME
, PIMAGEHLP_CONTEXT
);
1300 /*************************
1301 * Stack management *
1302 *************************/
1304 #if !defined(_IMAGEHLP_SOURCE_) && defined(_IMAGEHLP64)
1305 #define KDHELP KDHELP64
1306 #define PKDHELP PKDHELP64
1308 typedef struct _KDHELP
1311 DWORD ThCallbackStack
;
1314 DWORD KiCallUserMode
;
1315 DWORD KeUserCallbackDispatcher
;
1316 DWORD SystemRangeStart
;
1320 typedef struct _KDHELP64
1323 DWORD ThCallbackStack
;
1324 DWORD ThCallbackBStore
;
1327 DWORD64 KiCallUserMode
;
1328 DWORD64 KeUserCallbackDispatcher
;
1329 DWORD64 SystemRangeStart
;
1330 DWORD64 Reserved
[8];
1331 } KDHELP64
, *PKDHELP64
;
1333 #if !defined(_IMAGEHLP_SOURCE_) && defined(_IMAGEHLP64)
1334 #define STACKFRAME STACKFRAME64
1335 #define LPSTACKFRAME LPSTACKFRAME64
1337 typedef struct _STACKFRAME
1343 PVOID FuncTableEntry
;
1350 } STACKFRAME
, *LPSTACKFRAME
;
1353 typedef struct _STACKFRAME64
1356 ADDRESS64 AddrReturn
;
1357 ADDRESS64 AddrFrame
;
1358 ADDRESS64 AddrStack
;
1359 ADDRESS64 AddrBStore
;
1360 PVOID FuncTableEntry
;
1364 DWORD64 Reserved
[3];
1366 } STACKFRAME64
, *LPSTACKFRAME64
;
1368 typedef BOOL (CALLBACK
*PREAD_PROCESS_MEMORY_ROUTINE64
)
1369 (HANDLE
, DWORD64
, PVOID
, DWORD
, PDWORD
);
1370 typedef PVOID (CALLBACK
*PFUNCTION_TABLE_ACCESS_ROUTINE64
)(HANDLE
, DWORD64
);
1371 typedef DWORD64 (CALLBACK
*PGET_MODULE_BASE_ROUTINE64
)(HANDLE
, DWORD64
);
1372 typedef DWORD64 (CALLBACK
*PTRANSLATE_ADDRESS_ROUTINE64
)(HANDLE
, HANDLE
, LPADDRESS64
);
1373 BOOL WINAPI
StackWalk64(DWORD
, HANDLE
, HANDLE
, LPSTACKFRAME64
, PVOID
,
1374 PREAD_PROCESS_MEMORY_ROUTINE64
,
1375 PFUNCTION_TABLE_ACCESS_ROUTINE64
,
1376 PGET_MODULE_BASE_ROUTINE64
,
1377 PTRANSLATE_ADDRESS_ROUTINE64
);
1379 PVOID WINAPI
SymFunctionTableAccess64(HANDLE
, DWORD64
);
1381 typedef PVOID (CALLBACK
*PSYMBOL_FUNCENTRY_CALLBACK64
)(HANDLE
, ULONG64
, ULONG64
);
1383 BOOL WINAPI
SymRegisterFunctionEntryCallback64(HANDLE
, PSYMBOL_FUNCENTRY_CALLBACK64
, ULONG64
);
1385 /*************************
1386 * Version, global stuff *
1387 *************************/
1389 #define API_VERSION_NUMBER 9
1391 typedef struct API_VERSION
1393 USHORT MajorVersion
;
1394 USHORT MinorVersion
;
1397 } API_VERSION
, *LPAPI_VERSION
;
1399 LPAPI_VERSION WINAPI
ImagehlpApiVersion(void);
1400 LPAPI_VERSION WINAPI
ImagehlpApiVersionEx(LPAPI_VERSION
);
1402 typedef struct _IMAGE_DEBUG_INFORMATION
1406 PVOID ReservedMappedBase
;
1407 USHORT ReservedMachine
;
1408 USHORT ReservedCharacteristics
;
1409 DWORD ReservedCheckSum
;
1412 DWORD ReservedNumberOfSections
;
1413 PIMAGE_SECTION_HEADER ReservedSections
;
1414 DWORD ReservedExportedNamesSize
;
1415 PSTR ReservedExportedNames
;
1416 DWORD ReservedNumberOfFunctionTableEntries
;
1417 PIMAGE_FUNCTION_ENTRY ReservedFunctionTableEntries
;
1418 DWORD ReservedLowestFunctionStartingAddress
;
1419 DWORD ReservedHighestFunctionEndingAddress
;
1420 DWORD ReservedNumberOfFpoTableEntries
;
1421 PFPO_DATA ReservedFpoTableEntries
;
1422 DWORD SizeOfCoffSymbols
;
1423 PIMAGE_COFF_SYMBOLS_HEADER CoffSymbols
;
1424 DWORD ReservedSizeOfCodeViewSymbols
;
1425 PVOID ReservedCodeViewSymbols
;
1428 PSTR ReservedDebugFilePath
;
1429 DWORD ReservedTimeDateStamp
;
1430 BOOL ReservedRomImage
;
1431 PIMAGE_DEBUG_DIRECTORY ReservedDebugDirectory
;
1432 DWORD ReservedNumberOfDebugDirectories
;
1433 DWORD ReservedOriginalFunctionTableBaseAddress
;
1434 DWORD Reserved
[ 2 ];
1435 } IMAGE_DEBUG_INFORMATION
, *PIMAGE_DEBUG_INFORMATION
;
1439 SYMOPT_EX_DISABLEACCESSTIMEUPDATE
,
1443 SYMOPT_EX_WINE_NATIVE_MODULES
= 1000,
1445 } IMAGEHLP_EXTENDED_OPTIONS
;
1447 PIMAGE_DEBUG_INFORMATION WINAPI
MapDebugInformation(HANDLE
, PCSTR
, PCSTR
, ULONG
);
1449 BOOL WINAPI
UnmapDebugInformation(PIMAGE_DEBUG_INFORMATION
);
1451 DWORD WINAPI
SymGetOptions(void);
1452 DWORD WINAPI
SymSetOptions(DWORD
);
1454 BOOL WINAPI
SymGetExtendedOption(IMAGEHLP_EXTENDED_OPTIONS option
);
1455 BOOL WINAPI
SymSetExtendedOption(IMAGEHLP_EXTENDED_OPTIONS option
, BOOL value
);
1457 BOOL WINAPI
SymSetParentWindow(HWND
);
1459 /*************************
1460 * Version, global stuff *
1461 *************************/
1463 typedef BOOL (WINAPI
* PSYMBOLSERVERPROC
)(PCSTR
, PCSTR
, PVOID
, DWORD
, DWORD
, PSTR
);
1464 typedef BOOL (WINAPI
* PSYMBOLSERVERPROCA
)(PCSTR
, PCSTR
, PVOID
, DWORD
, DWORD
, PSTR
);
1465 typedef BOOL (WINAPI
* PSYMBOLSERVERPROCW
)(PCWSTR
, PCWSTR
, PVOID
, DWORD
, DWORD
, PWSTR
);
1466 typedef BOOL (WINAPI
* PSYMBOLSERVEROPENPROC
)(void);
1467 typedef BOOL (WINAPI
* PSYMBOLSERVERCLOSEPROC
)(void);
1468 typedef BOOL (WINAPI
* PSYMBOLSERVERSETOPTIONSPROC
)(UINT_PTR
, ULONG64
);
1469 typedef BOOL (CALLBACK
* PSYMBOLSERVERCALLBACKPROC
)(UINT_PTR
, ULONG64
, ULONG64
);
1470 typedef UINT_PTR (WINAPI
* PSYMBOLSERVERGETOPTIONSPROC
)(void);
1471 typedef BOOL (WINAPI
* PSYMBOLSERVERPINGPROC
)(PCSTR
);
1472 typedef BOOL (WINAPI
* PSYMBOLSERVERPINGPROCA
)(PCSTR
);
1473 typedef BOOL (WINAPI
* PSYMBOLSERVERPINGPROCW
)(PCWSTR
);
1475 #define SSRVOPT_CALLBACK 0x0001
1476 #define SSRVOPT_DWORD 0x0002
1477 #define SSRVOPT_DWORDPTR 0x0004
1478 #define SSRVOPT_GUIDPTR 0x0008
1479 #define SSRVOPT_OLDGUIDPTR 0x0010
1480 #define SSRVOPT_UNATTENDED 0x0020
1481 #define SSRVOPT_NOCOPY 0x0040
1482 #define SSRVOPT_PARENTWIN 0x0080
1483 #define SSRVOPT_PARAMTYPE 0x0100
1484 #define SSRVOPT_SECURE 0x0200
1485 #define SSRVOPT_TRACE 0x0400
1486 #define SSRVOPT_SETCONTEXT 0x0800
1487 #define SSRVOPT_PROXY 0x1000
1488 #define SSRVOPT_DOWNSTREAM_STORE 0x2000
1489 #define SSRVOPT_RESET ((ULONG_PTR)-1)
1491 #define SSRVACTION_TRACE 1
1492 #define SSRVACTION_QUERYCANCEL 2
1493 #define SSRVACTION_EVENT 3
1495 /* 32-bit functions */
1497 #if !defined(_IMAGEHLP_SOURCE_) && defined(_IMAGEHLP64)
1499 #define PENUMLOADED_MODULES_CALLBACK PENUMLOADED_MODULES_CALLBACK64
1500 #define PFUNCTION_TABLE_ACCESS_ROUTINE PFUNCTION_TABLE_ACCESS_ROUTINE64
1501 #define PGET_MODULE_BASE_ROUTINE PGET_MODULE_BASE_ROUTINE64
1502 #define PREAD_PROCESS_MEMORY_ROUTINE PREAD_PROCESS_MEMORY_ROUTINE64
1503 #define PSYMBOL_FUNCENTRY_CALLBACK PSYMBOL_FUNCENTRY_CALLBACK64
1504 #define PSYMBOL_REGISTERED_CALLBACK PSYMBOL_REGISTERED_CALLBACK64
1505 #define PSYM_ENUMMODULES_CALLBACK PSYM_ENUMMODULES_CALLBACK64
1506 #define PSYM_ENUMSYMBOLS_CALLBACK PSYM_ENUMSYMBOLS_CALLBACK64
1507 #define PSYM_ENUMSYMBOLS_CALLBACKW PSYM_ENUMSYMBOLS_CALLBACKW64
1508 #define PTRANSLATE_ADDRESS_ROUTINE PTRANSLATE_ADDRESS_ROUTINE64
1510 #define EnumerateLoadedModules EnumerateLoadedModules64
1511 #define StackWalk StackWalk64
1512 #define SymEnumerateModules SymEnumerateModules64
1513 #define SymEnumerateSymbols SymEnumerateSymbols64
1514 #define SymEnumerateSymbolsW SymEnumerateSymbolsW64
1515 #define SymFunctionTableAccess SymFunctionTableAccess64
1516 #define SymGetLineFromAddr SymGetLineFromAddr64
1517 #define SymGetLineFromAddrW SymGetLineFromAddrW64
1518 #define SymGetLineFromName SymGetLineFromName64
1519 #define SymGetLineNext SymGetLineNext64
1520 #define SymGetLineNextW SymGetLineNextW64
1521 #define SymGetLinePrev SymGetLinePrev64
1522 #define SymGetLinePrevW SymGetLinePrevW64
1523 #define SymGetModuleBase SymGetModuleBase64
1524 #define SymGetModuleInfo SymGetModuleInfo64
1525 #define SymGetModuleInfoW SymGetModuleInfoW64
1526 #define SymGetSymFromAddr SymGetSymFromAddr64
1527 #define SymGetSymFromName SymGetSymFromName64
1528 #define SymGetSymNext SymGetSymNext64
1529 #define SymGetSymNextW SymGetSymNextW64
1530 #define SymGetSymPrev SymGetSymPrev64
1531 #define SymGetSymPrevW SymGetSymPrevW64
1532 #define SymLoadModule SymLoadModule64
1533 #define SymRegisterCallback SymRegisterCallback64
1534 #define SymRegisterFunctionEntryCallback SymRegisterFunctionEntryCallback64
1535 #define SymUnDName SymUnDName64
1536 #define SymUnloadModule SymUnloadModule64
1540 typedef BOOL (CALLBACK
*PENUMLOADED_MODULES_CALLBACK
)(PCSTR
, ULONG
, ULONG
, PVOID
);
1541 typedef PVOID (CALLBACK
*PFUNCTION_TABLE_ACCESS_ROUTINE
)(HANDLE
, DWORD
);
1542 typedef DWORD (CALLBACK
*PGET_MODULE_BASE_ROUTINE
)(HANDLE
, DWORD
);
1543 typedef BOOL (CALLBACK
*PREAD_PROCESS_MEMORY_ROUTINE
)(HANDLE
, DWORD
, PVOID
, DWORD
, PDWORD
);
1544 typedef BOOL (CALLBACK
*PSYM_ENUMMODULES_CALLBACK
)(PCSTR
, ULONG
, PVOID
);
1545 typedef BOOL (CALLBACK
*PSYM_ENUMSYMBOLS_CALLBACK
)(PCSTR
, ULONG
, ULONG
, PVOID
);
1546 typedef BOOL (CALLBACK
*PSYM_ENUMSYMBOLS_CALLBACKW
)(PCWSTR
, ULONG
, ULONG
, PVOID
);
1547 typedef BOOL (CALLBACK
*PSYMBOL_REGISTERED_CALLBACK
)(HANDLE
, ULONG
, PVOID
, PVOID
);
1548 typedef PVOID (CALLBACK
*PSYMBOL_FUNCENTRY_CALLBACK
)(HANDLE
, DWORD
, PVOID
);
1549 typedef DWORD (CALLBACK
*PTRANSLATE_ADDRESS_ROUTINE
)(HANDLE
, HANDLE
, LPADDRESS
);
1551 BOOL WINAPI
EnumerateLoadedModules(HANDLE
, PENUMLOADED_MODULES_CALLBACK
, PVOID
);
1552 BOOL WINAPI
StackWalk(DWORD
, HANDLE
, HANDLE
, LPSTACKFRAME
, PVOID
, PREAD_PROCESS_MEMORY_ROUTINE
, PFUNCTION_TABLE_ACCESS_ROUTINE
, PGET_MODULE_BASE_ROUTINE
, PTRANSLATE_ADDRESS_ROUTINE
);
1553 BOOL WINAPI
SymEnumerateModules(HANDLE
, PSYM_ENUMMODULES_CALLBACK
, PVOID
);
1554 BOOL WINAPI
SymEnumerateSymbols(HANDLE
, ULONG
, PSYM_ENUMSYMBOLS_CALLBACK
, PVOID
);
1555 BOOL WINAPI
SymEnumerateSymbolsW(HANDLE
, ULONG
, PSYM_ENUMSYMBOLS_CALLBACKW
, PVOID
);
1556 PVOID WINAPI
SymFunctionTableAccess(HANDLE
, DWORD
);
1557 BOOL WINAPI
SymGetLineFromAddr(HANDLE
, DWORD
, PDWORD
, PIMAGEHLP_LINE
);
1558 BOOL WINAPI
SymGetLineFromAddrW(HANDLE
, DWORD
, PDWORD
, PIMAGEHLP_LINEW
);
1559 BOOL WINAPI
SymGetLineFromName(HANDLE
, PCSTR
, PCSTR
, DWORD
, PLONG
, PIMAGEHLP_LINE
);
1560 BOOL WINAPI
SymGetLineNext(HANDLE
, PIMAGEHLP_LINE
);
1561 BOOL WINAPI
SymGetLineNextW(HANDLE
, PIMAGEHLP_LINEW
);
1562 BOOL WINAPI
SymGetLinePrev(HANDLE
, PIMAGEHLP_LINE
);
1563 BOOL WINAPI
SymGetLinePrevW(HANDLE
, PIMAGEHLP_LINEW
);
1564 DWORD WINAPI
SymGetModuleBase(HANDLE
, DWORD
);
1565 BOOL WINAPI
SymGetModuleInfo(HANDLE
, DWORD
, PIMAGEHLP_MODULE
);
1566 BOOL WINAPI
SymGetModuleInfoW(HANDLE
, DWORD
, PIMAGEHLP_MODULEW
);
1567 BOOL WINAPI
SymGetSymFromAddr(HANDLE
, DWORD
, PDWORD
, PIMAGEHLP_SYMBOL
);
1568 BOOL WINAPI
SymGetSymFromName(HANDLE
, PCSTR
, PIMAGEHLP_SYMBOL
);
1569 BOOL WINAPI
SymGetSymNext(HANDLE
, PIMAGEHLP_SYMBOL
);
1570 BOOL WINAPI
SymGetSymNextW(HANDLE
, PIMAGEHLP_SYMBOLW
);
1571 BOOL WINAPI
SymGetSymPrev(HANDLE
, PIMAGEHLP_SYMBOL
);
1572 BOOL WINAPI
SymGetSymPrevW(HANDLE
, PIMAGEHLP_SYMBOLW
);
1573 DWORD WINAPI
SymLoadModule(HANDLE
, HANDLE
, PCSTR
, PCSTR
, DWORD
, DWORD
);
1574 BOOL WINAPI
SymRegisterCallback(HANDLE
, PSYMBOL_REGISTERED_CALLBACK
, PVOID
);
1575 BOOL WINAPI
SymRegisterFunctionEntryCallback(HANDLE
, PSYMBOL_FUNCENTRY_CALLBACK
, PVOID
);
1576 BOOL WINAPI
SymRefreshModuleList(HANDLE
);
1577 BOOL WINAPI
SymUnDName(PIMAGEHLP_SYMBOL
, PSTR
, DWORD
);
1578 BOOL WINAPI
SymUnloadModule(HANDLE
, DWORD
);
1584 #endif /* defined(__cplusplus) */
1586 #endif /* __WINE_DBGHELP_H */