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];
283 } IMAGEHLP_MODULE64
, *PIMAGEHLP_MODULE64
;
285 typedef struct _IMAGEHLP_MODULEW64
294 WCHAR ModuleName
[32];
295 WCHAR ImageName
[256];
296 WCHAR LoadedImageName
[256];
297 WCHAR LoadedPdbName
[256];
299 WCHAR CVData
[MAX_PATH
*3];
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
318 typedef struct _IMAGEHLP_LINE
325 } IMAGEHLP_LINE
, *PIMAGEHLP_LINE
;
327 typedef struct _IMAGEHLP_LINEW
334 } IMAGEHLP_LINEW
, *PIMAGEHLP_LINEW
;
337 typedef struct _IMAGEHLP_LINE64
344 } IMAGEHLP_LINE64
, *PIMAGEHLP_LINE64
;
346 typedef struct _IMAGEHLP_LINEW64
353 } IMAGEHLP_LINEW64
, *PIMAGEHLP_LINEW64
;
355 typedef struct _SOURCEFILE
359 } SOURCEFILE
, *PSOURCEFILE
;
361 typedef struct _SOURCEFILEW
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
385 } IMAGEHLP_CBA_READ_MEMORY
, *PIMAGEHLP_CBA_READ_MEMORY
;
396 #define EVENT_SRCSPEW_START 100
397 #define EVENT_SRCSPEW 100
398 #define EVENT_SRCSPEW_END 199
400 typedef struct _IMAGEHLP_CBA_EVENT
406 } IMAGEHLP_CBA_EVENT
, *PIMAGEHLP_CBA_EVENT
;
408 typedef struct _IMAGEHLP_CBA_EVENTW
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
420 typedef struct _IMAGEHLP_DEFERRED_SYMBOL_LOAD
426 CHAR FileName
[MAX_PATH
];
429 } IMAGEHLP_DEFERRED_SYMBOL_LOAD
, *PIMAGEHLP_DEFERRED_SYMBOL_LOAD
;
432 typedef struct _IMAGEHLP_DEFERRED_SYMBOL_LOAD64
438 CHAR FileName
[MAX_PATH
];
442 } IMAGEHLP_DEFERRED_SYMBOL_LOAD64
, *PIMAGEHLP_DEFERRED_SYMBOL_LOAD64
;
444 typedef struct _IMAGEHLP_DEFERRED_SYMBOL_LOADW64
450 WCHAR FileName
[MAX_PATH
+ 1];
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
460 typedef struct _IMAGEHLP_DUPLICATE_SYMBOL
464 PIMAGEHLP_SYMBOL Symbol
;
465 DWORD SelectedSymbol
;
466 } IMAGEHLP_DUPLICATE_SYMBOL
, *PIMAGEHLP_DUPLICATE_SYMBOL
;
469 typedef struct _IMAGEHLP_DUPLICATE_SYMBOL64
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
504 #define SYMOPT_DEBUG 0x80000000
506 typedef struct _IMAGEHLP_STACK_FRAME
508 ULONG64 InstructionOffset
;
509 ULONG64 ReturnOffset
;
512 ULONG64 BackingStoreOffset
;
513 ULONG64 FuncTableEntry
;
518 } IMAGEHLP_STACK_FRAME
, *PIMAGEHLP_STACK_FRAME
;
520 typedef VOID IMAGEHLP_CONTEXT
, *PIMAGEHLP_CONTEXT
;
522 #define DBHHEADER_DEBUGDIRS 0x1
523 typedef struct _DBGHELP_MODLOAD_DATA
530 } MODLOAD_DATA
, *PMODLOAD_DATA
;
532 /*************************
534 *************************/
536 #include <pshpack4.h>
539 #define MINIDUMP_SIGNATURE 0x504D444D /* 'MDMP' */
540 #define MINIDUMP_VERSION (42899)
543 typedef ULONG64 RVA64
;
545 typedef enum _MINIDUMP_TYPE
547 MiniDumpNormal
= 0x0000,
548 MiniDumpWithDataSegs
= 0x0001,
549 MiniDumpWithFullMemory
= 0x0002,
550 MiniDumpWithHandleData
= 0x0004,
551 MiniDumpFilterMemory
= 0x0008,
552 MiniDumpScanMemory
= 0x0010,
553 MiniDumpWithUnloadedModules
= 0x0020,
554 MiniDumpWithIndirectlyReferencedMemory
= 0x0040,
555 MiniDumpFilterModulePaths
= 0x0080,
556 MiniDumpWithProcessThreadData
= 0x0100,
557 MiniDumpWithPrivateReadWriteMemory
= 0x0200,
558 MiniDumpWithoutOptionalData
= 0x0400,
559 MiniDumpWithFullMemoryInfo
= 0x0800,
560 MiniDumpWithThreadInfo
= 0x1000,
561 MiniDumpWithCodeSegs
= 0x2000
564 typedef enum _MINIDUMP_CALLBACK_TYPE
569 IncludeThreadCallback
,
570 IncludeModuleCallback
,
572 } MINIDUMP_CALLBACK_TYPE
;
574 typedef struct _MINIDUMP_THREAD_CALLBACK
582 } MINIDUMP_THREAD_CALLBACK
, *PMINIDUMP_THREAD_CALLBACK
;
584 typedef struct _MINIDUMP_THREAD_EX_CALLBACK
592 ULONG64 BackingStoreBase
;
593 ULONG64 BackingStoreEnd
;
594 } MINIDUMP_THREAD_EX_CALLBACK
, *PMINIDUMP_THREAD_EX_CALLBACK
;
596 typedef struct _MINIDUMP_INCLUDE_THREAD_CALLBACK
599 } MINIDUMP_INCLUDE_THREAD_CALLBACK
, *PMINIDUMP_INCLUDE_THREAD_CALLBACK
;
601 typedef enum _THREAD_WRITE_FLAGS
603 ThreadWriteThread
= 0x0001,
604 ThreadWriteStack
= 0x0002,
605 ThreadWriteContext
= 0x0004,
606 ThreadWriteBackingStore
= 0x0008,
607 ThreadWriteInstructionWindow
= 0x0010,
608 ThreadWriteThreadData
= 0x0020,
609 ThreadWriteThreadInfo
= 0x0040
610 } THREAD_WRITE_FLAGS
;
612 typedef struct _MINIDUMP_MODULE_CALLBACK
619 VS_FIXEDFILEINFO VersionInfo
;
621 ULONG SizeOfCvRecord
;
623 ULONG SizeOfMiscRecord
;
624 } MINIDUMP_MODULE_CALLBACK
, *PMINIDUMP_MODULE_CALLBACK
;
626 typedef struct _MINIDUMP_INCLUDE_MODULE_CALLBACK
629 } MINIDUMP_INCLUDE_MODULE_CALLBACK
, *PMINIDUMP_INCLUDE_MODULE_CALLBACK
;
631 typedef enum _MODULE_WRITE_FLAGS
633 ModuleWriteModule
= 0x0001,
634 ModuleWriteDataSeg
= 0x0002,
635 ModuleWriteMiscRecord
= 0x0004,
636 ModuleWriteCvRecord
= 0x0008,
637 ModuleReferencedByMemory
= 0x0010,
638 ModuleWriteTlsData
= 0x0020,
639 ModuleWriteCodeSegs
= 0x0040,
640 } MODULE_WRITE_FLAGS
;
642 typedef struct _MINIDUMP_CALLBACK_INPUT
645 HANDLE ProcessHandle
;
649 MINIDUMP_THREAD_CALLBACK Thread
;
650 MINIDUMP_THREAD_EX_CALLBACK ThreadEx
;
651 MINIDUMP_MODULE_CALLBACK Module
;
652 MINIDUMP_INCLUDE_THREAD_CALLBACK IncludeThread
;
653 MINIDUMP_INCLUDE_MODULE_CALLBACK IncludeModule
;
655 } MINIDUMP_CALLBACK_INPUT
, *PMINIDUMP_CALLBACK_INPUT
;
657 typedef struct _MINIDUMP_CALLBACK_OUTPUT
661 ULONG ModuleWriteFlags
;
662 ULONG ThreadWriteFlags
;
669 } MINIDUMP_CALLBACK_OUTPUT
, *PMINIDUMP_CALLBACK_OUTPUT
;
671 typedef BOOL (WINAPI
* MINIDUMP_CALLBACK_ROUTINE
)(PVOID
, const PMINIDUMP_CALLBACK_INPUT
, PMINIDUMP_CALLBACK_OUTPUT
);
673 typedef struct _MINIDUMP_CALLBACK_INFORMATION
675 MINIDUMP_CALLBACK_ROUTINE CallbackRoutine
;
677 } MINIDUMP_CALLBACK_INFORMATION
, *PMINIDUMP_CALLBACK_INFORMATION
;
679 typedef struct _MINIDUMP_LOCATION_DESCRIPTOR
683 } MINIDUMP_LOCATION_DESCRIPTOR
;
685 typedef struct _MINIDUMP_LOCATION_DESCRIPTOR64
689 } MINIDUMP_LOCATION_DESCRIPTOR64
;
691 typedef struct _MINIDUMP_DIRECTORY
694 MINIDUMP_LOCATION_DESCRIPTOR Location
;
695 } MINIDUMP_DIRECTORY
, *PMINIDUMP_DIRECTORY
;
697 typedef struct _MINIDUMP_EXCEPTION
700 ULONG ExceptionFlags
;
701 ULONG64 ExceptionRecord
;
702 ULONG64 ExceptionAddress
;
703 ULONG NumberParameters
;
704 ULONG __unusedAlignment
;
705 ULONG64 ExceptionInformation
[EXCEPTION_MAXIMUM_PARAMETERS
];
706 } MINIDUMP_EXCEPTION
, *PMINIDUMP_EXCEPTION
;
708 typedef struct _MINIDUMP_EXCEPTION_INFORMATION
711 PEXCEPTION_POINTERS ExceptionPointers
;
713 } MINIDUMP_EXCEPTION_INFORMATION
, *PMINIDUMP_EXCEPTION_INFORMATION
;
715 typedef struct MINIDUMP_EXCEPTION_STREAM
719 MINIDUMP_EXCEPTION ExceptionRecord
;
720 MINIDUMP_LOCATION_DESCRIPTOR ThreadContext
;
721 } MINIDUMP_EXCEPTION_STREAM
, *PMINIDUMP_EXCEPTION_STREAM
;
723 typedef struct _MINIDUMP_HEADER
727 DWORD NumberOfStreams
;
728 RVA StreamDirectoryRva
;
736 } MINIDUMP_HEADER
, *PMINIDUMP_HEADER
;
738 typedef struct _MINIDUMP_MEMORY_DESCRIPTOR
740 ULONG64 StartOfMemoryRange
;
741 MINIDUMP_LOCATION_DESCRIPTOR Memory
;
742 } MINIDUMP_MEMORY_DESCRIPTOR
, *PMINIDUMP_MEMORY_DESCRIPTOR
;
744 typedef struct _MINIDUMP_MEMORY_LIST
746 ULONG NumberOfMemoryRanges
;
747 MINIDUMP_MEMORY_DESCRIPTOR MemoryRanges
[1]; /* FIXME: 0-sized array not supported */
748 } MINIDUMP_MEMORY_LIST
, *PMINIDUMP_MEMORY_LIST
;
750 typedef struct _MINIDUMP_MEMORY_DESCRIPTOR64
752 ULONG64 StartOfMemoryRange
;
754 } MINIDUMP_MEMORY_DESCRIPTOR64
, *PMINIDUMP_MEMORY_DESCRIPTOR64
;
756 typedef struct _MINIDUMP_MEMORY64_LIST
758 ULONG64 NumberOfMemoryRanges
;
760 MINIDUMP_MEMORY_DESCRIPTOR64 MemoryRanges
[1]; /* FIXME: 0-sized array not supported */
761 } MINIDUMP_MEMORY64_LIST
, *PMINIDUMP_MEMORY64_LIST
;
763 #define MINIDUMP_MISC1_PROCESS_ID 0x00000001
764 #define MINIDUMP_MISC1_PROCESS_TIMES 0x00000002
766 typedef struct _MINIDUMP_MISC_INFO
771 ULONG ProcessCreateTime
;
772 ULONG ProcessUserTime
;
773 ULONG ProcessKernelTime
;
774 } MINIDUMP_MISC_INFO
, *PMINIDUMP_MISC_INFO
;
776 typedef struct _MINIDUMP_MODULE
783 VS_FIXEDFILEINFO VersionInfo
;
784 MINIDUMP_LOCATION_DESCRIPTOR CvRecord
;
785 MINIDUMP_LOCATION_DESCRIPTOR MiscRecord
;
788 } MINIDUMP_MODULE
, *PMINIDUMP_MODULE
;
790 typedef struct _MINIDUMP_MODULE_LIST
792 ULONG NumberOfModules
;
793 MINIDUMP_MODULE Modules
[1]; /* FIXME: 0-sized array not supported */
794 } MINIDUMP_MODULE_LIST
, *PMINIDUMP_MODULE_LIST
;
796 typedef struct _MINIDUMP_STRING
799 WCHAR Buffer
[1]; /* FIXME: O-sized array not supported */
800 } MINIDUMP_STRING
, *PMINIDUMP_STRING
;
802 typedef struct _MINIDUMP_SYSTEM_INFO
804 USHORT ProcessorArchitecture
;
805 USHORT ProcessorLevel
;
806 USHORT ProcessorRevision
;
812 UCHAR NumberOfProcessors
;
832 union _CPU_INFORMATION
837 ULONG VersionInformation
;
838 ULONG FeatureInformation
;
839 ULONG AMDExtendedCpuFeatures
;
843 ULONG64 ProcessorFeatures
[2];
847 } MINIDUMP_SYSTEM_INFO
, *PMINIDUMP_SYSTEM_INFO
;
849 typedef struct _MINIDUMP_THREAD
856 MINIDUMP_MEMORY_DESCRIPTOR Stack
;
857 MINIDUMP_LOCATION_DESCRIPTOR ThreadContext
;
858 } MINIDUMP_THREAD
, *PMINIDUMP_THREAD
;
860 typedef struct _MINIDUMP_THREAD_LIST
862 ULONG NumberOfThreads
;
863 MINIDUMP_THREAD Threads
[1]; /* FIXME: no support of 0 sized array */
864 } MINIDUMP_THREAD_LIST
, *PMINIDUMP_THREAD_LIST
;
866 typedef struct _MINIDUMP_USER_STREAM
871 } MINIDUMP_USER_STREAM
, *PMINIDUMP_USER_STREAM
;
873 typedef struct _MINIDUMP_USER_STREAM_INFORMATION
875 ULONG UserStreamCount
;
876 PMINIDUMP_USER_STREAM UserStreamArray
;
877 } MINIDUMP_USER_STREAM_INFORMATION
, *PMINIDUMP_USER_STREAM_INFORMATION
;
879 typedef enum _MINIDUMP_STREAM_TYPE
884 ThreadListStream
= 3,
885 ModuleListStream
= 4,
886 MemoryListStream
= 5,
888 SystemInfoStream
= 7,
889 ThreadExListStream
= 8,
890 Memory64ListStream
= 9,
893 HandleDataStream
= 12,
894 FunctionTableStream
= 13,
895 UnloadedModuleListStream
= 14,
897 MemoryInfoListStream
= 16,
898 ThreadInfoListStream
= 17,
900 LastReservedStream
= 0xffff
901 } MINIDUMP_STREAM_TYPE
;
903 BOOL WINAPI
MiniDumpWriteDump(HANDLE
, DWORD
, HANDLE
, MINIDUMP_TYPE
,
904 const PMINIDUMP_EXCEPTION_INFORMATION
,
905 const PMINIDUMP_USER_STREAM_INFORMATION
,
906 const PMINIDUMP_CALLBACK_INFORMATION
);
907 BOOL WINAPI
MiniDumpReadDumpStream(PVOID
, ULONG
, PMINIDUMP_DIRECTORY
*, PVOID
*,
912 /*************************
914 *************************/
916 /* flags for SymLoadModuleEx */
917 #define SLMFLAG_VIRTUAL 0x1
918 #define SLMFLAG_NO_SYMBOLS 0x4
920 typedef BOOL (CALLBACK
*PENUMLOADED_MODULES_CALLBACK64
)(PCSTR
, DWORD64
, ULONG
, PVOID
);
921 BOOL WINAPI
EnumerateLoadedModules64(HANDLE
, PENUMLOADED_MODULES_CALLBACK64
, PVOID
);
922 typedef BOOL (CALLBACK
*PENUMLOADED_MODULES_CALLBACKW64
)(PCWSTR
, DWORD64
, ULONG
, PVOID
);
923 BOOL WINAPI
EnumerateLoadedModulesW64(HANDLE
, PENUMLOADED_MODULES_CALLBACKW64
, PVOID
);
924 BOOL WINAPI
EnumerateLoadedModulesEx(HANDLE
, PENUMLOADED_MODULES_CALLBACK64
, PVOID
);
925 BOOL WINAPI
EnumerateLoadedModulesExW(HANDLE
, PENUMLOADED_MODULES_CALLBACKW64
, PVOID
);
926 typedef BOOL (CALLBACK
*PSYM_ENUMMODULES_CALLBACK64
)(PCSTR
, DWORD64
, PVOID
);
927 BOOL WINAPI
SymEnumerateModules64(HANDLE
, PSYM_ENUMMODULES_CALLBACK64
, PVOID
);
928 typedef BOOL (CALLBACK
*PSYM_ENUMMODULES_CALLBACKW64
)(PCWSTR
, DWORD64
, PVOID
);
929 BOOL WINAPI
SymEnumerateModulesW64(HANDLE
, PSYM_ENUMMODULES_CALLBACKW64
, PVOID
);
930 BOOL WINAPI
SymGetModuleInfo64(HANDLE
, DWORD64
, PIMAGEHLP_MODULE64
);
931 BOOL WINAPI
SymGetModuleInfoW64(HANDLE
, DWORD64
, PIMAGEHLP_MODULEW64
);
932 DWORD64 WINAPI
SymGetModuleBase64(HANDLE
, DWORD64
);
933 DWORD64 WINAPI
SymLoadModule64(HANDLE
, HANDLE
, PCSTR
, PCSTR
, DWORD64
, DWORD
);
934 DWORD64 WINAPI
SymLoadModuleEx(HANDLE
, HANDLE
, PCSTR
, PCSTR
, DWORD64
, DWORD
,
935 PMODLOAD_DATA
, DWORD
);
936 DWORD64 WINAPI
SymLoadModuleExW(HANDLE
, HANDLE
, PCWSTR
, PCWSTR
, DWORD64
, DWORD
,
937 PMODLOAD_DATA
, DWORD
);
938 BOOL WINAPI
SymUnloadModule64(HANDLE
, DWORD64
);
940 /*************************
942 *************************/
944 #define IMAGEHLP_SYMBOL_INFO_VALUEPRESENT 1
945 #define IMAGEHLP_SYMBOL_INFO_REGISTER SYMF_REGISTER /* 0x08 */
946 #define IMAGEHLP_SYMBOL_INFO_REGRELATIVE SYMF_REGREL /* 0x10 */
947 #define IMAGEHLP_SYMBOL_INFO_FRAMERELATIVE SYMF_FRAMEREL /* 0x20 */
948 #define IMAGEHLP_SYMBOL_INFO_PARAMETER SYMF_PARAMETER /* 0x40 */
949 #define IMAGEHLP_SYMBOL_INFO_LOCAL SYMF_LOCAL /* 0x80 */
950 #define IMAGEHLP_SYMBOL_INFO_CONSTANT SYMF_CONSTANT /* 0x100 */
951 #define IMAGEHLP_SYMBOL_FUNCTION SYMF_FUNCTION /* 0x800 */
953 #define SYMFLAG_VALUEPRESENT 0x00000001
954 #define SYMFLAG_REGISTER 0x00000008
955 #define SYMFLAG_REGREL 0x00000010
956 #define SYMFLAG_FRAMEREL 0x00000020
957 #define SYMFLAG_PARAMETER 0x00000040
958 #define SYMFLAG_LOCAL 0x00000080
959 #define SYMFLAG_CONSTANT 0x00000100
960 #define SYMFLAG_EXPORT 0x00000200
961 #define SYMFLAG_FORWARDER 0x00000400
962 #define SYMFLAG_FUNCTION 0x00000800
963 #define SYMFLAG_VIRTUAL 0x00001000
964 #define SYMFLAG_THUNK 0x00002000
965 #define SYMFLAG_TLSREL 0x00004000
966 #define SYMFLAG_SLOT 0x00008000
967 #define SYMFLAG_ILREL 0x00010000
968 #define SYMFLAG_METADATA 0x00020000
969 #define SYMFLAG_CLR_TOKEN 0x00040000
970 #define SYMFLAG_NULL 0x00080000
971 #define SYMFLAG_FUNC_NO_RETURN 0x00100000
972 #define SYMFLAG_SYNTHETIC_ZEROBASE 0x00200000
973 #define SYMFLAG_PUBLIC_CODE 0x00400000
975 #define MAX_SYM_NAME 2000
977 typedef struct _SYMBOL_INFO
994 } SYMBOL_INFO
, *PSYMBOL_INFO
;
996 typedef struct _SYMBOL_INFOW
1000 ULONG64 Reserved
[2];
1013 } SYMBOL_INFOW
, *PSYMBOL_INFOW
;
1015 typedef struct _SYMBOL_INFO_PACKAGE
1018 CHAR name
[MAX_SYM_NAME
+1];
1019 } SYMBOL_INFO_PACKAGE
, *PSYMBOL_INFO_PACKAGE
;
1021 typedef struct _SYMBOL_INFO_PACKAGEW
1024 WCHAR name
[MAX_SYM_NAME
+1];
1025 } SYMBOL_INFO_PACKAGEW
, *PSYMBOL_INFO_PACKAGEW
;
1027 typedef enum _IMAGEHLP_SYMBOL_TYPE_INFO
1035 TI_GET_ARRAYINDEXTYPEID
,
1038 TI_GET_ADDRESSOFFSET
,
1042 TI_GET_CHILDRENCOUNT
,
1044 TI_GET_VIRTUALBASECLASS
,
1045 TI_GET_VIRTUALTABLESHAPEID
,
1046 TI_GET_VIRTUALBASEPOINTEROFFSET
,
1047 TI_GET_CLASSPARENTID
,
1050 TI_GET_LEXICALPARENT
,
1055 TI_GET_CALLING_CONVENTION
,
1056 } IMAGEHLP_SYMBOL_TYPE_INFO
;
1058 #define IMAGEHLP_GET_TYPE_INFO_UNCACHED 0x00000001
1059 #define IMAGEHLP_GET_TYPE_INFO_CHILDREN 0x00000002
1060 typedef struct _IMAGEHLP_GET_TYPE_INFO_PARAMS
1068 IMAGEHLP_SYMBOL_TYPE_INFO
* ReqKinds
;
1069 PULONG_PTR ReqOffsets
;
1071 ULONG_PTR ReqStride
;
1072 ULONG_PTR BufferSize
;
1074 ULONG EntriesMatched
;
1075 ULONG EntriesFilled
;
1077 ULONG64 AllReqsValid
;
1080 } IMAGEHLP_GET_TYPE_INFO_PARAMS
, *PIMAGEHLP_GET_TYPE_INFO_PARAMS
;
1082 typedef struct _TI_FINDCHILDREN_PARAMS
1087 } TI_FINDCHILDREN_PARAMS
;
1089 #define UNDNAME_COMPLETE (0x0000)
1090 #define UNDNAME_NO_LEADING_UNDERSCORES (0x0001)
1091 #define UNDNAME_NO_MS_KEYWORDS (0x0002)
1092 #define UNDNAME_NO_FUNCTION_RETURNS (0x0004)
1093 #define UNDNAME_NO_ALLOCATION_MODEL (0x0008)
1094 #define UNDNAME_NO_ALLOCATION_LANGUAGE (0x0010)
1095 #define UNDNAME_NO_MS_THISTYPE (0x0020)
1096 #define UNDNAME_NO_CV_THISTYPE (0x0040)
1097 #define UNDNAME_NO_THISTYPE (0x0060)
1098 #define UNDNAME_NO_ACCESS_SPECIFIERS (0x0080)
1099 #define UNDNAME_NO_THROW_SIGNATURES (0x0100)
1100 #define UNDNAME_NO_MEMBER_TYPE (0x0200)
1101 #define UNDNAME_NO_RETURN_UDT_MODEL (0x0400)
1102 #define UNDNAME_32_BIT_DECODE (0x0800)
1103 #define UNDNAME_NAME_ONLY (0x1000)
1104 #define UNDNAME_NO_ARGUMENTS (0x2000)
1105 #define UNDNAME_NO_SPECIAL_SYMS (0x4000)
1107 #define SYMSEARCH_MASKOBJS 0x01
1108 #define SYMSEARCH_RECURSE 0x02
1109 #define SYMSEARCH_GLOBALSONLY 0x04
1111 BOOL WINAPI
SymGetTypeInfo(HANDLE
, DWORD64
, ULONG
, IMAGEHLP_SYMBOL_TYPE_INFO
, PVOID
);
1112 BOOL WINAPI
SymGetTypeInfoEx(HANDLE
, DWORD64
, PIMAGEHLP_GET_TYPE_INFO_PARAMS
);
1113 typedef BOOL (CALLBACK
*PSYM_ENUMERATESYMBOLS_CALLBACK
)(PSYMBOL_INFO
, ULONG
, PVOID
);
1114 typedef BOOL (CALLBACK
*PSYM_ENUMERATESYMBOLS_CALLBACKW
)(PSYMBOL_INFOW
, ULONG
, PVOID
);
1115 BOOL WINAPI
SymEnumTypes(HANDLE
, ULONG64
, PSYM_ENUMERATESYMBOLS_CALLBACK
, PVOID
);
1116 BOOL WINAPI
SymEnumTypesW(HANDLE
, ULONG64
, PSYM_ENUMERATESYMBOLS_CALLBACKW
, PVOID
);
1117 BOOL WINAPI
SymFromAddr(HANDLE
, DWORD64
, DWORD64
*, SYMBOL_INFO
*);
1118 BOOL WINAPI
SymFromAddrW(HANDLE
, DWORD64
, DWORD64
*, SYMBOL_INFOW
*);
1119 BOOL WINAPI
SymFromToken(HANDLE
, DWORD64
, DWORD
, PSYMBOL_INFO
);
1120 BOOL WINAPI
SymFromTokenW(HANDLE
, DWORD64
, DWORD
, PSYMBOL_INFOW
);
1121 BOOL WINAPI
SymFromName(HANDLE
, PCSTR
, PSYMBOL_INFO
);
1122 BOOL WINAPI
SymFromNameW(HANDLE
, PCWSTR
, PSYMBOL_INFOW
);
1123 BOOL WINAPI
SymGetSymFromAddr64(HANDLE
, DWORD64
, PDWORD64
, PIMAGEHLP_SYMBOL64
);
1124 BOOL WINAPI
SymGetSymFromName64(HANDLE
, PCSTR
, PIMAGEHLP_SYMBOL64
);
1125 BOOL WINAPI
SymGetTypeFromName(HANDLE
, ULONG64
, PCSTR
, PSYMBOL_INFO
);
1126 BOOL WINAPI
SymGetTypeFromNameW(HANDLE
, ULONG64
, PCWSTR
, PSYMBOL_INFOW
);
1127 BOOL WINAPI
SymGetSymNext64(HANDLE
, PIMAGEHLP_SYMBOL64
);
1128 BOOL WINAPI
SymGetSymNextW64(HANDLE
, PIMAGEHLP_SYMBOLW64
);
1129 BOOL WINAPI
SymGetSymPrev64(HANDLE
, PIMAGEHLP_SYMBOL64
);
1130 BOOL WINAPI
SymGetSymPrevW64(HANDLE
, PIMAGEHLP_SYMBOLW64
);
1131 BOOL WINAPI
SymEnumSym(HANDLE
,ULONG64
,PSYM_ENUMERATESYMBOLS_CALLBACK
,PVOID
);
1132 BOOL WINAPI
SymEnumSymbols(HANDLE
, ULONG64
, PCSTR
, PSYM_ENUMERATESYMBOLS_CALLBACK
,
1134 BOOL WINAPI
SymEnumSymbolsW(HANDLE
, ULONG64
, PCWSTR
, PSYM_ENUMERATESYMBOLS_CALLBACKW
,
1136 typedef BOOL (CALLBACK
*PSYM_ENUMSYMBOLS_CALLBACK64
)(PCSTR
, DWORD64
, ULONG
, PVOID
);
1137 typedef BOOL (CALLBACK
*PSYM_ENUMSYMBOLS_CALLBACK64W
)(PCWSTR
, DWORD64
, ULONG
, PVOID
);
1138 BOOL WINAPI
SymEnumerateSymbols64(HANDLE
, ULONG64
, PSYM_ENUMSYMBOLS_CALLBACK64
, PVOID
);
1139 BOOL WINAPI
SymEnumerateSymbolsW64(HANDLE
, ULONG64
, PSYM_ENUMSYMBOLS_CALLBACK64W
, PVOID
);
1140 BOOL WINAPI
SymEnumSymbolsForAddr(HANDLE
, DWORD64
, PSYM_ENUMERATESYMBOLS_CALLBACK
, PVOID
);
1141 BOOL WINAPI
SymEnumSymbolsForAddrW(HANDLE
, DWORD64
, PSYM_ENUMERATESYMBOLS_CALLBACKW
, PVOID
);
1142 typedef BOOL (CALLBACK
*PSYMBOL_REGISTERED_CALLBACK64
)(HANDLE
, ULONG
, ULONG64
, ULONG64
);
1143 BOOL WINAPI
SymRegisterCallback64(HANDLE
, PSYMBOL_REGISTERED_CALLBACK64
, ULONG64
);
1144 BOOL WINAPI
SymRegisterCallbackW64(HANDLE
, PSYMBOL_REGISTERED_CALLBACK64
, ULONG64
);
1145 BOOL WINAPI
SymUnDName64(PIMAGEHLP_SYMBOL64
, PSTR
, DWORD
);
1146 BOOL WINAPI
SymMatchString(PCSTR
, PCSTR
, BOOL
);
1147 BOOL WINAPI
SymMatchStringA(PCSTR
, PCSTR
, BOOL
);
1148 BOOL WINAPI
SymMatchStringW(PCWSTR
, PCWSTR
, BOOL
);
1149 BOOL WINAPI
SymSearch(HANDLE
, ULONG64
, DWORD
, DWORD
, PCSTR
, DWORD64
, PSYM_ENUMERATESYMBOLS_CALLBACK
, PVOID
, DWORD
);
1150 BOOL WINAPI
SymSearchW(HANDLE
, ULONG64
, DWORD
, DWORD
, PCWSTR
, DWORD64
, PSYM_ENUMERATESYMBOLS_CALLBACKW
, PVOID
, DWORD
);
1151 DWORD WINAPI
UnDecorateSymbolName(PCSTR
, PSTR
, DWORD
, DWORD
);
1152 DWORD WINAPI
UnDecorateSymbolNameW(PCWSTR
, PWSTR
, DWORD
, DWORD
);
1153 BOOL WINAPI
SymGetScope(HANDLE
, ULONG64
, DWORD
, PSYMBOL_INFO
);
1154 BOOL WINAPI
SymGetScopeW(HANDLE
, ULONG64
, DWORD
, PSYMBOL_INFOW
);
1155 BOOL WINAPI
SymFromIndex(HANDLE
, ULONG64
, DWORD
, PSYMBOL_INFO
);
1156 BOOL WINAPI
SymFromIndexW(HANDLE
, ULONG64
, DWORD
, PSYMBOL_INFOW
);
1157 BOOL WINAPI
SymAddSymbol(HANDLE
, ULONG64
, PCSTR
, DWORD64
, DWORD
, DWORD
);
1158 BOOL WINAPI
SymAddSymbolW(HANDLE
, ULONG64
, PCWSTR
, DWORD64
, DWORD
, DWORD
);
1159 BOOL WINAPI
SymDeleteSymbol(HANDLE
, ULONG64
, PCSTR
, DWORD64
, DWORD
);
1160 BOOL WINAPI
SymDeleteSymbolW(HANDLE
, ULONG64
, PCWSTR
, DWORD64
, DWORD
);
1162 /*************************
1164 *************************/
1165 typedef BOOL (CALLBACK
*PSYM_ENUMSOURCEFILES_CALLBACK
)(PSOURCEFILE
, PVOID
);
1166 typedef BOOL (CALLBACK
*PSYM_ENUMSOURCEFILES_CALLBACKW
)(PSOURCEFILEW
, PVOID
);
1168 BOOL WINAPI
SymEnumSourceFiles(HANDLE
, ULONG64
, PCSTR
, PSYM_ENUMSOURCEFILES_CALLBACK
,
1170 BOOL WINAPI
SymEnumSourceFilesW(HANDLE
, ULONG64
, PCWSTR
, PSYM_ENUMSOURCEFILES_CALLBACKW
, PVOID
);
1171 BOOL WINAPI
SymGetLineFromAddr64(HANDLE
, DWORD64
, PDWORD
, PIMAGEHLP_LINE64
);
1172 BOOL WINAPI
SymGetLineFromAddrW64(HANDLE
, DWORD64
, PDWORD
, PIMAGEHLP_LINEW64
);
1173 BOOL WINAPI
SymGetLinePrev64(HANDLE
, PIMAGEHLP_LINE64
);
1174 BOOL WINAPI
SymGetLinePrevW64(HANDLE
, PIMAGEHLP_LINEW64
);
1175 BOOL WINAPI
SymGetLineNext64(HANDLE
, PIMAGEHLP_LINE64
);
1176 BOOL WINAPI
SymGetLineNextW64(HANDLE
, PIMAGEHLP_LINEW64
);
1177 BOOL WINAPI
SymGetLineFromName64(HANDLE
, PCSTR
, PCSTR
, DWORD
, PLONG
, PIMAGEHLP_LINE64
);
1178 BOOL WINAPI
SymGetLineFromNameW64(HANDLE
, PCWSTR
, PCWSTR
, DWORD
, PLONG
, PIMAGEHLP_LINEW64
);
1179 ULONG WINAPI
SymGetFileLineOffsets64(HANDLE
, PCSTR
, PCSTR
, PDWORD64
, ULONG
);
1180 BOOL WINAPI
SymGetSourceFile(HANDLE
, ULONG64
, PCSTR
, PCSTR
, PSTR
, DWORD
);
1181 BOOL WINAPI
SymGetSourceFileW(HANDLE
, ULONG64
, PCWSTR
, PCWSTR
, PWSTR
, DWORD
);
1182 BOOL WINAPI
SymGetSourceFileToken(HANDLE
, ULONG64
, PCSTR
, PVOID
*, DWORD
*);
1183 BOOL WINAPI
SymGetSourceFileTokenW(HANDLE
, ULONG64
, PCWSTR
, PVOID
*, DWORD
*);
1184 BOOL WINAPI
SymGetSourceFileFromToken(HANDLE
, PVOID
, PCSTR
, PSTR
, DWORD
);
1185 BOOL WINAPI
SymGetSourceFileFromTokenW(HANDLE
, PVOID
, PCWSTR
, PWSTR
, DWORD
);
1186 BOOL WINAPI
SymGetSourceVarFromToken(HANDLE
, PVOID
, PCSTR
, PCSTR
, PSTR
, DWORD
);
1187 BOOL WINAPI
SymGetSourceVarFromTokenW(HANDLE
, PVOID
, PCWSTR
, PCWSTR
, PWSTR
, DWORD
);
1189 typedef struct _SRCCODEINFO
1194 CHAR Obj
[MAX_PATH
+1];
1195 CHAR FileName
[MAX_PATH
+1];
1198 } SRCCODEINFO
, *PSRCCODEINFO
;
1200 typedef struct _SRCCODEINFOW
1205 WCHAR Obj
[MAX_PATH
+1];
1206 WCHAR FileName
[MAX_PATH
+1];
1209 } SRCCODEINFOW
, *PSRCCODEINFOW
;
1211 typedef BOOL (CALLBACK
* PSYM_ENUMLINES_CALLBACK
)(PSRCCODEINFO
, PVOID
);
1212 typedef BOOL (CALLBACK
* PSYM_ENUMLINES_CALLBACKW
)(PSRCCODEINFOW
, PVOID
);
1213 BOOL WINAPI
SymEnumLines(HANDLE
, ULONG64
, PCSTR
, PCSTR
, PSYM_ENUMLINES_CALLBACK
, PVOID
);
1214 BOOL WINAPI
SymEnumLinesW(HANDLE
, ULONG64
, PCWSTR
, PCWSTR
, PSYM_ENUMLINES_CALLBACKW
, PVOID
);
1215 BOOL WINAPI
SymEnumSourceLines(HANDLE
, ULONG64
, PCSTR
, PCSTR
, DWORD
, DWORD
, PSYM_ENUMLINES_CALLBACK
, PVOID
);
1216 BOOL WINAPI
SymEnumSourceLinesW(HANDLE
, ULONG64
, PCWSTR
, PCWSTR
, DWORD
, DWORD
, PSYM_ENUMLINES_CALLBACKW
, PVOID
);
1218 /*************************
1219 * File & image handling *
1220 *************************/
1221 BOOL WINAPI
SymInitialize(HANDLE
, PCSTR
, BOOL
);
1222 BOOL WINAPI
SymInitializeW(HANDLE
, PCWSTR
, BOOL
);
1223 BOOL WINAPI
SymCleanup(HANDLE
);
1225 HANDLE WINAPI
FindDebugInfoFile(PCSTR
, PCSTR
, PSTR
);
1226 typedef BOOL (CALLBACK
*PFIND_DEBUG_FILE_CALLBACK
)(HANDLE
, PCSTR
, PVOID
);
1227 typedef BOOL (CALLBACK
*PFIND_DEBUG_FILE_CALLBACKW
)(HANDLE
, PCWSTR
, PVOID
);
1228 HANDLE WINAPI
FindDebugInfoFileEx(PCSTR
, PCSTR
, PSTR
, PFIND_DEBUG_FILE_CALLBACK
, PVOID
);
1229 HANDLE WINAPI
FindDebugInfoFileExW(PCWSTR
, PCWSTR
, PWSTR
, PFIND_DEBUG_FILE_CALLBACKW
, PVOID
);
1230 HANDLE WINAPI
SymFindDebugInfoFile(HANDLE
, PCSTR
, PSTR
, PFIND_DEBUG_FILE_CALLBACK
, PVOID
);
1231 HANDLE WINAPI
SymFindDebugInfoFileW(HANDLE
, PCWSTR
, PWSTR
, PFIND_DEBUG_FILE_CALLBACKW
, PVOID
);
1232 typedef BOOL (CALLBACK
*PFINDFILEINPATHCALLBACK
)(PCSTR
, PVOID
);
1233 typedef BOOL (CALLBACK
*PFINDFILEINPATHCALLBACKW
)(PCWSTR
, PVOID
);
1234 BOOL WINAPI
FindFileInPath(HANDLE
, PCSTR
, PCSTR
, PVOID
, DWORD
, DWORD
, DWORD
,
1235 PSTR
, PFINDFILEINPATHCALLBACK
, PVOID
);
1236 BOOL WINAPI
SymFindFileInPath(HANDLE
, PCSTR
, PCSTR
, PVOID
, DWORD
, DWORD
, DWORD
,
1237 PSTR
, PFINDFILEINPATHCALLBACK
, PVOID
);
1238 BOOL WINAPI
SymFindFileInPathW(HANDLE
, PCWSTR
, PCWSTR
, PVOID
, DWORD
, DWORD
, DWORD
,
1239 PWSTR
, PFINDFILEINPATHCALLBACKW
, PVOID
);
1240 HANDLE WINAPI
FindExecutableImage(PCSTR
, PCSTR
, PSTR
);
1241 typedef BOOL (CALLBACK
*PFIND_EXE_FILE_CALLBACK
)(HANDLE
, PCSTR
, PVOID
);
1242 typedef BOOL (CALLBACK
*PFIND_EXE_FILE_CALLBACKW
)(HANDLE
, PCWSTR
, PVOID
);
1243 HANDLE WINAPI
FindExecutableImageEx(PCSTR
, PCSTR
, PSTR
, PFIND_EXE_FILE_CALLBACK
, PVOID
);
1244 HANDLE WINAPI
FindExecutableImageExW(PCWSTR
, PCWSTR
, PWSTR
, PFIND_EXE_FILE_CALLBACKW
, PVOID
);
1245 HANDLE WINAPI
SymFindExecutableImage(HANDLE
, PCSTR
, PSTR
, PFIND_EXE_FILE_CALLBACK
, PVOID
);
1246 HANDLE WINAPI
SymFindExecutableImageW(HANDLE
, PCWSTR
, PWSTR
, PFIND_EXE_FILE_CALLBACKW
, PVOID
);
1247 PIMAGE_NT_HEADERS WINAPI
ImageNtHeader(PVOID
);
1248 PVOID WINAPI
ImageDirectoryEntryToDataEx(PVOID
, BOOLEAN
, USHORT
, PULONG
,
1249 PIMAGE_SECTION_HEADER
*);
1250 PVOID WINAPI
ImageDirectoryEntryToData(PVOID
, BOOLEAN
, USHORT
, PULONG
);
1251 PIMAGE_SECTION_HEADER WINAPI
ImageRvaToSection(PIMAGE_NT_HEADERS
, PVOID
, ULONG
);
1252 PVOID WINAPI
ImageRvaToVa(PIMAGE_NT_HEADERS
, PVOID
, ULONG
, PIMAGE_SECTION_HEADER
*);
1253 BOOL WINAPI
SymGetSearchPath(HANDLE
, PSTR
, DWORD
);
1254 BOOL WINAPI
SymGetSearchPathW(HANDLE
, PWSTR
, DWORD
);
1255 BOOL WINAPI
SymSetSearchPath(HANDLE
, PCSTR
);
1256 BOOL WINAPI
SymSetSearchPathW(HANDLE
, PCWSTR
);
1257 DWORD WINAPI
GetTimestampForLoadedLibrary(HMODULE
);
1258 BOOL WINAPI
MakeSureDirectoryPathExists(PCSTR
);
1259 BOOL WINAPI
SearchTreeForFile(PCSTR
, PCSTR
, PSTR
);
1260 BOOL WINAPI
SearchTreeForFileW(PCWSTR
, PCWSTR
, PWSTR
);
1261 typedef BOOL (CALLBACK
*PENUMDIRTREE_CALLBACK
)(PCSTR
, PVOID
);
1262 typedef BOOL (CALLBACK
*PENUMDIRTREE_CALLBACKW
)(PCWSTR
, PVOID
);
1263 BOOL WINAPI
EnumDirTree(HANDLE
, PCSTR
, PCSTR
, PSTR
, PENUMDIRTREE_CALLBACK
, PVOID
);
1264 BOOL WINAPI
EnumDirTreeW(HANDLE
, PCWSTR
, PCWSTR
, PWSTR
, PENUMDIRTREE_CALLBACKW
, PVOID
);
1265 BOOL WINAPI
SymMatchFileName(PCSTR
, PCSTR
, PSTR
*, PSTR
*);
1266 BOOL WINAPI
SymMatchFileNameW(PCWSTR
, PCWSTR
, PWSTR
*, PWSTR
*);
1267 PCHAR WINAPI
SymSetHomeDirectory(HANDLE
, PCSTR
);
1268 PWSTR WINAPI
SymSetHomeDirectoryW(HANDLE
, PCWSTR
);
1269 PCHAR WINAPI
SymGetHomeDirectory(DWORD
, PSTR
, size_t);
1270 PWSTR WINAPI
SymGetHomeDirectoryW(DWORD
, PWSTR
, size_t);
1276 /*************************
1277 * Context management *
1278 *************************/
1279 BOOL WINAPI
SymSetContext(HANDLE
, PIMAGEHLP_STACK_FRAME
, PIMAGEHLP_CONTEXT
);
1282 /*************************
1283 * Stack management *
1284 *************************/
1286 #if !defined(_IMAGEHLP_SOURCE_) && defined(_IMAGEHLP64)
1287 #define KDHELP KDHELP64
1288 #define PKDHELP PKDHELP64
1290 typedef struct _KDHELP
1293 DWORD ThCallbackStack
;
1296 DWORD KiCallUserMode
;
1297 DWORD KeUserCallbackDispatcher
;
1298 DWORD SystemRangeStart
;
1302 typedef struct _KDHELP64
1305 DWORD ThCallbackStack
;
1306 DWORD ThCallbackBStore
;
1309 DWORD64 KiCallUserMode
;
1310 DWORD64 KeUserCallbackDispatcher
;
1311 DWORD64 SystemRangeStart
;
1312 DWORD64 Reserved
[8];
1313 } KDHELP64
, *PKDHELP64
;
1315 #if !defined(_IMAGEHLP_SOURCE_) && defined(_IMAGEHLP64)
1316 #define STACKFRAME STACKFRAME64
1317 #define LPSTACKFRAME LPSTACKFRAME64
1319 typedef struct _STACKFRAME
1325 PVOID FuncTableEntry
;
1332 } STACKFRAME
, *LPSTACKFRAME
;
1335 typedef struct _STACKFRAME64
1338 ADDRESS64 AddrReturn
;
1339 ADDRESS64 AddrFrame
;
1340 ADDRESS64 AddrStack
;
1341 ADDRESS64 AddrBStore
;
1342 PVOID FuncTableEntry
;
1346 DWORD64 Reserved
[3];
1348 } STACKFRAME64
, *LPSTACKFRAME64
;
1350 typedef BOOL (CALLBACK
*PREAD_PROCESS_MEMORY_ROUTINE64
)
1351 (HANDLE
, DWORD64
, PVOID
, DWORD
, PDWORD
);
1352 typedef PVOID (CALLBACK
*PFUNCTION_TABLE_ACCESS_ROUTINE64
)(HANDLE
, DWORD64
);
1353 typedef DWORD64 (CALLBACK
*PGET_MODULE_BASE_ROUTINE64
)(HANDLE
, DWORD64
);
1354 typedef DWORD64 (CALLBACK
*PTRANSLATE_ADDRESS_ROUTINE64
)(HANDLE
, HANDLE
, LPADDRESS64
);
1355 BOOL WINAPI
StackWalk64(DWORD
, HANDLE
, HANDLE
, LPSTACKFRAME64
, PVOID
,
1356 PREAD_PROCESS_MEMORY_ROUTINE64
,
1357 PFUNCTION_TABLE_ACCESS_ROUTINE64
,
1358 PGET_MODULE_BASE_ROUTINE64
,
1359 PTRANSLATE_ADDRESS_ROUTINE64
);
1361 PVOID WINAPI
SymFunctionTableAccess64(HANDLE
, DWORD64
);
1363 typedef PVOID (CALLBACK
*PSYMBOL_FUNCENTRY_CALLBACK64
)(HANDLE
, ULONG64
, ULONG64
);
1365 BOOL WINAPI
SymRegisterFunctionEntryCallback64(HANDLE
, PSYMBOL_FUNCENTRY_CALLBACK64
, ULONG64
);
1367 /*************************
1368 * Version, global stuff *
1369 *************************/
1371 #define API_VERSION_NUMBER 9
1373 typedef struct API_VERSION
1375 USHORT MajorVersion
;
1376 USHORT MinorVersion
;
1379 } API_VERSION
, *LPAPI_VERSION
;
1381 LPAPI_VERSION WINAPI
ImagehlpApiVersion(void);
1382 LPAPI_VERSION WINAPI
ImagehlpApiVersionEx(LPAPI_VERSION
);
1384 typedef struct _IMAGE_DEBUG_INFORMATION
1388 PVOID ReservedMappedBase
;
1389 USHORT ReservedMachine
;
1390 USHORT ReservedCharacteristics
;
1391 DWORD ReservedCheckSum
;
1394 DWORD ReservedNumberOfSections
;
1395 PIMAGE_SECTION_HEADER ReservedSections
;
1396 DWORD ReservedExportedNamesSize
;
1397 PSTR ReservedExportedNames
;
1398 DWORD ReservedNumberOfFunctionTableEntries
;
1399 PIMAGE_FUNCTION_ENTRY ReservedFunctionTableEntries
;
1400 DWORD ReservedLowestFunctionStartingAddress
;
1401 DWORD ReservedHighestFunctionEndingAddress
;
1402 DWORD ReservedNumberOfFpoTableEntries
;
1403 PFPO_DATA ReservedFpoTableEntries
;
1404 DWORD SizeOfCoffSymbols
;
1405 PIMAGE_COFF_SYMBOLS_HEADER CoffSymbols
;
1406 DWORD ReservedSizeOfCodeViewSymbols
;
1407 PVOID ReservedCodeViewSymbols
;
1410 PSTR ReservedDebugFilePath
;
1411 DWORD ReservedTimeDateStamp
;
1412 BOOL ReservedRomImage
;
1413 PIMAGE_DEBUG_DIRECTORY ReservedDebugDirectory
;
1414 DWORD ReservedNumberOfDebugDirectories
;
1415 DWORD ReservedOriginalFunctionTableBaseAddress
;
1416 DWORD Reserved
[ 2 ];
1417 } IMAGE_DEBUG_INFORMATION
, *PIMAGE_DEBUG_INFORMATION
;
1420 PIMAGE_DEBUG_INFORMATION WINAPI
MapDebugInformation(HANDLE
, PCSTR
, PCSTR
, ULONG
);
1422 BOOL WINAPI
UnmapDebugInformation(PIMAGE_DEBUG_INFORMATION
);
1424 DWORD WINAPI
SymGetOptions(void);
1425 DWORD WINAPI
SymSetOptions(DWORD
);
1427 BOOL WINAPI
SymSetParentWindow(HWND
);
1429 /*************************
1430 * Version, global stuff *
1431 *************************/
1433 typedef BOOL (WINAPI
* PSYMBOLSERVERPROC
)(PCSTR
, PCSTR
, PVOID
, DWORD
, DWORD
, PSTR
);
1434 typedef BOOL (WINAPI
* PSYMBOLSERVERPROCA
)(PCSTR
, PCSTR
, PVOID
, DWORD
, DWORD
, PSTR
);
1435 typedef BOOL (WINAPI
* PSYMBOLSERVERPROCW
)(PCWSTR
, PCWSTR
, PVOID
, DWORD
, DWORD
, PWSTR
);
1436 typedef BOOL (WINAPI
* PSYMBOLSERVEROPENPROC
)(void);
1437 typedef BOOL (WINAPI
* PSYMBOLSERVERCLOSEPROC
)(void);
1438 typedef BOOL (WINAPI
* PSYMBOLSERVERSETOPTIONSPROC
)(UINT_PTR
, ULONG64
);
1439 typedef BOOL (CALLBACK
* PSYMBOLSERVERCALLBACKPROC
)(UINT_PTR
, ULONG64
, ULONG64
);
1440 typedef UINT_PTR (WINAPI
* PSYMBOLSERVERGETOPTIONSPROC
)(void);
1441 typedef BOOL (WINAPI
* PSYMBOLSERVERPINGPROC
)(PCSTR
);
1442 typedef BOOL (WINAPI
* PSYMBOLSERVERPINGPROCA
)(PCSTR
);
1443 typedef BOOL (WINAPI
* PSYMBOLSERVERPINGPROCW
)(PCWSTR
);
1445 #define SSRVOPT_CALLBACK 0x0001
1446 #define SSRVOPT_DWORD 0x0002
1447 #define SSRVOPT_DWORDPTR 0x0004
1448 #define SSRVOPT_GUIDPTR 0x0008
1449 #define SSRVOPT_OLDGUIDPTR 0x0010
1450 #define SSRVOPT_UNATTENDED 0x0020
1451 #define SSRVOPT_NOCOPY 0x0040
1452 #define SSRVOPT_PARENTWIN 0x0080
1453 #define SSRVOPT_PARAMTYPE 0x0100
1454 #define SSRVOPT_SECURE 0x0200
1455 #define SSRVOPT_TRACE 0x0400
1456 #define SSRVOPT_SETCONTEXT 0x0800
1457 #define SSRVOPT_PROXY 0x1000
1458 #define SSRVOPT_DOWNSTREAM_STORE 0x2000
1459 #define SSRVOPT_RESET ((ULONG_PTR)-1)
1461 #define SSRVACTION_TRACE 1
1462 #define SSRVACTION_QUERYCANCEL 2
1463 #define SSRVACTION_EVENT 3
1465 /* 32-bit functions */
1467 #if !defined(_IMAGEHLP_SOURCE_) && defined(_IMAGEHLP64)
1469 #define PENUMLOADED_MODULES_CALLBACK PENUMLOADED_MODULES_CALLBACK64
1470 #define PFUNCTION_TABLE_ACCESS_ROUTINE PFUNCTION_TABLE_ACCESS_ROUTINE64
1471 #define PGET_MODULE_BASE_ROUTINE PGET_MODULE_BASE_ROUTINE64
1472 #define PREAD_PROCESS_MEMORY_ROUTINE PREAD_PROCESS_MEMORY_ROUTINE64
1473 #define PSYMBOL_FUNCENTRY_CALLBACK PSYMBOL_FUNCENTRY_CALLBACK64
1474 #define PSYMBOL_REGISTERED_CALLBACK PSYMBOL_REGISTERED_CALLBACK64
1475 #define PSYM_ENUMMODULES_CALLBACK PSYM_ENUMMODULES_CALLBACK64
1476 #define PSYM_ENUMSYMBOLS_CALLBACK PSYM_ENUMSYMBOLS_CALLBACK64
1477 #define PSYM_ENUMSYMBOLS_CALLBACKW PSYM_ENUMSYMBOLS_CALLBACKW64
1478 #define PTRANSLATE_ADDRESS_ROUTINE PTRANSLATE_ADDRESS_ROUTINE64
1480 #define EnumerateLoadedModules EnumerateLoadedModules64
1481 #define StackWalk StackWalk64
1482 #define SymEnumerateModules SymEnumerateModules64
1483 #define SymEnumerateSymbols SymEnumerateSymbols64
1484 #define SymEnumerateSymbolsW SymEnumerateSymbolsW64
1485 #define SymFunctionTableAccess SymFunctionTableAccess64
1486 #define SymGetLineFromAddr SymGetLineFromAddr64
1487 #define SymGetLineFromAddrW SymGetLineFromAddrW64
1488 #define SymGetLineFromName SymGetLineFromName64
1489 #define SymGetLineNext SymGetLineNext64
1490 #define SymGetLineNextW SymGetLineNextW64
1491 #define SymGetLinePrev SymGetLinePrev64
1492 #define SymGetLinePrevW SymGetLinePrevW64
1493 #define SymGetModuleBase SymGetModuleBase64
1494 #define SymGetModuleInfo SymGetModuleInfo64
1495 #define SymGetModuleInfoW SymGetModuleInfoW64
1496 #define SymGetSymFromAddr SymGetSymFromAddr64
1497 #define SymGetSymFromName SymGetSymFromName64
1498 #define SymGetSymNext SymGetSymNext64
1499 #define SymGetSymNextW SymGetSymNextW64
1500 #define SymGetSymPrev SymGetSymPrev64
1501 #define SymGetSymPrevW SymGetSymPrevW64
1502 #define SymLoadModule SymLoadModule64
1503 #define SymRegisterCallback SymRegisterCallback64
1504 #define SymRegisterFunctionEntryCallback SymRegisterFunctionEntryCallback64
1505 #define SymUnDName SymUnDName64
1506 #define SymUnloadModule SymUnloadModule64
1510 typedef BOOL (CALLBACK
*PENUMLOADED_MODULES_CALLBACK
)(PCSTR
, ULONG
, ULONG
, PVOID
);
1511 typedef PVOID (CALLBACK
*PFUNCTION_TABLE_ACCESS_ROUTINE
)(HANDLE
, DWORD
);
1512 typedef DWORD (CALLBACK
*PGET_MODULE_BASE_ROUTINE
)(HANDLE
, DWORD
);
1513 typedef BOOL (CALLBACK
*PREAD_PROCESS_MEMORY_ROUTINE
)(HANDLE
, DWORD
, PVOID
, DWORD
, PDWORD
);
1514 typedef BOOL (CALLBACK
*PSYM_ENUMMODULES_CALLBACK
)(PCSTR
, ULONG
, PVOID
);
1515 typedef BOOL (CALLBACK
*PSYM_ENUMSYMBOLS_CALLBACK
)(PCSTR
, ULONG
, ULONG
, PVOID
);
1516 typedef BOOL (CALLBACK
*PSYM_ENUMSYMBOLS_CALLBACKW
)(PCWSTR
, ULONG
, ULONG
, PVOID
);
1517 typedef BOOL (CALLBACK
*PSYMBOL_REGISTERED_CALLBACK
)(HANDLE
, ULONG
, PVOID
, PVOID
);
1518 typedef PVOID (CALLBACK
*PSYMBOL_FUNCENTRY_CALLBACK
)(HANDLE
, DWORD
, PVOID
);
1519 typedef DWORD (CALLBACK
*PTRANSLATE_ADDRESS_ROUTINE
)(HANDLE
, HANDLE
, LPADDRESS
);
1521 BOOL WINAPI
EnumerateLoadedModules(HANDLE
, PENUMLOADED_MODULES_CALLBACK
, PVOID
);
1522 BOOL WINAPI
StackWalk(DWORD
, HANDLE
, HANDLE
, LPSTACKFRAME
, PVOID
, PREAD_PROCESS_MEMORY_ROUTINE
, PFUNCTION_TABLE_ACCESS_ROUTINE
, PGET_MODULE_BASE_ROUTINE
, PTRANSLATE_ADDRESS_ROUTINE
);
1523 BOOL WINAPI
SymEnumerateModules(HANDLE
, PSYM_ENUMMODULES_CALLBACK
, PVOID
);
1524 BOOL WINAPI
SymEnumerateSymbols(HANDLE
, ULONG
, PSYM_ENUMSYMBOLS_CALLBACK
, PVOID
);
1525 BOOL WINAPI
SymEnumerateSymbolsW(HANDLE
, ULONG
, PSYM_ENUMSYMBOLS_CALLBACKW
, PVOID
);
1526 PVOID WINAPI
SymFunctionTableAccess(HANDLE
, DWORD
);
1527 BOOL WINAPI
SymGetLineFromAddr(HANDLE
, DWORD
, PDWORD
, PIMAGEHLP_LINE
);
1528 BOOL WINAPI
SymGetLineFromAddrW(HANDLE
, DWORD
, PDWORD
, PIMAGEHLP_LINEW
);
1529 BOOL WINAPI
SymGetLineFromName(HANDLE
, PCSTR
, PCSTR
, DWORD
, PLONG
, PIMAGEHLP_LINE
);
1530 BOOL WINAPI
SymGetLineNext(HANDLE
, PIMAGEHLP_LINE
);
1531 BOOL WINAPI
SymGetLineNextW(HANDLE
, PIMAGEHLP_LINEW
);
1532 BOOL WINAPI
SymGetLinePrev(HANDLE
, PIMAGEHLP_LINE
);
1533 BOOL WINAPI
SymGetLinePrevW(HANDLE
, PIMAGEHLP_LINEW
);
1534 DWORD WINAPI
SymGetModuleBase(HANDLE
, DWORD
);
1535 BOOL WINAPI
SymGetModuleInfo(HANDLE
, DWORD
, PIMAGEHLP_MODULE
);
1536 BOOL WINAPI
SymGetModuleInfoW(HANDLE
, DWORD
, PIMAGEHLP_MODULEW
);
1537 BOOL WINAPI
SymGetSymFromAddr(HANDLE
, DWORD
, PDWORD
, PIMAGEHLP_SYMBOL
);
1538 BOOL WINAPI
SymGetSymFromName(HANDLE
, PCSTR
, PIMAGEHLP_SYMBOL
);
1539 BOOL WINAPI
SymGetSymNext(HANDLE
, PIMAGEHLP_SYMBOL
);
1540 BOOL WINAPI
SymGetSymNextW(HANDLE
, PIMAGEHLP_SYMBOLW
);
1541 BOOL WINAPI
SymGetSymPrev(HANDLE
, PIMAGEHLP_SYMBOL
);
1542 BOOL WINAPI
SymGetSymPrevW(HANDLE
, PIMAGEHLP_SYMBOLW
);
1543 DWORD WINAPI
SymLoadModule(HANDLE
, HANDLE
, PCSTR
, PCSTR
, DWORD
, DWORD
);
1544 BOOL WINAPI
SymRegisterCallback(HANDLE
, PSYMBOL_REGISTERED_CALLBACK
, PVOID
);
1545 BOOL WINAPI
SymRegisterFunctionEntryCallback(HANDLE
, PSYMBOL_FUNCENTRY_CALLBACK
, PVOID
);
1546 BOOL WINAPI
SymRefreshModuleList(HANDLE
);
1547 BOOL WINAPI
SymUnDName(PIMAGEHLP_SYMBOL
, PSTR
, DWORD
);
1548 BOOL WINAPI
SymUnloadModule(HANDLE
, DWORD
);
1554 #endif /* defined(__cplusplus) */
1556 #endif /* __WINE_DBGHELP_H */