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
89 typedef struct _IMAGEHLP_SYMBOL
97 } IMAGEHLP_SYMBOL
, *PIMAGEHLP_SYMBOL
;
99 typedef struct _IMAGEHLP_MODULE
110 CHAR LoadedImageName
[256];
111 } IMAGEHLP_MODULE
, *PIMAGEHLP_MODULE
;
113 typedef struct _IMAGEHLP_MODULEW
{
121 WCHAR ModuleName
[32];
122 WCHAR ImageName
[256];
123 WCHAR LoadedImageName
[256];
124 } IMAGEHLP_MODULEW
, *PIMAGEHLP_MODULEW
;
126 typedef struct _IMAGEHLP_LINE
133 } IMAGEHLP_LINE
, *PIMAGEHLP_LINE
;
135 typedef struct _SOURCEFILE
139 } SOURCEFILE
, *PSOURCEFILE
;
141 #define CBA_DEFERRED_SYMBOL_LOAD_START 0x00000001
142 #define CBA_DEFERRED_SYMBOL_LOAD_COMPLETE 0x00000002
143 #define CBA_DEFERRED_SYMBOL_LOAD_FAILURE 0x00000003
144 #define CBA_SYMBOLS_UNLOADED 0x00000004
145 #define CBA_DUPLICATE_SYMBOL 0x00000005
146 #define CBA_READ_MEMORY 0x00000006
147 #define CBA_DEFERRED_SYMBOL_LOAD_CANCEL 0x00000007
148 #define CBA_SET_OPTIONS 0x00000008
149 #define CBA_EVENT 0x00000010
150 #define CBA_DEBUG_INFO 0x10000000
152 typedef struct _IMAGEHLP_CBA_READ_MEMORY
158 } IMAGEHLP_CBA_READ_MEMORY
, *PIMAGEHLP_CBA_READ_MEMORY
;
168 typedef struct _IMAGEHLP_CBA_EVENT
174 } IMAGEHLP_CBA_EVENT
, *PIMAGEHLP_CBA_EVENT
;
176 typedef struct _IMAGEHLP_DEFERRED_SYMBOL_LOAD
182 CHAR FileName
[MAX_PATH
];
184 } IMAGEHLP_DEFERRED_SYMBOL_LOAD
, *PIMAGEHLP_DEFERRED_SYMBOL_LOAD
;
186 typedef struct _IMAGEHLP_DUPLICATE_SYMBOL
190 PIMAGEHLP_SYMBOL Symbol
;
191 DWORD SelectedSymbol
;
192 } IMAGEHLP_DUPLICATE_SYMBOL
, *PIMAGEHLP_DUPLICATE_SYMBOL
;
194 #define SYMOPT_CASE_INSENSITIVE 0x00000001
195 #define SYMOPT_UNDNAME 0x00000002
196 #define SYMOPT_DEFERRED_LOADS 0x00000004
197 #define SYMOPT_NO_CPP 0x00000008
198 #define SYMOPT_LOAD_LINES 0x00000010
199 #define SYMOPT_OMAP_FIND_NEAREST 0x00000020
200 #define SYMOPT_LOAD_ANYTHING 0x00000040
201 #define SYMOPT_IGNORE_CVREC 0x00000080
202 #define SYMOPT_NO_UNQUALIFIED_LOADS 0x00000100
203 #define SYMOPT_FAIL_CRITICAL_ERRORS 0x00000200
204 #define SYMOPT_EXACT_SYMBOLS 0x00000400
205 #define SYMOPT_WILD_UNDERSCORE 0x00000800
206 #define SYMOPT_USE_DEFAULTS 0x00001000
207 #define SYMOPT_INCLUDE_32BIT_MODULES 0x00002000
208 #define SYMOPT_PUBLICS_ONLY 0x00004000
209 #define SYMOPT_NO_PUBLICS 0x00008000
210 #define SYMOPT_AUTO_PUBLICS 0x00010000
211 #define SYMOPT_NO_IMAGE_SEARCH 0x00020000
212 #define SYMOPT_SECURE 0x00040000
213 #define SYMOPT_NO_PROMPTS 0x00080000
215 #define SYMOPT_DEBUG 0x80000000
217 typedef struct _IMAGEHLP_STACK_FRAME
219 ULONG InstructionOffset
;
223 ULONG BackingStoreOffset
;
224 ULONG FuncTableEntry
;
229 } IMAGEHLP_STACK_FRAME
, *PIMAGEHLP_STACK_FRAME
;
231 typedef VOID IMAGEHLP_CONTEXT
, *PIMAGEHLP_CONTEXT
;
233 #define DBHHEADER_DEBUGDIRS 0x1
234 typedef struct _DBGHELP_MODLOAD_DATA
241 } MODLOAD_DATA
, *PMODLOAD_DATA
;
243 /*************************
245 *************************/
249 #define MINIDUMP_SIGNATURE 0x4D444D50 /* 'PMDM' */
250 #define MINIDUMP_VERSION (42899)
253 typedef ULONG64 RVA64
;
255 typedef enum _MINIDUMP_TYPE
257 MiniDumpNormal
= 0x0000,
258 MiniDumpWithDataSegs
= 0x0001,
259 MiniDumpWithFullMemory
= 0x0002,
260 MiniDumpWithHandleData
= 0x0004,
261 MiniDumpFilterMemory
= 0x0008,
262 MiniDumpScanMemory
= 0x0010
265 typedef enum _MINIDUMP_CALLBACK_TYPE
270 IncludeThreadCallback
,
271 IncludeModuleCallback
,
272 } MINIDUMP_CALLBACK_TYPE
;
274 typedef struct _MINIDUMP_THREAD_CALLBACK
282 } MINIDUMP_THREAD_CALLBACK
, *PMINIDUMP_THREAD_CALLBACK
;
284 typedef struct _MINIDUMP_THREAD_EX_CALLBACK
292 ULONGLONG BackingStoreBase
;
293 ULONGLONG BackingStoreEnd
;
294 } MINIDUMP_THREAD_EX_CALLBACK
, *PMINIDUMP_THREAD_EX_CALLBACK
;
296 typedef struct _MINIDUMP_INCLUDE_THREAD_CALLBACK
299 } MINIDUMP_INCLUDE_THREAD_CALLBACK
, *PMINIDUMP_INCLUDE_THREAD_CALLBACK
;
301 typedef enum _THREAD_WRITE_FLAGS
303 ThreadWriteThread
= 0x0001,
304 ThreadWriteStack
= 0x0002,
305 ThreadWriteContext
= 0x0004,
306 ThreadWriteBackingStore
= 0x0008,
307 ThreadWriteInstructionWindow
= 0x0010
308 } THREAD_WRITE_FLAGS
;
310 typedef struct _MINIDUMP_MODULE_CALLBACK
313 ULONGLONG BaseOfImage
;
317 VS_FIXEDFILEINFO VersionInfo
;
319 ULONG SizeOfCvRecord
;
321 ULONG SizeOfMiscRecord
;
322 } MINIDUMP_MODULE_CALLBACK
, *PMINIDUMP_MODULE_CALLBACK
;
324 typedef struct _MINIDUMP_INCLUDE_MODULE_CALLBACK
327 } MINIDUMP_INCLUDE_MODULE_CALLBACK
, *PMINIDUMP_INCLUDE_MODULE_CALLBACK
;
329 typedef enum _MODULE_WRITE_FLAGS
331 ModuleWriteModule
= 0x0001,
332 ModuleWriteDataSeg
= 0x0002,
333 ModuleWriteMiscRecord
= 0x0004,
334 ModuleWriteCvRecord
= 0x0008,
335 ModuleReferencedByMemory
= 0x0010
336 } MODULE_WRITE_FLAGS
;
338 typedef struct _MINIDUMP_CALLBACK_INPUT
341 HANDLE ProcessHandle
;
345 MINIDUMP_THREAD_CALLBACK Thread
;
346 MINIDUMP_THREAD_EX_CALLBACK ThreadEx
;
347 MINIDUMP_MODULE_CALLBACK Module
;
348 MINIDUMP_INCLUDE_THREAD_CALLBACK IncludeThread
;
349 MINIDUMP_INCLUDE_MODULE_CALLBACK IncludeModule
;
351 } MINIDUMP_CALLBACK_INPUT
, *PMINIDUMP_CALLBACK_INPUT
;
353 typedef struct _MINIDUMP_CALLBACK_OUTPUT
357 ULONG ModuleWriteFlags
;
358 ULONG ThreadWriteFlags
;
360 } MINIDUMP_CALLBACK_OUTPUT
, *PMINIDUMP_CALLBACK_OUTPUT
;
362 typedef BOOL (WINAPI
* MINIDUMP_CALLBACK_ROUTINE
)(PVOID CallbackParam
,
363 const PMINIDUMP_CALLBACK_INPUT CallbackInput
,
364 PMINIDUMP_CALLBACK_OUTPUT CallbackOutput
);
366 typedef struct _MINIDUMP_CALLBACK_INFORMATION
368 MINIDUMP_CALLBACK_ROUTINE CallbackRoutine
;
370 } MINIDUMP_CALLBACK_INFORMATION
, *PMINIDUMP_CALLBACK_INFORMATION
;
372 typedef struct _MINIDUMP_LOCATION_DESCRIPTOR
376 } MINIDUMP_LOCATION_DESCRIPTOR
;
378 typedef struct _MINIDUMP_DIRECTORY
381 MINIDUMP_LOCATION_DESCRIPTOR Location
;
382 } MINIDUMP_DIRECTORY
, *PMINIDUMP_DIRECTORY
;
384 typedef struct _MINIDUMP_EXCEPTION
387 ULONG ExceptionFlags
;
388 ULONGLONG ExceptionRecord
;
389 ULONGLONG ExceptionAddress
;
390 ULONG NumberParameters
;
391 ULONG __unusedAlignment
;
392 ULONGLONG ExceptionInformation
[EXCEPTION_MAXIMUM_PARAMETERS
];
393 } MINIDUMP_EXCEPTION
, *PMINIDUMP_EXCEPTION
;
395 typedef struct _MINIDUMP_EXCEPTION_INFORMATION
398 PEXCEPTION_POINTERS ExceptionPointers
;
400 } MINIDUMP_EXCEPTION_INFORMATION
, *PMINIDUMP_EXCEPTION_INFORMATION
;
402 typedef struct MINIDUMP_EXCEPTION_STREAM
406 MINIDUMP_EXCEPTION ExceptionRecord
;
407 MINIDUMP_LOCATION_DESCRIPTOR ThreadContext
;
408 } MINIDUMP_EXCEPTION_STREAM
, *PMINIDUMP_EXCEPTION_STREAM
;
410 typedef struct _MINIDUMP_HEADER
414 DWORD NumberOfStreams
;
415 RVA StreamDirectoryRva
;
423 } MINIDUMP_HEADER
, *PMINIDUMP_HEADER
;
425 typedef struct _MINIDUMP_MEMORY_DESCRIPTOR
427 ULONGLONG StartOfMemoryRange
;
428 MINIDUMP_LOCATION_DESCRIPTOR Memory
;
429 } MINIDUMP_MEMORY_DESCRIPTOR
, *PMINIDUMP_MEMORY_DESCRIPTOR
;
431 typedef struct _MINIDUMP_MODULE
433 ULONGLONG BaseOfImage
;
438 VS_FIXEDFILEINFO VersionInfo
;
439 MINIDUMP_LOCATION_DESCRIPTOR CvRecord
;
440 MINIDUMP_LOCATION_DESCRIPTOR MiscRecord
;
443 } MINIDUMP_MODULE
, *PMINIDUMP_MODULE
;
445 typedef struct _MINIDUMP_MODULE_LIST
447 ULONG NumberOfModules
;
448 MINIDUMP_MODULE Modules
[1]; /* FIXME: 0-sized array not supported */
449 } MINIDUMP_MODULE_LIST
, *PMINIDUMP_MODULE_LIST
;
451 typedef struct _MINIDUMP_USER_STREAM
456 } MINIDUMP_USER_STREAM
, *PMINIDUMP_USER_STREAM
;
458 typedef struct _MINIDUMP_USER_STREAM_INFORMATION
460 ULONG UserStreamCount
;
461 PMINIDUMP_USER_STREAM UserStreamArray
;
462 } MINIDUMP_USER_STREAM_INFORMATION
, *PMINIDUMP_USER_STREAM_INFORMATION
;
464 typedef enum _MINIDUMP_STREAM_TYPE
469 ThreadListStream
= 3,
470 ModuleListStream
= 4,
471 MemoryListStream
= 5,
473 SystemInfoStream
= 7,
474 ThreadExListStream
= 8,
475 Memory64ListStream
= 9,
478 HandleDataStream
= 12,
479 FunctionTableStream
= 13,
481 LastReservedStream
= 0xffff
482 } MINIDUMP_STREAM_TYPE
;
484 typedef struct _MINIDUMP_SYSTEM_INFO
486 USHORT ProcessorArchitecture
;
487 USHORT ProcessorLevel
;
488 USHORT ProcessorRevision
;
498 union _CPU_INFORMATION
503 ULONG VersionInformation
;
504 ULONG FeatureInformation
;
505 ULONG AMDExtendedCpuFeatures
;
509 ULONGLONG ProcessorFeatures
[2];
513 } MINIDUMP_SYSTEM_INFO
, *PMINIDUMP_SYSTEM_INFO
;
515 typedef struct _MINIDUMP_THREAD
522 MINIDUMP_MEMORY_DESCRIPTOR Stack
;
523 MINIDUMP_LOCATION_DESCRIPTOR ThreadContext
;
524 } MINIDUMP_THREAD
, *PMINIDUMP_THREAD
;
526 typedef struct _MINIDUMP_THREAD_LIST
528 ULONG NumberOfThreads
;
529 MINIDUMP_THREAD Threads
[1]; /* FIXME: no support of 0 sized array */
530 } MINIDUMP_THREAD_LIST
, *PMINIDUMP_THREAD_LIST
;
532 /*************************
534 *************************/
535 typedef BOOL (CALLBACK
*PENUMLOADED_MODULES_CALLBACK
)(PSTR ModuleName
, DWORD ModuleBase
,
536 ULONG ModuleSize
, PVOID UserContext
);
537 extern BOOL WINAPI
EnumerateLoadedModules(HANDLE hProcess
,
538 PENUMLOADED_MODULES_CALLBACK EnumLoadedModulesCallback
,
540 typedef BOOL (CALLBACK
*PSYM_ENUMMODULES_CALLBACK
)(PSTR ModuleName
, DWORD BaseOfDll
,
542 extern BOOL WINAPI
SymEnumerateModules(HANDLE hProcess
,
543 PSYM_ENUMMODULES_CALLBACK EnumModulesCallback
,
545 extern BOOL WINAPI
SymGetModuleInfo(HANDLE hProcess
, DWORD dwAddr
,
546 PIMAGEHLP_MODULE ModuleInfo
);
547 extern BOOL WINAPI
SymGetModuleInfoW(HANDLE hProcess
, DWORD dwAddr
,
548 PIMAGEHLP_MODULEW ModuleInfo
);
549 extern DWORD WINAPI
SymGetModuleBase(HANDLE hProcess
, DWORD dwAddr
);
550 extern DWORD WINAPI
SymLoadModule(HANDLE hProcess
, HANDLE hFile
, PSTR ImageName
,
551 PSTR ModuleName
, DWORD BaseOfDll
, DWORD SizeOfDll
);
552 extern DWORD WINAPI
SymLoadModuleEx(HANDLE hProcess
, HANDLE hFile
, PSTR ImageName
,
553 PSTR ModuleName
, DWORD BaseOfDll
, DWORD DllSize
,
554 PMODLOAD_DATA Data
, DWORD Flags
);
555 extern BOOL WINAPI
SymUnloadModule(HANDLE hProcess
, DWORD BaseOfDll
);
557 /*************************
559 *************************/
561 #define IMAGEHLP_SYMBOL_INFO_VALUEPRESENT 1
562 #define IMAGEHLP_SYMBOL_INFO_REGISTER SYMF_REGISTER /* 0x08 */
563 #define IMAGEHLP_SYMBOL_INFO_REGRELATIVE SYMF_REGREL /* 0x10 */
564 #define IMAGEHLP_SYMBOL_INFO_FRAMERELATIVE SYMF_FRAMEREL /* 0x20 */
565 #define IMAGEHLP_SYMBOL_INFO_PARAMETER SYMF_PARAMETER /* 0x40 */
566 #define IMAGEHLP_SYMBOL_INFO_LOCAL SYMF_LOCAL /* 0x80 */
567 #define IMAGEHLP_SYMBOL_INFO_CONSTANT SYMF_CONSTANT /* 0x100 */
568 #define IMAGEHLP_SYMBOL_FUNCTION SYMF_FUNCTION /* 0x800 */
570 #define SYMFLAG_VALUEPRESENT 0x00000001
571 #define SYMFLAG_REGISTER 0x00000008
572 #define SYMFLAG_REGREL 0x00000010
573 #define SYMFLAG_FRAMEREL 0x00000020
574 #define SYMFLAG_PARAMETER 0x00000040
575 #define SYMFLAG_LOCAL 0x00000080
576 #define SYMFLAG_CONSTANT 0x00000100
577 #define SYMFLAG_EXPORT 0x00000200
578 #define SYMFLAG_FORWARDER 0x00000400
579 #define SYMFLAG_FUNCTION 0x00000800
580 #define SYMFLAG_VIRTUAL 0x00001000
581 #define SYMFLAG_THUNK 0x00002000
582 #define SYMFLAG_TLSREL 0x00004000
584 typedef struct _SYMBOL_INFO
601 } SYMBOL_INFO
, *PSYMBOL_INFO
;
603 typedef enum _IMAGEHLP_SYMBOL_TYPE_INFO
611 TI_GET_ARRAYINDEXTYPEID
,
614 TI_GET_ADDRESSOFFSET
,
618 TI_GET_CHILDRENCOUNT
,
620 TI_GET_VIRTUALBASECLASS
,
621 TI_GET_VIRTUALTABLESHAPEID
,
622 TI_GET_VIRTUALBASEPOINTEROFFSET
,
623 TI_GET_CLASSPARENTID
,
626 TI_GET_LEXICALPARENT
,
631 TI_GET_CALLING_CONVENTION
,
632 } IMAGEHLP_SYMBOL_TYPE_INFO
;
634 typedef struct _TI_FINDCHILDREN_PARAMS
639 } TI_FINDCHILDREN_PARAMS
;
641 #define UNDNAME_COMPLETE (0x0000)
642 #define UNDNAME_NO_LEADING_UNDERSCORES (0x0001)
643 #define UNDNAME_NO_MS_KEYWORDS (0x0002)
644 #define UNDNAME_NO_FUNCTION_RETURNS (0x0004)
645 #define UNDNAME_NO_ALLOCATION_MODEL (0x0008)
646 #define UNDNAME_NO_ALLOCATION_LANGUAGE (0x0010)
647 #define UNDNAME_NO_MS_THISTYPE (0x0020)
648 #define UNDNAME_NO_CV_THISTYPE (0x0040)
649 #define UNDNAME_NO_THISTYPE (0x0060)
650 #define UNDNAME_NO_ACCESS_SPECIFIERS (0x0080)
651 #define UNDNAME_NO_THROW_SIGNATURES (0x0100)
652 #define UNDNAME_NO_MEMBER_TYPE (0x0200)
653 #define UNDNAME_NO_RETURN_UDT_MODEL (0x0400)
654 #define UNDNAME_32_BIT_DECODE (0x0800)
655 #define UNDNAME_NAME_ONLY (0x1000)
656 #define UNDNAME_NO_ARGUMENTS (0x2000)
657 #define UNDNAME_NO_SPECIAL_SYMS (0x4000)
659 BOOL WINAPI
SymGetTypeInfo(HANDLE hProcess
, DWORD ModBase
, ULONG TypeId
,
660 IMAGEHLP_SYMBOL_TYPE_INFO GetType
, PVOID
);
661 typedef BOOL (CALLBACK
*PSYM_ENUMERATESYMBOLS_CALLBACK
)(PSYMBOL_INFO pSymInfo
,
662 ULONG SymbolSize
, PVOID UserContext
);
663 BOOL WINAPI
SymEnumTypes(HANDLE hProcess
, DWORD BaseOfDll
,
664 PSYM_ENUMERATESYMBOLS_CALLBACK EnumSymbolsCallback
,
666 BOOL WINAPI
SymFromAddr(HANDLE hProcess
, DWORD addr
, DWORD
* displacement
,
667 SYMBOL_INFO
* sym_info
);
668 BOOL WINAPI
SymFromName(HANDLE hProcess
, LPSTR Name
, PSYMBOL_INFO Symbol
);
669 BOOL WINAPI
SymGetTypeFromName(HANDLE hProcess
, DWORD BaseOfDll
, LPSTR Name
,
670 PSYMBOL_INFO Symbol
);
671 BOOL WINAPI
SymEnumSymbols(HANDLE hProcess
, ULONG BaseOfDll
, PCSTR Mask
,
672 PSYM_ENUMERATESYMBOLS_CALLBACK EnumSymbolsCallback
,
674 typedef BOOL (CALLBACK
*PSYM_ENUMSYMBOLS_CALLBACK
)(PSTR SymbolName
, DWORD SymbolAddress
,
675 ULONG SymbolSize
, PVOID UserContext
);
676 BOOL WINAPI
SymEnumerateSymbols(HANDLE hProcess
, DWORD BaseOfDll
,
677 PSYM_ENUMSYMBOLS_CALLBACK EnumSymbolsCallback
,
679 typedef BOOL (CALLBACK
*PSYMBOL_REGISTERED_CALLBACK
)(HANDLE hProcess
, ULONG ActionCode
,
680 PVOID CallbackData
, PVOID UserContext
);
681 BOOL WINAPI
SymRegisterCallback(HANDLE hProcess
,
682 PSYMBOL_REGISTERED_CALLBACK CallbackFunction
,
684 DWORD WINAPI
UnDecorateSymbolName(LPCSTR DecoratedName
, LPSTR UnDecoratedName
,
685 DWORD UndecoratedLength
, DWORD Flags
);
687 /*************************
689 *************************/
690 typedef BOOL (CALLBACK
*PSYM_ENUMSOURCFILES_CALLBACK
)(PSOURCEFILE pSourceFile
,
693 BOOL WINAPI
SymEnumSourceFiles(HANDLE hProcess
, ULONG ModBase
, LPSTR Mask
,
694 PSYM_ENUMSOURCFILES_CALLBACK cbSrcFiles
,
696 BOOL WINAPI
SymGetLineFromAddr(HANDLE hProcess
, DWORD dwAddr
,
697 PDWORD pdwDisplacement
, PIMAGEHLP_LINE Line
);
698 BOOL WINAPI
SymGetLinePrev(HANDLE hProcess
, PIMAGEHLP_LINE Line
);
699 BOOL WINAPI
SymGetLineNext(HANDLE hProcess
, PIMAGEHLP_LINE Line
);
701 /*************************
702 * File & image handling *
703 *************************/
704 BOOL WINAPI
SymInitialize(HANDLE hProcess
, PSTR UserSearchPath
, BOOL fInvadeProcess
);
705 BOOL WINAPI
SymCleanup(HANDLE hProcess
);
707 HANDLE WINAPI
FindDebugInfoFile(PSTR FileName
, PSTR SymbolPath
, PSTR DebugFilePath
);
708 typedef BOOL (CALLBACK
*PFIND_DEBUG_FILE_CALLBACK
)(HANDLE FileHandle
, PSTR FileName
,
710 HANDLE WINAPI
FindDebugInfoFileEx(PSTR FileName
, PSTR SymbolPath
, PSTR DebugFilePath
,
711 PFIND_DEBUG_FILE_CALLBACK Callback
, PVOID CallerData
);
712 typedef BOOL (CALLBACK
*PFINDFILEINPATHCALLBACK
)(PSTR filename
, PVOID context
);
714 BOOL WINAPI
SymFindFileInPath(HANDLE hProcess
, LPSTR searchPath
, LPSTR FileName
,
715 PVOID id
, DWORD two
, DWORD three
, DWORD flags
,
716 LPSTR FilePath
, PFINDFILEINPATHCALLBACK callback
,
718 HANDLE WINAPI
FindExecutableImage(PSTR FileName
, PSTR SymbolPath
, PSTR ImageFilePath
);
719 typedef BOOL (CALLBACK
*PFIND_EXE_FILE_CALLBACK
)(HANDLE FileHandle
, PSTR FileName
,
721 HANDLE WINAPI
FindExecutableImageEx(PSTR FileName
, PSTR SymbolPath
, PSTR ImageFilePath
,
722 PFIND_EXE_FILE_CALLBACK Callback
, PVOID CallerData
);
723 PIMAGE_NT_HEADERS WINAPI
ImageNtHeader(PVOID Base
);
725 PVOID WINAPI
ImageDirectoryEntryToDataEx(PVOID Base
, BOOLEAN MappedAsImage
,
726 USHORT DirectoryEntry
, PULONG Size
,
727 PIMAGE_SECTION_HEADER
*FoundHeader
);
728 PVOID WINAPI
ImageDirectoryEntryToData(PVOID Base
, BOOLEAN MappedAsImage
,
729 USHORT DirectoryEntry
, PULONG Size
);
730 PIMAGE_SECTION_HEADER WINAPI
ImageRvaToSection(PIMAGE_NT_HEADERS NtHeaders
,
731 PVOID Base
, ULONG Rva
);
732 PVOID WINAPI
ImageRvaToVa(PIMAGE_NT_HEADERS NtHeaders
, PVOID Base
,
733 ULONG Rva
, OUT PIMAGE_SECTION_HEADER
*LastRvaSection
);
735 /*************************
736 * Context management *
737 *************************/
738 BOOL WINAPI
SymSetContext(HANDLE hProcess
, PIMAGEHLP_STACK_FRAME StackFrame
,
739 PIMAGEHLP_CONTEXT Context
);
742 /*************************
744 *************************/
746 typedef struct _KDHELP
749 DWORD ThCallbackStack
;
752 DWORD KiCallUserMode
;
753 DWORD KeUserCallbackDispatcher
;
754 DWORD SystemRangeStart
;
757 typedef struct _STACKFRAME
763 PVOID FuncTableEntry
;
769 } STACKFRAME
, *LPSTACKFRAME
;
771 typedef BOOL (CALLBACK
*PREAD_PROCESS_MEMORY_ROUTINE
)
772 (HANDLE hProcess
, LPCVOID lpBaseAddress
, PVOID lpBuffer
,
773 DWORD nSize
, PDWORD lpNumberOfBytesRead
);
775 typedef PVOID (CALLBACK
*PFUNCTION_TABLE_ACCESS_ROUTINE
)
776 (HANDLE hProcess
, DWORD AddrBase
);
778 typedef DWORD (CALLBACK
*PGET_MODULE_BASE_ROUTINE
)
779 (HANDLE hProcess
, DWORD ReturnAddress
);
781 typedef DWORD (CALLBACK
*PTRANSLATE_ADDRESS_ROUTINE
)
782 (HANDLE hProcess
, HANDLE hThread
, LPADDRESS lpaddr
);
784 BOOL WINAPI
StackWalk(DWORD MachineType
, HANDLE hProcess
, HANDLE hThread
,
785 LPSTACKFRAME StackFrame
, PVOID ContextRecord
,
786 PREAD_PROCESS_MEMORY_ROUTINE ReadMemoryRoutine
,
787 PFUNCTION_TABLE_ACCESS_ROUTINE FunctionTableAccessRoutine
,
788 PGET_MODULE_BASE_ROUTINE GetModuleBaseRoutine
,
789 PTRANSLATE_ADDRESS_ROUTINE TranslateAddress
);
791 PVOID WINAPI
SymFunctionTableAccess(HANDLE hProcess
, DWORD AddrBase
);
793 /*************************
794 * Version, global stuff *
795 *************************/
797 typedef struct API_VERSION
803 } API_VERSION
, *LPAPI_VERSION
;
805 LPAPI_VERSION WINAPI
ImagehlpApiVersion(void);
806 LPAPI_VERSION WINAPI
ImagehlpApiVersionEx(LPAPI_VERSION AppVersion
);
808 typedef struct _IMAGE_DEBUG_INFORMATION
812 PVOID ReservedMappedBase
;
813 USHORT ReservedMachine
;
814 USHORT ReservedCharacteristics
;
815 DWORD ReservedCheckSum
;
818 DWORD ReservedNumberOfSections
;
819 PIMAGE_SECTION_HEADER ReservedSections
;
820 DWORD ReservedExportedNamesSize
;
821 PSTR ReservedExportedNames
;
822 DWORD ReservedNumberOfFunctionTableEntries
;
823 PIMAGE_FUNCTION_ENTRY ReservedFunctionTableEntries
;
824 DWORD ReservedLowestFunctionStartingAddress
;
825 DWORD ReservedHighestFunctionEndingAddress
;
826 DWORD ReservedNumberOfFpoTableEntries
;
827 PFPO_DATA ReservedFpoTableEntries
;
828 DWORD SizeOfCoffSymbols
;
829 PIMAGE_COFF_SYMBOLS_HEADER CoffSymbols
;
830 DWORD ReservedSizeOfCodeViewSymbols
;
831 PVOID ReservedCodeViewSymbols
;
834 PSTR ReservedDebugFilePath
;
835 DWORD ReservedTimeDateStamp
;
836 BOOL ReservedRomImage
;
837 PIMAGE_DEBUG_DIRECTORY ReservedDebugDirectory
;
838 DWORD ReservedNumberOfDebugDirectories
;
839 DWORD ReservedOriginalFunctionTableBaseAddress
;
841 } IMAGE_DEBUG_INFORMATION
, *PIMAGE_DEBUG_INFORMATION
;
844 PIMAGE_DEBUG_INFORMATION WINAPI
MapDebugInformation(HANDLE FileHandle
, PSTR FileName
,
845 PSTR SymbolPath
, DWORD ImageBase
);
847 BOOL WINAPI
UnmapDebugInformation(PIMAGE_DEBUG_INFORMATION DebugInfo
);
849 DWORD WINAPI
SymGetOptions(void);
850 DWORD WINAPI
SymSetOptions(DWORD
);
854 #endif /* defined(__cplusplus) */
856 #endif /* __WINE_DBGHELP_H */