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 #define SYMF_OMAP_GENERATED 0x00000001
64 #define SYMF_OMAP_MODIFIED 0x00000002
65 #define SYMF_USER_GENERATED 0x00000004
66 #define SYMF_REGISTER 0x00000008
67 #define SYMF_REGREL 0x00000010
68 #define SYMF_FRAMEREL 0x00000020
69 #define SYMF_PARAMETER 0x00000040
70 #define SYMF_LOCAL 0x00000080
71 #define SYMF_CONSTANT 0x00000100
72 #define SYMF_EXPORT 0x00000200
73 #define SYMF_FORWARDER 0x00000400
74 #define SYMF_FUNCTION 0x00000800
75 #define SYMF_VIRTUAL 0x00001000
76 #define SYMF_THUNK 0x00002000
77 #define SYMF_TLSREL 0x00004000
92 typedef struct _IMAGEHLP_SYMBOL
100 } IMAGEHLP_SYMBOL, *PIMAGEHLP_SYMBOL;
102 typedef struct _IMAGEHLP_MODULE
113 CHAR LoadedImageName[256];
114 } IMAGEHLP_MODULE, *PIMAGEHLP_MODULE;
116 typedef struct _IMAGEHLP_MODULEW
125 WCHAR ModuleName[32];
126 WCHAR ImageName[256];
127 WCHAR LoadedImageName[256];
128 } IMAGEHLP_MODULEW, *PIMAGEHLP_MODULEW;
130 typedef struct _IMAGEHLP_MODULE64
141 CHAR LoadedImageName[256];
142 CHAR LoadedPdbName[256];
144 CHAR CVData[MAX_PATH*3];
155 } IMAGEHLP_MODULE64, *PIMAGEHLP_MODULE64;
157 typedef struct _IMAGEHLP_LINE
164 } IMAGEHLP_LINE, *PIMAGEHLP_LINE;
166 typedef struct _IMAGEHLP_LINE64
173 } IMAGEHLP_LINE64, *PIMAGEHLP_LINE64;
175 typedef struct _SOURCEFILE
179 } SOURCEFILE, *PSOURCEFILE;
181 #define CBA_DEFERRED_SYMBOL_LOAD_START 0x00000001
182 #define CBA_DEFERRED_SYMBOL_LOAD_COMPLETE 0x00000002
183 #define CBA_DEFERRED_SYMBOL_LOAD_FAILURE 0x00000003
184 #define CBA_SYMBOLS_UNLOADED 0x00000004
185 #define CBA_DUPLICATE_SYMBOL 0x00000005
186 #define CBA_READ_MEMORY 0x00000006
187 #define CBA_DEFERRED_SYMBOL_LOAD_CANCEL 0x00000007
188 #define CBA_SET_OPTIONS 0x00000008
189 #define CBA_EVENT 0x00000010
190 #define CBA_DEBUG_INFO 0x10000000
192 typedef struct _IMAGEHLP_CBA_READ_MEMORY
198 } IMAGEHLP_CBA_READ_MEMORY, *PIMAGEHLP_CBA_READ_MEMORY;
209 typedef struct _IMAGEHLP_CBA_EVENT
215 } IMAGEHLP_CBA_EVENT, *PIMAGEHLP_CBA_EVENT;
217 typedef struct _IMAGEHLP_DEFERRED_SYMBOL_LOAD
223 CHAR FileName[MAX_PATH];
225 } IMAGEHLP_DEFERRED_SYMBOL_LOAD, *PIMAGEHLP_DEFERRED_SYMBOL_LOAD;
227 typedef struct _IMAGEHLP_DUPLICATE_SYMBOL
231 PIMAGEHLP_SYMBOL Symbol;
232 DWORD SelectedSymbol;
233 } IMAGEHLP_DUPLICATE_SYMBOL, *PIMAGEHLP_DUPLICATE_SYMBOL;
235 #define SYMOPT_CASE_INSENSITIVE 0x00000001
236 #define SYMOPT_UNDNAME 0x00000002
237 #define SYMOPT_DEFERRED_LOADS 0x00000004
238 #define SYMOPT_NO_CPP 0x00000008
239 #define SYMOPT_LOAD_LINES 0x00000010
240 #define SYMOPT_OMAP_FIND_NEAREST 0x00000020
241 #define SYMOPT_LOAD_ANYTHING 0x00000040
242 #define SYMOPT_IGNORE_CVREC 0x00000080
243 #define SYMOPT_NO_UNQUALIFIED_LOADS 0x00000100
244 #define SYMOPT_FAIL_CRITICAL_ERRORS 0x00000200
245 #define SYMOPT_EXACT_SYMBOLS 0x00000400
246 #define SYMOPT_WILD_UNDERSCORE 0x00000800
247 #define SYMOPT_USE_DEFAULTS 0x00001000
248 #define SYMOPT_INCLUDE_32BIT_MODULES 0x00002000
249 #define SYMOPT_PUBLICS_ONLY 0x00004000
250 #define SYMOPT_NO_PUBLICS 0x00008000
251 #define SYMOPT_AUTO_PUBLICS 0x00010000
252 #define SYMOPT_NO_IMAGE_SEARCH 0x00020000
253 #define SYMOPT_SECURE 0x00040000
254 #define SYMOPT_NO_PROMPTS 0x00080000
256 #define SYMOPT_DEBUG 0x80000000
258 typedef struct _IMAGEHLP_STACK_FRAME
260 ULONG64 InstructionOffset;
261 ULONG64 ReturnOffset;
264 ULONG64 BackingStoreOffset;
265 ULONG64 FuncTableEntry;
270 } IMAGEHLP_STACK_FRAME, *PIMAGEHLP_STACK_FRAME;
272 typedef VOID IMAGEHLP_CONTEXT, *PIMAGEHLP_CONTEXT;
274 #define DBHHEADER_DEBUGDIRS 0x1
275 typedef struct _DBGHELP_MODLOAD_DATA
282 } MODLOAD_DATA, *PMODLOAD_DATA;
284 /*************************
286 *************************/
290 #define MINIDUMP_SIGNATURE 0x504D444D /* 'MDMP' */
291 #define MINIDUMP_VERSION (42899)
294 typedef ULONG64 RVA64;
296 typedef enum _MINIDUMP_TYPE
298 MiniDumpNormal = 0x0000,
299 MiniDumpWithDataSegs = 0x0001,
300 MiniDumpWithFullMemory = 0x0002,
301 MiniDumpWithHandleData = 0x0004,
302 MiniDumpFilterMemory = 0x0008,
303 MiniDumpScanMemory = 0x0010,
304 MiniDumpWithUnloadedModules = 0x0020,
305 MiniDumpWithIndirectlyReferencedMemory = 0x0040,
306 MiniDumpFilterModulePaths = 0x0080,
307 MiniDumpWithProcessThreadData = 0x0100,
308 MiniDumpWithPrivateReadWriteMemory = 0x0200,
309 MiniDumpWithoutOptionalData = 0x0400,
310 MiniDumpWithFullMemoryInfo = 0x0800,
311 MiniDumpWithThreadInfo = 0x1000,
312 MiniDumpWithCodeSegs = 0x2000
315 typedef enum _MINIDUMP_CALLBACK_TYPE
320 IncludeThreadCallback,
321 IncludeModuleCallback,
323 } MINIDUMP_CALLBACK_TYPE;
325 typedef struct _MINIDUMP_THREAD_CALLBACK
333 } MINIDUMP_THREAD_CALLBACK, *PMINIDUMP_THREAD_CALLBACK;
335 typedef struct _MINIDUMP_THREAD_EX_CALLBACK
343 ULONG64 BackingStoreBase;
344 ULONG64 BackingStoreEnd;
345 } MINIDUMP_THREAD_EX_CALLBACK, *PMINIDUMP_THREAD_EX_CALLBACK;
347 typedef struct _MINIDUMP_INCLUDE_THREAD_CALLBACK
350 } MINIDUMP_INCLUDE_THREAD_CALLBACK, *PMINIDUMP_INCLUDE_THREAD_CALLBACK;
352 typedef enum _THREAD_WRITE_FLAGS
354 ThreadWriteThread = 0x0001,
355 ThreadWriteStack = 0x0002,
356 ThreadWriteContext = 0x0004,
357 ThreadWriteBackingStore = 0x0008,
358 ThreadWriteInstructionWindow = 0x0010,
359 ThreadWriteThreadData = 0x0020,
360 ThreadWriteThreadInfo = 0x0040
361 } THREAD_WRITE_FLAGS;
363 typedef struct _MINIDUMP_MODULE_CALLBACK
370 VS_FIXEDFILEINFO VersionInfo;
372 ULONG SizeOfCvRecord;
374 ULONG SizeOfMiscRecord;
375 } MINIDUMP_MODULE_CALLBACK, *PMINIDUMP_MODULE_CALLBACK;
377 typedef struct _MINIDUMP_INCLUDE_MODULE_CALLBACK
380 } MINIDUMP_INCLUDE_MODULE_CALLBACK, *PMINIDUMP_INCLUDE_MODULE_CALLBACK;
382 typedef enum _MODULE_WRITE_FLAGS
384 ModuleWriteModule = 0x0001,
385 ModuleWriteDataSeg = 0x0002,
386 ModuleWriteMiscRecord = 0x0004,
387 ModuleWriteCvRecord = 0x0008,
388 ModuleReferencedByMemory = 0x0010,
389 ModuleWriteTlsData = 0x0020,
390 ModuleWriteCodeSegs = 0x0040,
391 } MODULE_WRITE_FLAGS;
393 typedef struct _MINIDUMP_CALLBACK_INPUT
396 HANDLE ProcessHandle;
400 MINIDUMP_THREAD_CALLBACK Thread;
401 MINIDUMP_THREAD_EX_CALLBACK ThreadEx;
402 MINIDUMP_MODULE_CALLBACK Module;
403 MINIDUMP_INCLUDE_THREAD_CALLBACK IncludeThread;
404 MINIDUMP_INCLUDE_MODULE_CALLBACK IncludeModule;
406 } MINIDUMP_CALLBACK_INPUT, *PMINIDUMP_CALLBACK_INPUT;
408 typedef struct _MINIDUMP_CALLBACK_OUTPUT
412 ULONG ModuleWriteFlags;
413 ULONG ThreadWriteFlags;
420 } MINIDUMP_CALLBACK_OUTPUT, *PMINIDUMP_CALLBACK_OUTPUT;
422 typedef BOOL (WINAPI* MINIDUMP_CALLBACK_ROUTINE)(PVOID, const PMINIDUMP_CALLBACK_INPUT, PMINIDUMP_CALLBACK_OUTPUT);
424 typedef struct _MINIDUMP_CALLBACK_INFORMATION
426 MINIDUMP_CALLBACK_ROUTINE CallbackRoutine;
428 } MINIDUMP_CALLBACK_INFORMATION, *PMINIDUMP_CALLBACK_INFORMATION;
430 typedef struct _MINIDUMP_LOCATION_DESCRIPTOR
434 } MINIDUMP_LOCATION_DESCRIPTOR;
436 typedef struct _MINIDUMP_DIRECTORY
439 MINIDUMP_LOCATION_DESCRIPTOR Location;
440 } MINIDUMP_DIRECTORY, *PMINIDUMP_DIRECTORY;
442 typedef struct _MINIDUMP_EXCEPTION
445 ULONG ExceptionFlags;
446 ULONG64 ExceptionRecord;
447 ULONG64 ExceptionAddress;
448 ULONG NumberParameters;
449 ULONG __unusedAlignment;
450 ULONG64 ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS];
451 } MINIDUMP_EXCEPTION, *PMINIDUMP_EXCEPTION;
453 typedef struct _MINIDUMP_EXCEPTION_INFORMATION
456 PEXCEPTION_POINTERS ExceptionPointers;
458 } MINIDUMP_EXCEPTION_INFORMATION, *PMINIDUMP_EXCEPTION_INFORMATION;
460 typedef struct MINIDUMP_EXCEPTION_STREAM
464 MINIDUMP_EXCEPTION ExceptionRecord;
465 MINIDUMP_LOCATION_DESCRIPTOR ThreadContext;
466 } MINIDUMP_EXCEPTION_STREAM, *PMINIDUMP_EXCEPTION_STREAM;
468 typedef struct _MINIDUMP_HEADER
472 DWORD NumberOfStreams;
473 RVA StreamDirectoryRva;
481 } MINIDUMP_HEADER, *PMINIDUMP_HEADER;
483 typedef struct _MINIDUMP_MEMORY_DESCRIPTOR
485 ULONG64 StartOfMemoryRange;
486 MINIDUMP_LOCATION_DESCRIPTOR Memory;
487 } MINIDUMP_MEMORY_DESCRIPTOR, *PMINIDUMP_MEMORY_DESCRIPTOR;
489 typedef struct _MINIDUMP_MEMORY_LIST
491 ULONG NumberOfMemoryRanges;
492 MINIDUMP_MEMORY_DESCRIPTOR MemoryRanges[1]; /* FIXME: 0-sized array not supported */
493 } MINIDUMP_MEMORY_LIST, *PMINIDUMP_MEMORY_LIST;
495 #define MINIDUMP_MISC1_PROCESS_ID 0x00000001
496 #define MINIDUMP_MISC1_PROCESS_TIMES 0x00000002
498 typedef struct _MINIDUMP_MISC_INFO
503 ULONG ProcessCreateTime;
504 ULONG ProcessUserTime;
505 ULONG ProcessKernelTime;
506 } MINIDUMP_MISC_INFO, *PMINIDUMP_MISC_INFO;
508 typedef struct _MINIDUMP_MODULE
515 VS_FIXEDFILEINFO VersionInfo;
516 MINIDUMP_LOCATION_DESCRIPTOR CvRecord;
517 MINIDUMP_LOCATION_DESCRIPTOR MiscRecord;
520 } MINIDUMP_MODULE, *PMINIDUMP_MODULE;
522 typedef struct _MINIDUMP_MODULE_LIST
524 ULONG NumberOfModules;
525 MINIDUMP_MODULE Modules[1]; /* FIXME: 0-sized array not supported */
526 } MINIDUMP_MODULE_LIST, *PMINIDUMP_MODULE_LIST;
528 typedef struct _MINIDUMP_STRING
531 WCHAR Buffer[1]; /* FIXME: O-sized array not supported */
532 } MINIDUMP_STRING, *PMINIDUMP_STRING;
534 typedef struct _MINIDUMP_SYSTEM_INFO
536 USHORT ProcessorArchitecture;
537 USHORT ProcessorLevel;
538 USHORT ProcessorRevision;
544 UCHAR NumberOfProcessors;
564 union _CPU_INFORMATION
569 ULONG VersionInformation;
570 ULONG FeatureInformation;
571 ULONG AMDExtendedCpuFeatures;
575 ULONG64 ProcessorFeatures[2];
579 } MINIDUMP_SYSTEM_INFO, *PMINIDUMP_SYSTEM_INFO;
581 typedef struct _MINIDUMP_THREAD
588 MINIDUMP_MEMORY_DESCRIPTOR Stack;
589 MINIDUMP_LOCATION_DESCRIPTOR ThreadContext;
590 } MINIDUMP_THREAD, *PMINIDUMP_THREAD;
592 typedef struct _MINIDUMP_THREAD_LIST
594 ULONG NumberOfThreads;
595 MINIDUMP_THREAD Threads[1]; /* FIXME: no support of 0 sized array */
596 } MINIDUMP_THREAD_LIST, *PMINIDUMP_THREAD_LIST;
598 typedef struct _MINIDUMP_USER_STREAM
603 } MINIDUMP_USER_STREAM, *PMINIDUMP_USER_STREAM;
605 typedef struct _MINIDUMP_USER_STREAM_INFORMATION
607 ULONG UserStreamCount;
608 PMINIDUMP_USER_STREAM UserStreamArray;
609 } MINIDUMP_USER_STREAM_INFORMATION, *PMINIDUMP_USER_STREAM_INFORMATION;
611 typedef enum _MINIDUMP_STREAM_TYPE
616 ThreadListStream = 3,
617 ModuleListStream = 4,
618 MemoryListStream = 5,
620 SystemInfoStream = 7,
621 ThreadExListStream = 8,
622 Memory64ListStream = 9,
625 HandleDataStream = 12,
626 FunctionTableStream = 13,
627 UnloadedModuleListStream = 14,
629 MemoryInfoListStream = 16,
630 ThreadInfoListStream = 17,
632 LastReservedStream = 0xffff
633 } MINIDUMP_STREAM_TYPE;
635 BOOL WINAPI MiniDumpWriteDump(HANDLE, DWORD, HANDLE, MINIDUMP_TYPE,
636 const PMINIDUMP_EXCEPTION_INFORMATION,
637 const PMINIDUMP_USER_STREAM_INFORMATION,
638 const PMINIDUMP_CALLBACK_INFORMATION);
639 BOOL WINAPI MiniDumpReadDumpStream(PVOID, ULONG, PMINIDUMP_DIRECTORY*, PVOID*,
643 /*************************
645 *************************/
647 /* flags for SymLoadModuleEx */
648 #define SLMFLAG_VIRTUAL 0x1
649 #define SLMFLAG_NO_SYMBOLS 0x4
651 typedef BOOL (CALLBACK *PENUMLOADED_MODULES_CALLBACK)(PSTR, DWORD, ULONG, PVOID);
652 BOOL WINAPI EnumerateLoadedModules(HANDLE, PENUMLOADED_MODULES_CALLBACK, PVOID);
653 typedef BOOL (CALLBACK *PSYM_ENUMMODULES_CALLBACK)(PSTR, DWORD, PVOID);
654 BOOL WINAPI SymEnumerateModules(HANDLE, PSYM_ENUMMODULES_CALLBACK, PVOID);
655 BOOL WINAPI SymGetModuleInfo(HANDLE, DWORD, PIMAGEHLP_MODULE);
656 BOOL WINAPI SymGetModuleInfoW(HANDLE, DWORD, PIMAGEHLP_MODULEW);
657 BOOL WINAPI SymGetModuleInfo64(HANDLE, DWORD64, PIMAGEHLP_MODULE64);
658 DWORD WINAPI SymGetModuleBase(HANDLE, DWORD);
659 DWORD WINAPI SymLoadModule(HANDLE, HANDLE, PSTR, PSTR, DWORD, DWORD);
660 DWORD64 WINAPI SymLoadModuleEx(HANDLE, HANDLE, PCSTR, PCSTR, DWORD64, DWORD,
661 PMODLOAD_DATA, DWORD);
662 BOOL WINAPI SymUnloadModule(HANDLE, DWORD);
663 BOOL WINAPI SymUnloadModule64(HANDLE, DWORD64);
665 /*************************
667 *************************/
669 #define IMAGEHLP_SYMBOL_INFO_VALUEPRESENT 1
670 #define IMAGEHLP_SYMBOL_INFO_REGISTER SYMF_REGISTER /* 0x08 */
671 #define IMAGEHLP_SYMBOL_INFO_REGRELATIVE SYMF_REGREL /* 0x10 */
672 #define IMAGEHLP_SYMBOL_INFO_FRAMERELATIVE SYMF_FRAMEREL /* 0x20 */
673 #define IMAGEHLP_SYMBOL_INFO_PARAMETER SYMF_PARAMETER /* 0x40 */
674 #define IMAGEHLP_SYMBOL_INFO_LOCAL SYMF_LOCAL /* 0x80 */
675 #define IMAGEHLP_SYMBOL_INFO_CONSTANT SYMF_CONSTANT /* 0x100 */
676 #define IMAGEHLP_SYMBOL_FUNCTION SYMF_FUNCTION /* 0x800 */
678 #define SYMFLAG_VALUEPRESENT 0x00000001
679 #define SYMFLAG_REGISTER 0x00000008
680 #define SYMFLAG_REGREL 0x00000010
681 #define SYMFLAG_FRAMEREL 0x00000020
682 #define SYMFLAG_PARAMETER 0x00000040
683 #define SYMFLAG_LOCAL 0x00000080
684 #define SYMFLAG_CONSTANT 0x00000100
685 #define SYMFLAG_EXPORT 0x00000200
686 #define SYMFLAG_FORWARDER 0x00000400
687 #define SYMFLAG_FUNCTION 0x00000800
688 #define SYMFLAG_VIRTUAL 0x00001000
689 #define SYMFLAG_THUNK 0x00002000
690 #define SYMFLAG_TLSREL 0x00004000
692 typedef struct _SYMBOL_INFO
697 ULONG info; /* sdk states info, while MSDN says it's Index... */
709 } SYMBOL_INFO, *PSYMBOL_INFO;
711 typedef enum _IMAGEHLP_SYMBOL_TYPE_INFO
719 TI_GET_ARRAYINDEXTYPEID,
722 TI_GET_ADDRESSOFFSET,
726 TI_GET_CHILDRENCOUNT,
728 TI_GET_VIRTUALBASECLASS,
729 TI_GET_VIRTUALTABLESHAPEID,
730 TI_GET_VIRTUALBASEPOINTEROFFSET,
731 TI_GET_CLASSPARENTID,
734 TI_GET_LEXICALPARENT,
739 TI_GET_CALLING_CONVENTION,
740 } IMAGEHLP_SYMBOL_TYPE_INFO;
742 typedef struct _TI_FINDCHILDREN_PARAMS
747 } TI_FINDCHILDREN_PARAMS;
749 #define UNDNAME_COMPLETE (0x0000)
750 #define UNDNAME_NO_LEADING_UNDERSCORES (0x0001)
751 #define UNDNAME_NO_MS_KEYWORDS (0x0002)
752 #define UNDNAME_NO_FUNCTION_RETURNS (0x0004)
753 #define UNDNAME_NO_ALLOCATION_MODEL (0x0008)
754 #define UNDNAME_NO_ALLOCATION_LANGUAGE (0x0010)
755 #define UNDNAME_NO_MS_THISTYPE (0x0020)
756 #define UNDNAME_NO_CV_THISTYPE (0x0040)
757 #define UNDNAME_NO_THISTYPE (0x0060)
758 #define UNDNAME_NO_ACCESS_SPECIFIERS (0x0080)
759 #define UNDNAME_NO_THROW_SIGNATURES (0x0100)
760 #define UNDNAME_NO_MEMBER_TYPE (0x0200)
761 #define UNDNAME_NO_RETURN_UDT_MODEL (0x0400)
762 #define UNDNAME_32_BIT_DECODE (0x0800)
763 #define UNDNAME_NAME_ONLY (0x1000)
764 #define UNDNAME_NO_ARGUMENTS (0x2000)
765 #define UNDNAME_NO_SPECIAL_SYMS (0x4000)
767 BOOL WINAPI SymGetTypeInfo(HANDLE, DWORD64, ULONG, IMAGEHLP_SYMBOL_TYPE_INFO, PVOID);
768 typedef BOOL (CALLBACK *PSYM_ENUMERATESYMBOLS_CALLBACK)(PSYMBOL_INFO, ULONG, PVOID);
769 BOOL WINAPI SymEnumTypes(HANDLE, ULONG64, PSYM_ENUMERATESYMBOLS_CALLBACK, PVOID);
770 BOOL WINAPI SymFromAddr(HANDLE, DWORD64, DWORD64*, SYMBOL_INFO*);
771 BOOL WINAPI SymFromName(HANDLE, LPSTR, PSYMBOL_INFO);
772 BOOL WINAPI SymGetSymFromAddr(HANDLE, DWORD, PDWORD, PIMAGEHLP_SYMBOL);
773 BOOL WINAPI SymGetSymFromName(HANDLE, PSTR, PIMAGEHLP_SYMBOL);
774 BOOL WINAPI SymGetTypeFromName(HANDLE, ULONG64, LPSTR, PSYMBOL_INFO);
775 BOOL WINAPI SymGetSymNext(HANDLE, PIMAGEHLP_SYMBOL);
776 BOOL WINAPI SymGetSymPrev(HANDLE, PIMAGEHLP_SYMBOL);
777 BOOL WINAPI SymEnumSymbols(HANDLE, ULONG64, PCSTR, PSYM_ENUMERATESYMBOLS_CALLBACK,
779 typedef BOOL (CALLBACK *PSYM_ENUMSYMBOLS_CALLBACK)(PSTR, DWORD, ULONG, PVOID);
780 BOOL WINAPI SymEnumerateSymbols(HANDLE, DWORD, PSYM_ENUMSYMBOLS_CALLBACK, PVOID);
781 typedef BOOL (CALLBACK *PSYMBOL_REGISTERED_CALLBACK)(HANDLE, ULONG, PVOID, PVOID);
782 BOOL WINAPI SymRegisterCallback(HANDLE, PSYMBOL_REGISTERED_CALLBACK, PVOID);
783 typedef BOOL (CALLBACK *PSYMBOL_REGISTERED_CALLBACK64)(HANDLE, ULONG, ULONG64, ULONG64);
784 BOOL WINAPI SymRegisterCallback64(HANDLE, PSYMBOL_REGISTERED_CALLBACK64, ULONG64);
785 BOOL WINAPI SymUnDName(PIMAGEHLP_SYMBOL, PSTR, DWORD);
786 DWORD WINAPI UnDecorateSymbolName(LPCSTR, LPSTR, DWORD, DWORD);
788 /*************************
790 *************************/
791 typedef BOOL (CALLBACK *PSYM_ENUMSOURCEFILES_CALLBACK)(PSOURCEFILE, PVOID);
793 BOOL WINAPI SymEnumSourceFiles(HANDLE, ULONG64, LPSTR, PSYM_ENUMSOURCEFILES_CALLBACK,
795 BOOL WINAPI SymGetLineFromAddr(HANDLE, DWORD, PDWORD, PIMAGEHLP_LINE);
796 BOOL WINAPI SymGetLineFromAddr64(HANDLE, DWORD64, PDWORD, PIMAGEHLP_LINE64);
797 BOOL WINAPI SymGetLinePrev(HANDLE, PIMAGEHLP_LINE);
798 BOOL WINAPI SymGetLinePrev64(HANDLE, PIMAGEHLP_LINE64);
799 BOOL WINAPI SymGetLineNext(HANDLE, PIMAGEHLP_LINE);
800 BOOL WINAPI SymGetLineNext64(HANDLE, PIMAGEHLP_LINE64);
802 typedef struct _SRCCODEINFO
807 char Obj[MAX_PATH+1];
808 char FileName[MAX_PATH+1];
811 } SRCCODEINFO, *PSRCCODEINFO;
813 typedef BOOL (CALLBACK* PSYM_ENUMLINES_CALLBACK)(PSRCCODEINFO, PVOID);
814 BOOL WINAPI SymEnumLines(HANDLE, ULONG64, PCSTR, PCSTR, PSYM_ENUMLINES_CALLBACK, PVOID);
816 /*************************
817 * File & image handling *
818 *************************/
819 BOOL WINAPI SymInitialize(HANDLE, PSTR, BOOL);
820 BOOL WINAPI SymCleanup(HANDLE);
822 HANDLE WINAPI FindDebugInfoFile(PSTR, PSTR, PSTR);
823 typedef BOOL (CALLBACK *PFIND_DEBUG_FILE_CALLBACK)(HANDLE, PSTR, PVOID);
824 HANDLE WINAPI FindDebugInfoFileEx(PSTR, PSTR, PSTR, PFIND_DEBUG_FILE_CALLBACK, PVOID);
825 typedef BOOL (CALLBACK *PFINDFILEINPATHCALLBACK)(PSTR, PVOID);
826 BOOL WINAPI SymFindFileInPath(HANDLE, LPSTR, LPSTR, PVOID, DWORD, DWORD, DWORD,
827 LPSTR, PFINDFILEINPATHCALLBACK, PVOID);
828 HANDLE WINAPI FindExecutableImage(PSTR, PSTR, PSTR);
829 typedef BOOL (CALLBACK *PFIND_EXE_FILE_CALLBACK)(HANDLE, PSTR, PVOID);
830 HANDLE WINAPI FindExecutableImageEx(PSTR, PSTR, PSTR, PFIND_EXE_FILE_CALLBACK, PVOID);
831 PIMAGE_NT_HEADERS WINAPI ImageNtHeader(PVOID);
832 PVOID WINAPI ImageDirectoryEntryToDataEx(PVOID, BOOLEAN, USHORT, PULONG,
833 PIMAGE_SECTION_HEADER *);
834 PVOID WINAPI ImageDirectoryEntryToData(PVOID, BOOLEAN, USHORT, PULONG);
835 PIMAGE_SECTION_HEADER WINAPI ImageRvaToSection(PIMAGE_NT_HEADERS, PVOID, ULONG);
836 PVOID WINAPI ImageRvaToVa(PIMAGE_NT_HEADERS, PVOID, ULONG, PIMAGE_SECTION_HEADER*);
837 BOOL WINAPI SymGetSearchPath(HANDLE, PSTR, DWORD);
838 BOOL WINAPI SymSetSearchPath(HANDLE, PSTR);
839 DWORD WINAPI GetTimestampForLoadedLibrary(HMODULE);
840 BOOL WINAPI MakeSureDirectoryPathExists(PCSTR);
841 BOOL WINAPI SearchTreeForFile(PSTR, PSTR, PSTR);
842 typedef BOOL (CALLBACK *PENUMDIRTREE_CALLBACK)(LPCSTR, PVOID);
843 BOOL WINAPI EnumDirTree(HANDLE, PCSTR, PCSTR, LPSTR, PENUMDIRTREE_CALLBACK, void*);
844 BOOL WINAPI SymMatchFileName(LPSTR, LPSTR, LPSTR*, LPSTR*);
846 /*************************
847 * Context management *
848 *************************/
849 BOOL WINAPI SymSetContext(HANDLE, PIMAGEHLP_STACK_FRAME, PIMAGEHLP_CONTEXT);
852 /*************************
854 *************************/
856 typedef struct _KDHELP
859 DWORD ThCallbackStack;
862 DWORD KiCallUserMode;
863 DWORD KeUserCallbackDispatcher;
864 DWORD SystemRangeStart;
867 typedef struct _STACKFRAME
873 PVOID FuncTableEntry;
880 } STACKFRAME, *LPSTACKFRAME;
882 typedef BOOL (CALLBACK *PREAD_PROCESS_MEMORY_ROUTINE)
883 (HANDLE, DWORD, PVOID, DWORD, PDWORD);
884 typedef PVOID (CALLBACK *PFUNCTION_TABLE_ACCESS_ROUTINE)(HANDLE, DWORD);
885 typedef DWORD (CALLBACK *PGET_MODULE_BASE_ROUTINE)(HANDLE, DWORD);
886 typedef DWORD (CALLBACK *PTRANSLATE_ADDRESS_ROUTINE)(HANDLE, HANDLE, LPADDRESS);
887 BOOL WINAPI StackWalk(DWORD, HANDLE, HANDLE, LPSTACKFRAME, PVOID,
888 PREAD_PROCESS_MEMORY_ROUTINE,
889 PFUNCTION_TABLE_ACCESS_ROUTINE,
890 PGET_MODULE_BASE_ROUTINE,
891 PTRANSLATE_ADDRESS_ROUTINE);
893 PVOID WINAPI SymFunctionTableAccess(HANDLE, DWORD);
895 typedef PVOID (CALLBACK *PSYMBOL_FUNCENTRY_CALLBACK)(HANDLE, DWORD, PVOID);
896 typedef PVOID (CALLBACK *PSYMBOL_FUNCENTRY_CALLBACK64)(HANDLE, ULONG64, ULONG64);
898 BOOL WINAPI SymRegisterFunctionEntryCallback(HANDLE, PSYMBOL_FUNCENTRY_CALLBACK, PVOID);
899 BOOL WINAPI SymRegisterFunctionEntryCallback64(HANDLE, PSYMBOL_FUNCENTRY_CALLBACK64, ULONG64);
901 /*************************
902 * Version, global stuff *
903 *************************/
905 typedef struct API_VERSION
911 } API_VERSION, *LPAPI_VERSION;
913 LPAPI_VERSION WINAPI ImagehlpApiVersion(void);
914 LPAPI_VERSION WINAPI ImagehlpApiVersionEx(LPAPI_VERSION);
916 typedef struct _IMAGE_DEBUG_INFORMATION
920 PVOID ReservedMappedBase;
921 USHORT ReservedMachine;
922 USHORT ReservedCharacteristics;
923 DWORD ReservedCheckSum;
926 DWORD ReservedNumberOfSections;
927 PIMAGE_SECTION_HEADER ReservedSections;
928 DWORD ReservedExportedNamesSize;
929 PSTR ReservedExportedNames;
930 DWORD ReservedNumberOfFunctionTableEntries;
931 PIMAGE_FUNCTION_ENTRY ReservedFunctionTableEntries;
932 DWORD ReservedLowestFunctionStartingAddress;
933 DWORD ReservedHighestFunctionEndingAddress;
934 DWORD ReservedNumberOfFpoTableEntries;
935 PFPO_DATA ReservedFpoTableEntries;
936 DWORD SizeOfCoffSymbols;
937 PIMAGE_COFF_SYMBOLS_HEADER CoffSymbols;
938 DWORD ReservedSizeOfCodeViewSymbols;
939 PVOID ReservedCodeViewSymbols;
942 PSTR ReservedDebugFilePath;
943 DWORD ReservedTimeDateStamp;
944 BOOL ReservedRomImage;
945 PIMAGE_DEBUG_DIRECTORY ReservedDebugDirectory;
946 DWORD ReservedNumberOfDebugDirectories;
947 DWORD ReservedOriginalFunctionTableBaseAddress;
949 } IMAGE_DEBUG_INFORMATION, *PIMAGE_DEBUG_INFORMATION;
952 PIMAGE_DEBUG_INFORMATION WINAPI MapDebugInformation(HANDLE, PSTR, PSTR, DWORD);
954 BOOL WINAPI UnmapDebugInformation(PIMAGE_DEBUG_INFORMATION);
956 DWORD WINAPI SymGetOptions(void);
957 DWORD WINAPI SymSetOptions(DWORD);
959 BOOL WINAPI SymSetParentWindow(HWND hwnd);
961 /* Symbol server bits */
962 typedef BOOL (WINAPI* PSYMBOLSERVERPROC)(LPCSTR, LPCSTR, PVOID, DWORD, DWORD, LPSTR);
963 typedef BOOL (WINAPI* PSYMBOLSERVEROPENPROC)(void);
964 typedef BOOL (WINAPI* PSYMBOLSERVERCLOSEPROC)(void);
965 typedef BOOL (WINAPI* PSYMBOLSERVERSETOPTIONSPROC)(UINT_PTR, ULONG64);
966 typedef BOOL (CALLBACK* PSYMBOLSERVERCALLBACKPROC)(UINT_PTR, ULONG64, ULONG64);
967 typedef UINT_PTR (WINAPI* PSYMBOLSERVERGETOPTIONSPROC)(void);
968 typedef BOOL (WINAPI* PSYMBOLSERVERPINGPROC)(LPCSTR);
970 #define SSRVOPT_CALLBACK 0x0001
971 #define SSRVOPT_DWORD 0x0002
972 #define SSRVOPT_DWORDPTR 0x0004
973 #define SSRVOPT_GUIDPTR 0x0008
974 #define SSRVOPT_OLDGUIDPTR 0x0010
975 #define SSRVOPT_UNATTENDED 0x0020
976 #define SSRVOPT_NOCOPY 0x0040
977 #define SSRVOPT_PARENTWIN 0x0080
978 #define SSRVOPT_PARAMTYPE 0x0100
979 #define SSRVOPT_SECURE 0x0200
980 #define SSRVOPT_TRACE 0x0400
981 #define SSRVOPT_SETCONTEXT 0x0800
982 #define SSRVOPT_PROXY 0x1000
983 #define SSRVOPT_DOWNSTREAM_STORE 0x2000
984 #define SSRVOPT_RESET ((ULONG_PTR)-1)
986 #define SSRVACTION_TRACE 1
987 #define SSRVACTION_QUERYCANCEL 2
988 #define SSRVACTION_EVENT 3
992 #endif /* defined(__cplusplus) */
994 #endif /* __WINE_DBGHELP_H */