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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #ifndef __WINE_DBGHELP_H
22 #define __WINE_DBGHELP_H
26 #endif /* defined(__cplusplus) */
28 typedef struct _LOADED_IMAGE
33 PIMAGE_NT_HEADERS FileHeader;
34 PIMAGE_SECTION_HEADER LastRvaSection;
35 ULONG NumberOfSections;
36 PIMAGE_SECTION_HEADER Sections;
37 ULONG Characteristics;
42 } LOADED_IMAGE, *PLOADED_IMAGE;
44 /*************************
46 *************************/
56 typedef struct _tagADDRESS
61 } ADDRESS, *LPADDRESS;
63 typedef struct _tagADDRESS64
68 } ADDRESS64, *LPADDRESS64;
70 #define SYMF_OMAP_GENERATED 0x00000001
71 #define SYMF_OMAP_MODIFIED 0x00000002
72 #define SYMF_USER_GENERATED 0x00000004
73 #define SYMF_REGISTER 0x00000008
74 #define SYMF_REGREL 0x00000010
75 #define SYMF_FRAMEREL 0x00000020
76 #define SYMF_PARAMETER 0x00000040
77 #define SYMF_LOCAL 0x00000080
78 #define SYMF_CONSTANT 0x00000100
79 #define SYMF_EXPORT 0x00000200
80 #define SYMF_FORWARDER 0x00000400
81 #define SYMF_FUNCTION 0x00000800
82 #define SYMF_VIRTUAL 0x00001000
83 #define SYMF_THUNK 0x00002000
84 #define SYMF_TLSREL 0x00004000
100 typedef struct _IMAGEHLP_SYMBOL
108 } IMAGEHLP_SYMBOL, *PIMAGEHLP_SYMBOL;
110 typedef struct _IMAGEHLP_SYMBOL64
118 } IMAGEHLP_SYMBOL64, *PIMAGEHLP_SYMBOL64;
120 typedef struct _IMAGEHLP_MODULE
131 CHAR LoadedImageName[256];
132 } IMAGEHLP_MODULE, *PIMAGEHLP_MODULE;
134 typedef struct _IMAGEHLP_MODULEW
143 WCHAR ModuleName[32];
144 WCHAR ImageName[256];
145 WCHAR LoadedImageName[256];
146 } IMAGEHLP_MODULEW, *PIMAGEHLP_MODULEW;
148 typedef struct _IMAGEHLP_MODULE64
159 CHAR LoadedImageName[256];
160 CHAR LoadedPdbName[256];
162 CHAR CVData[MAX_PATH*3];
173 } IMAGEHLP_MODULE64, *PIMAGEHLP_MODULE64;
175 typedef struct _IMAGEHLP_MODULE64W
184 WCHAR ModuleName[32];
185 WCHAR ImageName[256];
186 WCHAR LoadedImageName[256];
187 WCHAR LoadedPdbName[256];
189 WCHAR CVData[MAX_PATH*3];
200 } IMAGEHLP_MODULEW64, *PIMAGEHLP_MODULEW64;
202 typedef struct _IMAGEHLP_LINE
209 } IMAGEHLP_LINE, *PIMAGEHLP_LINE;
211 typedef struct _IMAGEHLP_LINE64
218 } IMAGEHLP_LINE64, *PIMAGEHLP_LINE64;
220 typedef struct _SOURCEFILE
224 } SOURCEFILE, *PSOURCEFILE;
226 #define CBA_DEFERRED_SYMBOL_LOAD_START 0x00000001
227 #define CBA_DEFERRED_SYMBOL_LOAD_COMPLETE 0x00000002
228 #define CBA_DEFERRED_SYMBOL_LOAD_FAILURE 0x00000003
229 #define CBA_SYMBOLS_UNLOADED 0x00000004
230 #define CBA_DUPLICATE_SYMBOL 0x00000005
231 #define CBA_READ_MEMORY 0x00000006
232 #define CBA_DEFERRED_SYMBOL_LOAD_CANCEL 0x00000007
233 #define CBA_SET_OPTIONS 0x00000008
234 #define CBA_EVENT 0x00000010
235 #define CBA_DEFERRED_SYMBOL_LOAD_PARTIAL 0x00000020
236 #define CBA_DEBUG_INFO 0x10000000
238 typedef struct _IMAGEHLP_CBA_READ_MEMORY
244 } IMAGEHLP_CBA_READ_MEMORY, *PIMAGEHLP_CBA_READ_MEMORY;
255 #define EVENT_SRCSPEW_START 100
256 #define EVENT_SRCSPEW 100
257 #define EVENT_SRCSPEW_END 199
259 typedef struct _IMAGEHLP_CBA_EVENT
265 } IMAGEHLP_CBA_EVENT, *PIMAGEHLP_CBA_EVENT;
267 typedef struct _IMAGEHLP_DEFERRED_SYMBOL_LOAD
273 CHAR FileName[MAX_PATH];
276 } IMAGEHLP_DEFERRED_SYMBOL_LOAD, *PIMAGEHLP_DEFERRED_SYMBOL_LOAD;
278 typedef struct _IMAGEHLP_DEFERRED_SYMBOL_LOAD64
284 CHAR FileName[MAX_PATH];
288 } IMAGEHLP_DEFERRED_SYMBOL_LOAD64, *PIMAGEHLP_DEFERRED_SYMBOL_LOAD64;
290 typedef struct _IMAGEHLP_DUPLICATE_SYMBOL
294 PIMAGEHLP_SYMBOL Symbol;
295 DWORD SelectedSymbol;
296 } IMAGEHLP_DUPLICATE_SYMBOL, *PIMAGEHLP_DUPLICATE_SYMBOL;
298 typedef struct _IMAGEHLP_DUPLICATE_SYMBOL64
302 PIMAGEHLP_SYMBOL64 Symbol;
303 DWORD SelectedSymbol;
304 } IMAGEHLP_DUPLICATE_SYMBOL64, *PIMAGEHLP_DUPLICATE_SYMBOL64;
306 #define SYMOPT_CASE_INSENSITIVE 0x00000001
307 #define SYMOPT_UNDNAME 0x00000002
308 #define SYMOPT_DEFERRED_LOADS 0x00000004
309 #define SYMOPT_NO_CPP 0x00000008
310 #define SYMOPT_LOAD_LINES 0x00000010
311 #define SYMOPT_OMAP_FIND_NEAREST 0x00000020
312 #define SYMOPT_LOAD_ANYTHING 0x00000040
313 #define SYMOPT_IGNORE_CVREC 0x00000080
314 #define SYMOPT_NO_UNQUALIFIED_LOADS 0x00000100
315 #define SYMOPT_FAIL_CRITICAL_ERRORS 0x00000200
316 #define SYMOPT_EXACT_SYMBOLS 0x00000400
317 #define SYMOPT_WILD_UNDERSCORE 0x00000800
318 #define SYMOPT_USE_DEFAULTS 0x00001000
319 /* latest SDK defines:
320 #define SYMOPT_ALLOW_ABSOLUTE_SYMBOLS 0x00000800
321 #define SYMOPT_IGNORE_NT_SYMPATH 0x00001000
323 #define SYMOPT_INCLUDE_32BIT_MODULES 0x00002000
324 #define SYMOPT_PUBLICS_ONLY 0x00004000
325 #define SYMOPT_NO_PUBLICS 0x00008000
326 #define SYMOPT_AUTO_PUBLICS 0x00010000
327 #define SYMOPT_NO_IMAGE_SEARCH 0x00020000
328 #define SYMOPT_SECURE 0x00040000
329 #define SYMOPT_NO_PROMPTS 0x00080000
330 #define SYMOPT_OVERWRITE 0x00100000
331 #define SYMOPT_IGNORE_IMAGEDIR 0x00200000
333 #define SYMOPT_DEBUG 0x80000000
335 typedef struct _IMAGEHLP_STACK_FRAME
337 ULONG64 InstructionOffset;
338 ULONG64 ReturnOffset;
341 ULONG64 BackingStoreOffset;
342 ULONG64 FuncTableEntry;
347 } IMAGEHLP_STACK_FRAME, *PIMAGEHLP_STACK_FRAME;
349 typedef VOID IMAGEHLP_CONTEXT, *PIMAGEHLP_CONTEXT;
351 #define DBHHEADER_DEBUGDIRS 0x1
352 typedef struct _DBGHELP_MODLOAD_DATA
359 } MODLOAD_DATA, *PMODLOAD_DATA;
361 /*************************
363 *************************/
365 #include <pshpack4.h>
368 #define MINIDUMP_SIGNATURE 0x504D444D /* 'MDMP' */
369 #define MINIDUMP_VERSION (42899)
372 typedef ULONG64 RVA64;
374 typedef enum _MINIDUMP_TYPE
376 MiniDumpNormal = 0x0000,
377 MiniDumpWithDataSegs = 0x0001,
378 MiniDumpWithFullMemory = 0x0002,
379 MiniDumpWithHandleData = 0x0004,
380 MiniDumpFilterMemory = 0x0008,
381 MiniDumpScanMemory = 0x0010,
382 MiniDumpWithUnloadedModules = 0x0020,
383 MiniDumpWithIndirectlyReferencedMemory = 0x0040,
384 MiniDumpFilterModulePaths = 0x0080,
385 MiniDumpWithProcessThreadData = 0x0100,
386 MiniDumpWithPrivateReadWriteMemory = 0x0200,
387 MiniDumpWithoutOptionalData = 0x0400,
388 MiniDumpWithFullMemoryInfo = 0x0800,
389 MiniDumpWithThreadInfo = 0x1000,
390 MiniDumpWithCodeSegs = 0x2000
393 typedef enum _MINIDUMP_CALLBACK_TYPE
398 IncludeThreadCallback,
399 IncludeModuleCallback,
401 } MINIDUMP_CALLBACK_TYPE;
403 typedef struct _MINIDUMP_THREAD_CALLBACK
411 } MINIDUMP_THREAD_CALLBACK, *PMINIDUMP_THREAD_CALLBACK;
413 typedef struct _MINIDUMP_THREAD_EX_CALLBACK
421 ULONG64 BackingStoreBase;
422 ULONG64 BackingStoreEnd;
423 } MINIDUMP_THREAD_EX_CALLBACK, *PMINIDUMP_THREAD_EX_CALLBACK;
425 typedef struct _MINIDUMP_INCLUDE_THREAD_CALLBACK
428 } MINIDUMP_INCLUDE_THREAD_CALLBACK, *PMINIDUMP_INCLUDE_THREAD_CALLBACK;
430 typedef enum _THREAD_WRITE_FLAGS
432 ThreadWriteThread = 0x0001,
433 ThreadWriteStack = 0x0002,
434 ThreadWriteContext = 0x0004,
435 ThreadWriteBackingStore = 0x0008,
436 ThreadWriteInstructionWindow = 0x0010,
437 ThreadWriteThreadData = 0x0020,
438 ThreadWriteThreadInfo = 0x0040
439 } THREAD_WRITE_FLAGS;
441 typedef struct _MINIDUMP_MODULE_CALLBACK
448 VS_FIXEDFILEINFO VersionInfo;
450 ULONG SizeOfCvRecord;
452 ULONG SizeOfMiscRecord;
453 } MINIDUMP_MODULE_CALLBACK, *PMINIDUMP_MODULE_CALLBACK;
455 typedef struct _MINIDUMP_INCLUDE_MODULE_CALLBACK
458 } MINIDUMP_INCLUDE_MODULE_CALLBACK, *PMINIDUMP_INCLUDE_MODULE_CALLBACK;
460 typedef enum _MODULE_WRITE_FLAGS
462 ModuleWriteModule = 0x0001,
463 ModuleWriteDataSeg = 0x0002,
464 ModuleWriteMiscRecord = 0x0004,
465 ModuleWriteCvRecord = 0x0008,
466 ModuleReferencedByMemory = 0x0010,
467 ModuleWriteTlsData = 0x0020,
468 ModuleWriteCodeSegs = 0x0040,
469 } MODULE_WRITE_FLAGS;
471 typedef struct _MINIDUMP_CALLBACK_INPUT
474 HANDLE ProcessHandle;
478 MINIDUMP_THREAD_CALLBACK Thread;
479 MINIDUMP_THREAD_EX_CALLBACK ThreadEx;
480 MINIDUMP_MODULE_CALLBACK Module;
481 MINIDUMP_INCLUDE_THREAD_CALLBACK IncludeThread;
482 MINIDUMP_INCLUDE_MODULE_CALLBACK IncludeModule;
484 } MINIDUMP_CALLBACK_INPUT, *PMINIDUMP_CALLBACK_INPUT;
486 typedef struct _MINIDUMP_CALLBACK_OUTPUT
490 ULONG ModuleWriteFlags;
491 ULONG ThreadWriteFlags;
498 } MINIDUMP_CALLBACK_OUTPUT, *PMINIDUMP_CALLBACK_OUTPUT;
500 typedef BOOL (WINAPI* MINIDUMP_CALLBACK_ROUTINE)(PVOID, const PMINIDUMP_CALLBACK_INPUT, PMINIDUMP_CALLBACK_OUTPUT);
502 typedef struct _MINIDUMP_CALLBACK_INFORMATION
504 MINIDUMP_CALLBACK_ROUTINE CallbackRoutine;
506 } MINIDUMP_CALLBACK_INFORMATION, *PMINIDUMP_CALLBACK_INFORMATION;
508 typedef struct _MINIDUMP_LOCATION_DESCRIPTOR
512 } MINIDUMP_LOCATION_DESCRIPTOR;
514 typedef struct _MINIDUMP_LOCATION_DESCRIPTOR64
518 } MINIDUMP_LOCATION_DESCRIPTOR64;
520 typedef struct _MINIDUMP_DIRECTORY
523 MINIDUMP_LOCATION_DESCRIPTOR Location;
524 } MINIDUMP_DIRECTORY, *PMINIDUMP_DIRECTORY;
526 typedef struct _MINIDUMP_EXCEPTION
529 ULONG ExceptionFlags;
530 ULONG64 ExceptionRecord;
531 ULONG64 ExceptionAddress;
532 ULONG NumberParameters;
533 ULONG __unusedAlignment;
534 ULONG64 ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS];
535 } MINIDUMP_EXCEPTION, *PMINIDUMP_EXCEPTION;
537 typedef struct _MINIDUMP_EXCEPTION_INFORMATION
540 PEXCEPTION_POINTERS ExceptionPointers;
542 } MINIDUMP_EXCEPTION_INFORMATION, *PMINIDUMP_EXCEPTION_INFORMATION;
544 typedef struct MINIDUMP_EXCEPTION_STREAM
548 MINIDUMP_EXCEPTION ExceptionRecord;
549 MINIDUMP_LOCATION_DESCRIPTOR ThreadContext;
550 } MINIDUMP_EXCEPTION_STREAM, *PMINIDUMP_EXCEPTION_STREAM;
552 typedef struct _MINIDUMP_HEADER
556 DWORD NumberOfStreams;
557 RVA StreamDirectoryRva;
565 } MINIDUMP_HEADER, *PMINIDUMP_HEADER;
567 typedef struct _MINIDUMP_MEMORY_DESCRIPTOR
569 ULONG64 StartOfMemoryRange;
570 MINIDUMP_LOCATION_DESCRIPTOR Memory;
571 } MINIDUMP_MEMORY_DESCRIPTOR, *PMINIDUMP_MEMORY_DESCRIPTOR;
573 typedef struct _MINIDUMP_MEMORY_LIST
575 ULONG NumberOfMemoryRanges;
576 MINIDUMP_MEMORY_DESCRIPTOR MemoryRanges[1]; /* FIXME: 0-sized array not supported */
577 } MINIDUMP_MEMORY_LIST, *PMINIDUMP_MEMORY_LIST;
579 #define MINIDUMP_MISC1_PROCESS_ID 0x00000001
580 #define MINIDUMP_MISC1_PROCESS_TIMES 0x00000002
582 typedef struct _MINIDUMP_MISC_INFO
587 ULONG ProcessCreateTime;
588 ULONG ProcessUserTime;
589 ULONG ProcessKernelTime;
590 } MINIDUMP_MISC_INFO, *PMINIDUMP_MISC_INFO;
592 typedef struct _MINIDUMP_MODULE
599 VS_FIXEDFILEINFO VersionInfo;
600 MINIDUMP_LOCATION_DESCRIPTOR CvRecord;
601 MINIDUMP_LOCATION_DESCRIPTOR MiscRecord;
604 } MINIDUMP_MODULE, *PMINIDUMP_MODULE;
606 typedef struct _MINIDUMP_MODULE_LIST
608 ULONG NumberOfModules;
609 MINIDUMP_MODULE Modules[1]; /* FIXME: 0-sized array not supported */
610 } MINIDUMP_MODULE_LIST, *PMINIDUMP_MODULE_LIST;
612 typedef struct _MINIDUMP_STRING
615 WCHAR Buffer[1]; /* FIXME: O-sized array not supported */
616 } MINIDUMP_STRING, *PMINIDUMP_STRING;
618 typedef struct _MINIDUMP_SYSTEM_INFO
620 USHORT ProcessorArchitecture;
621 USHORT ProcessorLevel;
622 USHORT ProcessorRevision;
628 UCHAR NumberOfProcessors;
648 union _CPU_INFORMATION
653 ULONG VersionInformation;
654 ULONG FeatureInformation;
655 ULONG AMDExtendedCpuFeatures;
659 ULONG64 ProcessorFeatures[2];
663 } MINIDUMP_SYSTEM_INFO, *PMINIDUMP_SYSTEM_INFO;
665 typedef struct _MINIDUMP_THREAD
672 MINIDUMP_MEMORY_DESCRIPTOR Stack;
673 MINIDUMP_LOCATION_DESCRIPTOR ThreadContext;
674 } MINIDUMP_THREAD, *PMINIDUMP_THREAD;
676 typedef struct _MINIDUMP_THREAD_LIST
678 ULONG NumberOfThreads;
679 MINIDUMP_THREAD Threads[1]; /* FIXME: no support of 0 sized array */
680 } MINIDUMP_THREAD_LIST, *PMINIDUMP_THREAD_LIST;
682 typedef struct _MINIDUMP_USER_STREAM
687 } MINIDUMP_USER_STREAM, *PMINIDUMP_USER_STREAM;
689 typedef struct _MINIDUMP_USER_STREAM_INFORMATION
691 ULONG UserStreamCount;
692 PMINIDUMP_USER_STREAM UserStreamArray;
693 } MINIDUMP_USER_STREAM_INFORMATION, *PMINIDUMP_USER_STREAM_INFORMATION;
695 typedef enum _MINIDUMP_STREAM_TYPE
700 ThreadListStream = 3,
701 ModuleListStream = 4,
702 MemoryListStream = 5,
704 SystemInfoStream = 7,
705 ThreadExListStream = 8,
706 Memory64ListStream = 9,
709 HandleDataStream = 12,
710 FunctionTableStream = 13,
711 UnloadedModuleListStream = 14,
713 MemoryInfoListStream = 16,
714 ThreadInfoListStream = 17,
716 LastReservedStream = 0xffff
717 } MINIDUMP_STREAM_TYPE;
719 BOOL WINAPI MiniDumpWriteDump(HANDLE, DWORD, HANDLE, MINIDUMP_TYPE,
720 const PMINIDUMP_EXCEPTION_INFORMATION,
721 const PMINIDUMP_USER_STREAM_INFORMATION,
722 const PMINIDUMP_CALLBACK_INFORMATION);
723 BOOL WINAPI MiniDumpReadDumpStream(PVOID, ULONG, PMINIDUMP_DIRECTORY*, PVOID*,
728 /*************************
730 *************************/
732 /* flags for SymLoadModuleEx */
733 #define SLMFLAG_VIRTUAL 0x1
734 #define SLMFLAG_NO_SYMBOLS 0x4
736 typedef BOOL (CALLBACK *PENUMLOADED_MODULES_CALLBACK)(PSTR, DWORD, ULONG, PVOID);
737 BOOL WINAPI EnumerateLoadedModules(HANDLE, PENUMLOADED_MODULES_CALLBACK, PVOID);
738 typedef BOOL (CALLBACK *PENUMLOADED_MODULES_CALLBACK64)(PSTR, DWORD, ULONG64, PVOID);
739 BOOL WINAPI EnumerateLoadedModules64(HANDLE, PENUMLOADED_MODULES_CALLBACK64, PVOID);
740 typedef BOOL (CALLBACK *PSYM_ENUMMODULES_CALLBACK)(PSTR, DWORD, PVOID);
741 BOOL WINAPI SymEnumerateModules(HANDLE, PSYM_ENUMMODULES_CALLBACK, PVOID);
742 typedef BOOL (CALLBACK *PSYM_ENUMMODULES_CALLBACK64)(PSTR, DWORD64, PVOID);
743 BOOL WINAPI SymEnumerateModules64(HANDLE, PSYM_ENUMMODULES_CALLBACK64, PVOID);
744 BOOL WINAPI SymGetModuleInfo(HANDLE, DWORD, PIMAGEHLP_MODULE);
745 BOOL WINAPI SymGetModuleInfoW(HANDLE, DWORD, PIMAGEHLP_MODULEW);
746 BOOL WINAPI SymGetModuleInfo64(HANDLE, DWORD64, PIMAGEHLP_MODULE64);
747 BOOL WINAPI SymGetModuleInfoW64(HANDLE, DWORD64, PIMAGEHLP_MODULEW64);
748 DWORD WINAPI SymGetModuleBase(HANDLE, DWORD);
749 DWORD64 WINAPI SymGetModuleBase64(HANDLE, DWORD64);
750 DWORD WINAPI SymLoadModule(HANDLE, HANDLE, PCSTR, PCSTR, DWORD, DWORD);
751 DWORD64 WINAPI SymLoadModule64(HANDLE, HANDLE, PCSTR, PCSTR, DWORD64, DWORD);
752 DWORD64 WINAPI SymLoadModuleEx(HANDLE, HANDLE, PCSTR, PCSTR, DWORD64, DWORD,
753 PMODLOAD_DATA, DWORD);
754 BOOL WINAPI SymUnloadModule(HANDLE, DWORD);
755 BOOL WINAPI SymUnloadModule64(HANDLE, DWORD64);
757 /*************************
759 *************************/
761 #define IMAGEHLP_SYMBOL_INFO_VALUEPRESENT 1
762 #define IMAGEHLP_SYMBOL_INFO_REGISTER SYMF_REGISTER /* 0x08 */
763 #define IMAGEHLP_SYMBOL_INFO_REGRELATIVE SYMF_REGREL /* 0x10 */
764 #define IMAGEHLP_SYMBOL_INFO_FRAMERELATIVE SYMF_FRAMEREL /* 0x20 */
765 #define IMAGEHLP_SYMBOL_INFO_PARAMETER SYMF_PARAMETER /* 0x40 */
766 #define IMAGEHLP_SYMBOL_INFO_LOCAL SYMF_LOCAL /* 0x80 */
767 #define IMAGEHLP_SYMBOL_INFO_CONSTANT SYMF_CONSTANT /* 0x100 */
768 #define IMAGEHLP_SYMBOL_FUNCTION SYMF_FUNCTION /* 0x800 */
770 #define SYMFLAG_VALUEPRESENT 0x00000001
771 #define SYMFLAG_REGISTER 0x00000008
772 #define SYMFLAG_REGREL 0x00000010
773 #define SYMFLAG_FRAMEREL 0x00000020
774 #define SYMFLAG_PARAMETER 0x00000040
775 #define SYMFLAG_LOCAL 0x00000080
776 #define SYMFLAG_CONSTANT 0x00000100
777 #define SYMFLAG_EXPORT 0x00000200
778 #define SYMFLAG_FORWARDER 0x00000400
779 #define SYMFLAG_FUNCTION 0x00000800
780 #define SYMFLAG_VIRTUAL 0x00001000
781 #define SYMFLAG_THUNK 0x00002000
782 #define SYMFLAG_TLSREL 0x00004000
783 #define SYMFLAG_SLOT 0x00008000
785 #define MAX_SYM_NAME 2000
787 typedef struct _SYMBOL_INFO
792 ULONG info; /* sdk states info, while MSDN says it's Index... */
804 } SYMBOL_INFO, *PSYMBOL_INFO;
806 typedef enum _IMAGEHLP_SYMBOL_TYPE_INFO
814 TI_GET_ARRAYINDEXTYPEID,
817 TI_GET_ADDRESSOFFSET,
821 TI_GET_CHILDRENCOUNT,
823 TI_GET_VIRTUALBASECLASS,
824 TI_GET_VIRTUALTABLESHAPEID,
825 TI_GET_VIRTUALBASEPOINTEROFFSET,
826 TI_GET_CLASSPARENTID,
829 TI_GET_LEXICALPARENT,
834 TI_GET_CALLING_CONVENTION,
835 } IMAGEHLP_SYMBOL_TYPE_INFO;
837 typedef struct _TI_FINDCHILDREN_PARAMS
842 } TI_FINDCHILDREN_PARAMS;
844 #define UNDNAME_COMPLETE (0x0000)
845 #define UNDNAME_NO_LEADING_UNDERSCORES (0x0001)
846 #define UNDNAME_NO_MS_KEYWORDS (0x0002)
847 #define UNDNAME_NO_FUNCTION_RETURNS (0x0004)
848 #define UNDNAME_NO_ALLOCATION_MODEL (0x0008)
849 #define UNDNAME_NO_ALLOCATION_LANGUAGE (0x0010)
850 #define UNDNAME_NO_MS_THISTYPE (0x0020)
851 #define UNDNAME_NO_CV_THISTYPE (0x0040)
852 #define UNDNAME_NO_THISTYPE (0x0060)
853 #define UNDNAME_NO_ACCESS_SPECIFIERS (0x0080)
854 #define UNDNAME_NO_THROW_SIGNATURES (0x0100)
855 #define UNDNAME_NO_MEMBER_TYPE (0x0200)
856 #define UNDNAME_NO_RETURN_UDT_MODEL (0x0400)
857 #define UNDNAME_32_BIT_DECODE (0x0800)
858 #define UNDNAME_NAME_ONLY (0x1000)
859 #define UNDNAME_NO_ARGUMENTS (0x2000)
860 #define UNDNAME_NO_SPECIAL_SYMS (0x4000)
862 #define SYMSEARCH_MASKOBJS 0x01
863 #define SYMSEARCH_RECURSE 0x02
864 #define SYMSEARCH_GLOBALSONLY 0x04
866 BOOL WINAPI SymGetTypeInfo(HANDLE, DWORD64, ULONG, IMAGEHLP_SYMBOL_TYPE_INFO, PVOID);
867 typedef BOOL (CALLBACK *PSYM_ENUMERATESYMBOLS_CALLBACK)(PSYMBOL_INFO, ULONG, PVOID);
868 BOOL WINAPI SymEnumTypes(HANDLE, ULONG64, PSYM_ENUMERATESYMBOLS_CALLBACK, PVOID);
869 BOOL WINAPI SymFromAddr(HANDLE, DWORD64, DWORD64*, SYMBOL_INFO*);
870 BOOL WINAPI SymFromToken(HANDLE, DWORD64, DWORD, PSYMBOL_INFO);
871 BOOL WINAPI SymFromName(HANDLE, PCSTR, PSYMBOL_INFO);
872 BOOL WINAPI SymGetSymFromAddr(HANDLE, DWORD, PDWORD, PIMAGEHLP_SYMBOL);
873 BOOL WINAPI SymGetSymFromAddr64(HANDLE, DWORD64, PDWORD64, PIMAGEHLP_SYMBOL64);
874 BOOL WINAPI SymGetSymFromName(HANDLE, PCSTR, PIMAGEHLP_SYMBOL);
875 BOOL WINAPI SymGetSymFromName64(HANDLE, PCSTR, PIMAGEHLP_SYMBOL64);
876 BOOL WINAPI SymGetTypeFromName(HANDLE, ULONG64, PCSTR, PSYMBOL_INFO);
877 BOOL WINAPI SymGetSymNext(HANDLE, PIMAGEHLP_SYMBOL);
878 BOOL WINAPI SymGetSymNext64(HANDLE, PIMAGEHLP_SYMBOL64);
879 BOOL WINAPI SymGetSymPrev(HANDLE, PIMAGEHLP_SYMBOL);
880 BOOL WINAPI SymGetSymPrev64(HANDLE, PIMAGEHLP_SYMBOL64);
881 BOOL WINAPI SymEnumSymbols(HANDLE, ULONG64, PCSTR, PSYM_ENUMERATESYMBOLS_CALLBACK,
883 typedef BOOL (CALLBACK *PSYM_ENUMSYMBOLS_CALLBACK)(PSTR, DWORD, ULONG, PVOID);
884 BOOL WINAPI SymEnumerateSymbols(HANDLE, DWORD, PSYM_ENUMSYMBOLS_CALLBACK, PVOID);
885 typedef BOOL (CALLBACK *PSYM_ENUMSYMBOLS_CALLBACK64)(PSTR, DWORD64, ULONG, PVOID);
886 BOOL WINAPI SymEnumerateSymbols64(HANDLE, DWORD64, PSYM_ENUMSYMBOLS_CALLBACK64, PVOID);
887 BOOL WINAPI SymEnumSymbolsForAddr(HANDLE, DWORD64, PSYM_ENUMERATESYMBOLS_CALLBACK, PVOID);
888 typedef BOOL (CALLBACK *PSYMBOL_REGISTERED_CALLBACK)(HANDLE, ULONG, PVOID, PVOID);
889 BOOL WINAPI SymRegisterCallback(HANDLE, PSYMBOL_REGISTERED_CALLBACK, PVOID);
890 typedef BOOL (CALLBACK *PSYMBOL_REGISTERED_CALLBACK64)(HANDLE, ULONG, ULONG64, ULONG64);
891 BOOL WINAPI SymRegisterCallback64(HANDLE, PSYMBOL_REGISTERED_CALLBACK64, ULONG64);
892 BOOL WINAPI SymUnDName(PIMAGEHLP_SYMBOL, PSTR, DWORD);
893 BOOL WINAPI SymUnDName64(PIMAGEHLP_SYMBOL64, PSTR, DWORD);
894 DWORD WINAPI UnDecorateSymbolName(LPCSTR, LPSTR, DWORD, DWORD);
895 BOOL WINAPI SymMatchString(PCSTR, PCSTR, BOOL);
896 BOOL WINAPI SymMatchStringW(PCWSTR, PCWSTR, BOOL);
897 BOOL WINAPI SymSearch(HANDLE, ULONG64, DWORD, DWORD, PCSTR, DWORD64, PSYM_ENUMERATESYMBOLS_CALLBACK, PVOID, DWORD);
898 DWORD WINAPI UnDecorateSymbolName(PCSTR, PSTR, DWORD, DWORD);
899 BOOL WINAPI SymGetScope(HANDLE, ULONG64, DWORD, PSYMBOL_INFO);
900 BOOL WINAPI SymFromIndex(HANDLE, ULONG64, DWORD, PSYMBOL_INFO);
901 BOOL WINAPI SymAddSymbol(HANDLE, ULONG64, PCSTR, DWORD64, DWORD, DWORD);
902 BOOL WINAPI SymDeleteSymbol(HANDLE, ULONG64, PCSTR, DWORD64, DWORD);
904 /*************************
906 *************************/
907 typedef BOOL (CALLBACK *PSYM_ENUMSOURCEFILES_CALLBACK)(PSOURCEFILE, PVOID);
909 BOOL WINAPI SymEnumSourceFiles(HANDLE, ULONG64, PCSTR, PSYM_ENUMSOURCEFILES_CALLBACK,
911 BOOL WINAPI SymGetLineFromAddr(HANDLE, DWORD, PDWORD, PIMAGEHLP_LINE);
912 BOOL WINAPI SymGetLineFromAddr64(HANDLE, DWORD64, PDWORD, PIMAGEHLP_LINE64);
913 BOOL WINAPI SymGetLinePrev(HANDLE, PIMAGEHLP_LINE);
914 BOOL WINAPI SymGetLinePrev64(HANDLE, PIMAGEHLP_LINE64);
915 BOOL WINAPI SymGetLineNext(HANDLE, PIMAGEHLP_LINE);
916 BOOL WINAPI SymGetLineNext64(HANDLE, PIMAGEHLP_LINE64);
917 BOOL WINAPI SymGetLineFromName(HANDLE, PCSTR, PCSTR, DWORD, PLONG, PIMAGEHLP_LINE);
918 BOOL WINAPI SymGetLineFromName64(HANDLE, PCSTR, PCSTR, DWORD, PLONG, PIMAGEHLP_LINE64);
919 ULONG WINAPI SymGetFileLineOffsets64(HANDLE, LPSTR, LPSTR, PDWORD64, ULONG);
920 ULONG WINAPI SymGetFileLineOffsetsW64(HANDLE, PWCH, PWCH, PDWORD64, ULONG);
921 BOOL WINAPI SymGetSourceFile(HANDLE, ULONG64, PCSTR, PCSTR, PSTR, DWORD);
922 BOOL WINAPI SymGetSourceFileToken(HANDLE, ULONG64, PCSTR, PVOID*, DWORD*);
923 BOOL WINAPI SymGetSourceFileFromToken(HANDLE, PVOID, PCSTR, PSTR, DWORD);
924 BOOL WINAPI SymGetSourceVarFromToken(HANDLE, PVOID, PCSTR, PCSTR, PSTR, DWORD);
926 typedef struct _SRCCODEINFO
931 char Obj[MAX_PATH+1];
932 char FileName[MAX_PATH+1];
935 } SRCCODEINFO, *PSRCCODEINFO;
937 typedef BOOL (CALLBACK* PSYM_ENUMLINES_CALLBACK)(PSRCCODEINFO, PVOID);
938 BOOL WINAPI SymEnumLines(HANDLE, ULONG64, PCSTR, PCSTR, PSYM_ENUMLINES_CALLBACK, PVOID);
940 /*************************
941 * File & image handling *
942 *************************/
943 BOOL WINAPI SymInitialize(HANDLE, PCSTR, BOOL);
944 BOOL WINAPI SymCleanup(HANDLE);
946 HANDLE WINAPI FindDebugInfoFile(PCSTR, PCSTR, PSTR);
947 typedef BOOL (CALLBACK *PFIND_DEBUG_FILE_CALLBACK)(HANDLE, PSTR, PVOID);
948 HANDLE WINAPI FindDebugInfoFileEx(PCSTR, PCSTR, PSTR, PFIND_DEBUG_FILE_CALLBACK, PVOID);
949 typedef BOOL (CALLBACK *PFINDFILEINPATHCALLBACK)(PSTR, PVOID);
950 BOOL WINAPI SymFindFileInPath(HANDLE, PCSTR, PCSTR, PVOID, DWORD, DWORD, DWORD,
951 PSTR, PFINDFILEINPATHCALLBACK, PVOID);
952 HANDLE WINAPI FindExecutableImage(PCSTR, PCSTR, PSTR);
953 typedef BOOL (CALLBACK *PFIND_EXE_FILE_CALLBACK)(HANDLE, PSTR, PVOID);
954 HANDLE WINAPI FindExecutableImageEx(PCSTR, PCSTR, PSTR, PFIND_EXE_FILE_CALLBACK, PVOID);
955 PIMAGE_NT_HEADERS WINAPI ImageNtHeader(PVOID);
956 PVOID WINAPI ImageDirectoryEntryToDataEx(PVOID, BOOLEAN, USHORT, PULONG,
957 PIMAGE_SECTION_HEADER *);
958 PVOID WINAPI ImageDirectoryEntryToData(PVOID, BOOLEAN, USHORT, PULONG);
959 PIMAGE_SECTION_HEADER WINAPI ImageRvaToSection(PIMAGE_NT_HEADERS, PVOID, ULONG);
960 PVOID WINAPI ImageRvaToVa(PIMAGE_NT_HEADERS, PVOID, ULONG, PIMAGE_SECTION_HEADER*);
961 BOOL WINAPI SymGetSearchPath(HANDLE, PSTR, DWORD);
962 BOOL WINAPI SymSetSearchPath(HANDLE, PCSTR);
963 DWORD WINAPI GetTimestampForLoadedLibrary(HMODULE);
964 BOOL WINAPI MakeSureDirectoryPathExists(PCSTR);
965 BOOL WINAPI SearchTreeForFile(PCSTR, PCSTR, PSTR);
966 typedef BOOL (CALLBACK *PENUMDIRTREE_CALLBACK)(LPCSTR, PVOID);
967 BOOL WINAPI EnumDirTree(HANDLE, PCSTR, PCSTR, PSTR, PENUMDIRTREE_CALLBACK, void*);
968 BOOL WINAPI SymMatchFileName(PSTR, PSTR, PSTR*, PSTR*);
969 PCHAR WINAPI SymSetHomeDirectory(HANDLE, PCSTR);
970 PCHAR WINAPI SymGetHomeDirectory(DWORD, PSTR, size_t);
976 /*************************
977 * Context management *
978 *************************/
979 BOOL WINAPI SymSetContext(HANDLE, PIMAGEHLP_STACK_FRAME, PIMAGEHLP_CONTEXT);
982 /*************************
984 *************************/
986 typedef struct _KDHELP
989 DWORD ThCallbackStack;
992 DWORD KiCallUserMode;
993 DWORD KeUserCallbackDispatcher;
994 DWORD SystemRangeStart;
997 typedef struct _KDHELP64
1000 DWORD ThCallbackStack;
1001 DWORD ThCallbackBStore;
1004 DWORD64 KiCallUserMode;
1005 DWORD64 KeUserCallbackDispatcher;
1006 DWORD64 SystemRangeStart;
1007 DWORD64 Reserved[8];
1008 } KDHELP64, *PKDHELP64;
1010 typedef struct _STACKFRAME
1016 PVOID FuncTableEntry;
1023 } STACKFRAME, *LPSTACKFRAME;
1025 typedef struct _STACKFRAME64
1028 ADDRESS64 AddrReturn;
1029 ADDRESS64 AddrFrame;
1030 ADDRESS64 AddrStack;
1031 ADDRESS64 AddrBStore;
1032 PVOID FuncTableEntry;
1036 DWORD64 Reserved[3];
1038 } STACKFRAME64, *LPSTACKFRAME64;
1040 typedef BOOL (CALLBACK *PREAD_PROCESS_MEMORY_ROUTINE)
1041 (HANDLE, DWORD, PVOID, DWORD, PDWORD);
1042 typedef PVOID (CALLBACK *PFUNCTION_TABLE_ACCESS_ROUTINE)(HANDLE, DWORD);
1043 typedef DWORD (CALLBACK *PGET_MODULE_BASE_ROUTINE)(HANDLE, DWORD);
1044 typedef DWORD (CALLBACK *PTRANSLATE_ADDRESS_ROUTINE)(HANDLE, HANDLE, LPADDRESS);
1045 BOOL WINAPI StackWalk(DWORD, HANDLE, HANDLE, LPSTACKFRAME, PVOID,
1046 PREAD_PROCESS_MEMORY_ROUTINE,
1047 PFUNCTION_TABLE_ACCESS_ROUTINE,
1048 PGET_MODULE_BASE_ROUTINE,
1049 PTRANSLATE_ADDRESS_ROUTINE);
1051 typedef BOOL (CALLBACK *PREAD_PROCESS_MEMORY_ROUTINE64)
1052 (HANDLE, DWORD64, PVOID, DWORD, PDWORD);
1053 typedef PVOID (CALLBACK *PFUNCTION_TABLE_ACCESS_ROUTINE64)(HANDLE, DWORD64);
1054 typedef DWORD64 (CALLBACK *PGET_MODULE_BASE_ROUTINE64)(HANDLE, DWORD64);
1055 typedef DWORD64 (CALLBACK *PTRANSLATE_ADDRESS_ROUTINE64)(HANDLE, HANDLE, LPADDRESS64);
1056 BOOL WINAPI StackWalk64(DWORD, HANDLE, HANDLE, LPSTACKFRAME64, PVOID,
1057 PREAD_PROCESS_MEMORY_ROUTINE64,
1058 PFUNCTION_TABLE_ACCESS_ROUTINE64,
1059 PGET_MODULE_BASE_ROUTINE64,
1060 PTRANSLATE_ADDRESS_ROUTINE64);
1062 PVOID WINAPI SymFunctionTableAccess(HANDLE, DWORD);
1063 PVOID WINAPI SymFunctionTableAccess64(HANDLE, DWORD64);
1065 typedef PVOID (CALLBACK *PSYMBOL_FUNCENTRY_CALLBACK)(HANDLE, DWORD, PVOID);
1066 typedef PVOID (CALLBACK *PSYMBOL_FUNCENTRY_CALLBACK64)(HANDLE, ULONG64, ULONG64);
1068 BOOL WINAPI SymRegisterFunctionEntryCallback(HANDLE, PSYMBOL_FUNCENTRY_CALLBACK, PVOID);
1069 BOOL WINAPI SymRegisterFunctionEntryCallback64(HANDLE, PSYMBOL_FUNCENTRY_CALLBACK64, ULONG64);
1071 /*************************
1072 * Version, global stuff *
1073 *************************/
1075 #define API_VERSION_NUMBER 9
1077 typedef struct API_VERSION
1079 USHORT MajorVersion;
1080 USHORT MinorVersion;
1083 } API_VERSION, *LPAPI_VERSION;
1085 LPAPI_VERSION WINAPI ImagehlpApiVersion(void);
1086 LPAPI_VERSION WINAPI ImagehlpApiVersionEx(LPAPI_VERSION);
1088 typedef struct _IMAGE_DEBUG_INFORMATION
1092 PVOID ReservedMappedBase;
1093 USHORT ReservedMachine;
1094 USHORT ReservedCharacteristics;
1095 DWORD ReservedCheckSum;
1098 DWORD ReservedNumberOfSections;
1099 PIMAGE_SECTION_HEADER ReservedSections;
1100 DWORD ReservedExportedNamesSize;
1101 PSTR ReservedExportedNames;
1102 DWORD ReservedNumberOfFunctionTableEntries;
1103 PIMAGE_FUNCTION_ENTRY ReservedFunctionTableEntries;
1104 DWORD ReservedLowestFunctionStartingAddress;
1105 DWORD ReservedHighestFunctionEndingAddress;
1106 DWORD ReservedNumberOfFpoTableEntries;
1107 PFPO_DATA ReservedFpoTableEntries;
1108 DWORD SizeOfCoffSymbols;
1109 PIMAGE_COFF_SYMBOLS_HEADER CoffSymbols;
1110 DWORD ReservedSizeOfCodeViewSymbols;
1111 PVOID ReservedCodeViewSymbols;
1114 PSTR ReservedDebugFilePath;
1115 DWORD ReservedTimeDateStamp;
1116 BOOL ReservedRomImage;
1117 PIMAGE_DEBUG_DIRECTORY ReservedDebugDirectory;
1118 DWORD ReservedNumberOfDebugDirectories;
1119 DWORD ReservedOriginalFunctionTableBaseAddress;
1120 DWORD Reserved[ 2 ];
1121 } IMAGE_DEBUG_INFORMATION, *PIMAGE_DEBUG_INFORMATION;
1124 PIMAGE_DEBUG_INFORMATION WINAPI MapDebugInformation(HANDLE, PSTR, PSTR, DWORD);
1126 BOOL WINAPI UnmapDebugInformation(PIMAGE_DEBUG_INFORMATION);
1128 DWORD WINAPI SymGetOptions(void);
1129 DWORD WINAPI SymSetOptions(DWORD);
1131 BOOL WINAPI SymSetParentWindow(HWND);
1133 /*************************
1134 * Version, global stuff *
1135 *************************/
1137 typedef BOOL (WINAPI* PSYMBOLSERVERPROC)(LPCSTR, LPCSTR, PVOID, DWORD, DWORD, LPSTR);
1138 typedef BOOL (WINAPI* PSYMBOLSERVEROPENPROC)(void);
1139 typedef BOOL (WINAPI* PSYMBOLSERVERCLOSEPROC)(void);
1140 typedef BOOL (WINAPI* PSYMBOLSERVERSETOPTIONSPROC)(UINT_PTR, ULONG64);
1141 typedef BOOL (CALLBACK* PSYMBOLSERVERCALLBACKPROC)(UINT_PTR, ULONG64, ULONG64);
1142 typedef UINT_PTR (WINAPI* PSYMBOLSERVERGETOPTIONSPROC)(void);
1143 typedef BOOL (WINAPI* PSYMBOLSERVERPINGPROC)(LPCSTR);
1145 #define SSRVOPT_CALLBACK 0x0001
1146 #define SSRVOPT_DWORD 0x0002
1147 #define SSRVOPT_DWORDPTR 0x0004
1148 #define SSRVOPT_GUIDPTR 0x0008
1149 #define SSRVOPT_OLDGUIDPTR 0x0010
1150 #define SSRVOPT_UNATTENDED 0x0020
1151 #define SSRVOPT_NOCOPY 0x0040
1152 #define SSRVOPT_PARENTWIN 0x0080
1153 #define SSRVOPT_PARAMTYPE 0x0100
1154 #define SSRVOPT_SECURE 0x0200
1155 #define SSRVOPT_TRACE 0x0400
1156 #define SSRVOPT_SETCONTEXT 0x0800
1157 #define SSRVOPT_PROXY 0x1000
1158 #define SSRVOPT_DOWNSTREAM_STORE 0x2000
1159 #define SSRVOPT_RESET ((ULONG_PTR)-1)
1161 #define SSRVACTION_TRACE 1
1162 #define SSRVACTION_QUERYCANCEL 2
1163 #define SSRVACTION_EVENT 3
1167 #endif /* defined(__cplusplus) */
1169 #endif /* __WINE_DBGHELP_H */