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 {
124 WCHAR ModuleName[32];
125 WCHAR ImageName[256];
126 WCHAR LoadedImageName[256];
127 } IMAGEHLP_MODULEW, *PIMAGEHLP_MODULEW;
129 typedef struct _IMAGEHLP_LINE
136 } IMAGEHLP_LINE, *PIMAGEHLP_LINE;
138 typedef struct _SOURCEFILE
142 } SOURCEFILE, *PSOURCEFILE;
144 #define CBA_DEFERRED_SYMBOL_LOAD_START 0x00000001
145 #define CBA_DEFERRED_SYMBOL_LOAD_COMPLETE 0x00000002
146 #define CBA_DEFERRED_SYMBOL_LOAD_FAILURE 0x00000003
147 #define CBA_SYMBOLS_UNLOADED 0x00000004
148 #define CBA_DUPLICATE_SYMBOL 0x00000005
149 #define CBA_READ_MEMORY 0x00000006
150 #define CBA_DEFERRED_SYMBOL_LOAD_CANCEL 0x00000007
151 #define CBA_SET_OPTIONS 0x00000008
152 #define CBA_EVENT 0x00000010
153 #define CBA_DEBUG_INFO 0x10000000
155 typedef struct _IMAGEHLP_CBA_READ_MEMORY
161 } IMAGEHLP_CBA_READ_MEMORY, *PIMAGEHLP_CBA_READ_MEMORY;
171 typedef struct _IMAGEHLP_CBA_EVENT
177 } IMAGEHLP_CBA_EVENT, *PIMAGEHLP_CBA_EVENT;
179 typedef struct _IMAGEHLP_DEFERRED_SYMBOL_LOAD
185 CHAR FileName[MAX_PATH];
187 } IMAGEHLP_DEFERRED_SYMBOL_LOAD, *PIMAGEHLP_DEFERRED_SYMBOL_LOAD;
189 typedef struct _IMAGEHLP_DUPLICATE_SYMBOL
193 PIMAGEHLP_SYMBOL Symbol;
194 DWORD SelectedSymbol;
195 } IMAGEHLP_DUPLICATE_SYMBOL, *PIMAGEHLP_DUPLICATE_SYMBOL;
197 #define SYMOPT_CASE_INSENSITIVE 0x00000001
198 #define SYMOPT_UNDNAME 0x00000002
199 #define SYMOPT_DEFERRED_LOADS 0x00000004
200 #define SYMOPT_NO_CPP 0x00000008
201 #define SYMOPT_LOAD_LINES 0x00000010
202 #define SYMOPT_OMAP_FIND_NEAREST 0x00000020
203 #define SYMOPT_LOAD_ANYTHING 0x00000040
204 #define SYMOPT_IGNORE_CVREC 0x00000080
205 #define SYMOPT_NO_UNQUALIFIED_LOADS 0x00000100
206 #define SYMOPT_FAIL_CRITICAL_ERRORS 0x00000200
207 #define SYMOPT_EXACT_SYMBOLS 0x00000400
208 #define SYMOPT_WILD_UNDERSCORE 0x00000800
209 #define SYMOPT_USE_DEFAULTS 0x00001000
210 #define SYMOPT_INCLUDE_32BIT_MODULES 0x00002000
211 #define SYMOPT_PUBLICS_ONLY 0x00004000
212 #define SYMOPT_NO_PUBLICS 0x00008000
213 #define SYMOPT_AUTO_PUBLICS 0x00010000
214 #define SYMOPT_NO_IMAGE_SEARCH 0x00020000
215 #define SYMOPT_SECURE 0x00040000
216 #define SYMOPT_NO_PROMPTS 0x00080000
218 #define SYMOPT_DEBUG 0x80000000
220 typedef struct _IMAGEHLP_STACK_FRAME
222 ULONG InstructionOffset;
226 ULONG BackingStoreOffset;
227 ULONG FuncTableEntry;
232 } IMAGEHLP_STACK_FRAME, *PIMAGEHLP_STACK_FRAME;
234 typedef VOID IMAGEHLP_CONTEXT, *PIMAGEHLP_CONTEXT;
236 #define DBHHEADER_DEBUGDIRS 0x1
237 typedef struct _DBGHELP_MODLOAD_DATA
244 } MODLOAD_DATA, *PMODLOAD_DATA;
246 /*************************
248 *************************/
252 #define MINIDUMP_SIGNATURE 0x4D444D50 /* 'PMDM' */
253 #define MINIDUMP_VERSION (42899)
256 typedef ULONG64 RVA64;
258 typedef enum _MINIDUMP_TYPE
260 MiniDumpNormal = 0x0000,
261 MiniDumpWithDataSegs = 0x0001,
262 MiniDumpWithFullMemory = 0x0002,
263 MiniDumpWithHandleData = 0x0004,
264 MiniDumpFilterMemory = 0x0008,
265 MiniDumpScanMemory = 0x0010
268 typedef enum _MINIDUMP_CALLBACK_TYPE
273 IncludeThreadCallback,
274 IncludeModuleCallback,
275 } MINIDUMP_CALLBACK_TYPE;
277 typedef struct _MINIDUMP_THREAD_CALLBACK
285 } MINIDUMP_THREAD_CALLBACK, *PMINIDUMP_THREAD_CALLBACK;
287 typedef struct _MINIDUMP_THREAD_EX_CALLBACK
295 ULONGLONG BackingStoreBase;
296 ULONGLONG BackingStoreEnd;
297 } MINIDUMP_THREAD_EX_CALLBACK, *PMINIDUMP_THREAD_EX_CALLBACK;
299 typedef struct _MINIDUMP_INCLUDE_THREAD_CALLBACK
302 } MINIDUMP_INCLUDE_THREAD_CALLBACK, *PMINIDUMP_INCLUDE_THREAD_CALLBACK;
304 typedef enum _THREAD_WRITE_FLAGS
306 ThreadWriteThread = 0x0001,
307 ThreadWriteStack = 0x0002,
308 ThreadWriteContext = 0x0004,
309 ThreadWriteBackingStore = 0x0008,
310 ThreadWriteInstructionWindow = 0x0010
311 } THREAD_WRITE_FLAGS;
313 typedef struct _MINIDUMP_MODULE_CALLBACK
316 ULONGLONG BaseOfImage;
320 VS_FIXEDFILEINFO VersionInfo;
322 ULONG SizeOfCvRecord;
324 ULONG SizeOfMiscRecord;
325 } MINIDUMP_MODULE_CALLBACK, *PMINIDUMP_MODULE_CALLBACK;
327 typedef struct _MINIDUMP_INCLUDE_MODULE_CALLBACK
330 } MINIDUMP_INCLUDE_MODULE_CALLBACK, *PMINIDUMP_INCLUDE_MODULE_CALLBACK;
332 typedef enum _MODULE_WRITE_FLAGS
334 ModuleWriteModule = 0x0001,
335 ModuleWriteDataSeg = 0x0002,
336 ModuleWriteMiscRecord = 0x0004,
337 ModuleWriteCvRecord = 0x0008,
338 ModuleReferencedByMemory = 0x0010
339 } MODULE_WRITE_FLAGS;
341 typedef struct _MINIDUMP_CALLBACK_INPUT
344 HANDLE ProcessHandle;
348 MINIDUMP_THREAD_CALLBACK Thread;
349 MINIDUMP_THREAD_EX_CALLBACK ThreadEx;
350 MINIDUMP_MODULE_CALLBACK Module;
351 MINIDUMP_INCLUDE_THREAD_CALLBACK IncludeThread;
352 MINIDUMP_INCLUDE_MODULE_CALLBACK IncludeModule;
354 } MINIDUMP_CALLBACK_INPUT, *PMINIDUMP_CALLBACK_INPUT;
356 typedef struct _MINIDUMP_CALLBACK_OUTPUT
360 ULONG ModuleWriteFlags;
361 ULONG ThreadWriteFlags;
363 } MINIDUMP_CALLBACK_OUTPUT, *PMINIDUMP_CALLBACK_OUTPUT;
365 typedef BOOL (WINAPI* MINIDUMP_CALLBACK_ROUTINE)(PVOID CallbackParam,
366 const PMINIDUMP_CALLBACK_INPUT CallbackInput,
367 PMINIDUMP_CALLBACK_OUTPUT CallbackOutput);
369 typedef struct _MINIDUMP_CALLBACK_INFORMATION
371 MINIDUMP_CALLBACK_ROUTINE CallbackRoutine;
373 } MINIDUMP_CALLBACK_INFORMATION, *PMINIDUMP_CALLBACK_INFORMATION;
375 typedef struct _MINIDUMP_LOCATION_DESCRIPTOR
379 } MINIDUMP_LOCATION_DESCRIPTOR;
381 typedef struct _MINIDUMP_DIRECTORY
384 MINIDUMP_LOCATION_DESCRIPTOR Location;
385 } MINIDUMP_DIRECTORY, *PMINIDUMP_DIRECTORY;
387 typedef struct _MINIDUMP_EXCEPTION
390 ULONG ExceptionFlags;
391 ULONGLONG ExceptionRecord;
392 ULONGLONG ExceptionAddress;
393 ULONG NumberParameters;
394 ULONG __unusedAlignment;
395 ULONGLONG ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS];
396 } MINIDUMP_EXCEPTION, *PMINIDUMP_EXCEPTION;
398 typedef struct _MINIDUMP_EXCEPTION_INFORMATION
401 PEXCEPTION_POINTERS ExceptionPointers;
403 } MINIDUMP_EXCEPTION_INFORMATION, *PMINIDUMP_EXCEPTION_INFORMATION;
405 typedef struct MINIDUMP_EXCEPTION_STREAM
409 MINIDUMP_EXCEPTION ExceptionRecord;
410 MINIDUMP_LOCATION_DESCRIPTOR ThreadContext;
411 } MINIDUMP_EXCEPTION_STREAM, *PMINIDUMP_EXCEPTION_STREAM;
413 typedef struct _MINIDUMP_HEADER
417 DWORD NumberOfStreams;
418 RVA StreamDirectoryRva;
426 } MINIDUMP_HEADER, *PMINIDUMP_HEADER;
428 typedef struct _MINIDUMP_MEMORY_DESCRIPTOR
430 ULONGLONG StartOfMemoryRange;
431 MINIDUMP_LOCATION_DESCRIPTOR Memory;
432 } MINIDUMP_MEMORY_DESCRIPTOR, *PMINIDUMP_MEMORY_DESCRIPTOR;
434 typedef struct _MINIDUMP_MODULE
436 ULONGLONG BaseOfImage;
441 VS_FIXEDFILEINFO VersionInfo;
442 MINIDUMP_LOCATION_DESCRIPTOR CvRecord;
443 MINIDUMP_LOCATION_DESCRIPTOR MiscRecord;
446 } MINIDUMP_MODULE, *PMINIDUMP_MODULE;
448 typedef struct _MINIDUMP_MODULE_LIST
450 ULONG NumberOfModules;
451 MINIDUMP_MODULE Modules[1]; /* FIXME: 0-sized array not supported */
452 } MINIDUMP_MODULE_LIST, *PMINIDUMP_MODULE_LIST;
454 typedef struct _MINIDUMP_USER_STREAM
459 } MINIDUMP_USER_STREAM, *PMINIDUMP_USER_STREAM;
461 typedef struct _MINIDUMP_USER_STREAM_INFORMATION
463 ULONG UserStreamCount;
464 PMINIDUMP_USER_STREAM UserStreamArray;
465 } MINIDUMP_USER_STREAM_INFORMATION, *PMINIDUMP_USER_STREAM_INFORMATION;
467 typedef enum _MINIDUMP_STREAM_TYPE
472 ThreadListStream = 3,
473 ModuleListStream = 4,
474 MemoryListStream = 5,
476 SystemInfoStream = 7,
477 ThreadExListStream = 8,
478 Memory64ListStream = 9,
481 HandleDataStream = 12,
482 FunctionTableStream = 13,
484 LastReservedStream = 0xffff
485 } MINIDUMP_STREAM_TYPE;
487 typedef struct _MINIDUMP_SYSTEM_INFO
489 USHORT ProcessorArchitecture;
490 USHORT ProcessorLevel;
491 USHORT ProcessorRevision;
501 union _CPU_INFORMATION
506 ULONG VersionInformation;
507 ULONG FeatureInformation;
508 ULONG AMDExtendedCpuFeatures;
512 ULONGLONG ProcessorFeatures[2];
516 } MINIDUMP_SYSTEM_INFO, *PMINIDUMP_SYSTEM_INFO;
518 typedef struct _MINIDUMP_THREAD
525 MINIDUMP_MEMORY_DESCRIPTOR Stack;
526 MINIDUMP_LOCATION_DESCRIPTOR ThreadContext;
527 } MINIDUMP_THREAD, *PMINIDUMP_THREAD;
529 typedef struct _MINIDUMP_THREAD_LIST
531 ULONG NumberOfThreads;
532 MINIDUMP_THREAD Threads[1]; /* FIXME: no support of 0 sized array */
533 } MINIDUMP_THREAD_LIST, *PMINIDUMP_THREAD_LIST;
535 BOOL WINAPI MiniDumpWriteDump(HANDLE,DWORD,HANDLE,MINIDUMP_TYPE,const PMINIDUMP_EXCEPTION_INFORMATION,
536 const PMINIDUMP_USER_STREAM_INFORMATION,const PMINIDUMP_CALLBACK_INFORMATION);
537 BOOL WINAPI MiniDumpReadDumpStream(PVOID,ULONG,PMINIDUMP_DIRECTORY*,PVOID*,ULONG*);
540 /*************************
542 *************************/
543 typedef BOOL (CALLBACK *PENUMLOADED_MODULES_CALLBACK)(PSTR ModuleName, DWORD ModuleBase,
544 ULONG ModuleSize, PVOID UserContext);
545 extern BOOL WINAPI EnumerateLoadedModules(HANDLE hProcess,
546 PENUMLOADED_MODULES_CALLBACK EnumLoadedModulesCallback,
548 typedef BOOL (CALLBACK *PSYM_ENUMMODULES_CALLBACK)(PSTR ModuleName, DWORD BaseOfDll,
550 extern BOOL WINAPI SymEnumerateModules(HANDLE hProcess,
551 PSYM_ENUMMODULES_CALLBACK EnumModulesCallback,
553 extern BOOL WINAPI SymGetModuleInfo(HANDLE hProcess, DWORD dwAddr,
554 PIMAGEHLP_MODULE ModuleInfo);
555 extern BOOL WINAPI SymGetModuleInfoW(HANDLE hProcess, DWORD dwAddr,
556 PIMAGEHLP_MODULEW ModuleInfo);
557 extern DWORD WINAPI SymGetModuleBase(HANDLE hProcess, DWORD dwAddr);
558 extern DWORD WINAPI SymLoadModule(HANDLE hProcess, HANDLE hFile, PSTR ImageName,
559 PSTR ModuleName, DWORD BaseOfDll, DWORD SizeOfDll);
560 extern DWORD WINAPI SymLoadModuleEx(HANDLE hProcess, HANDLE hFile, PSTR ImageName,
561 PSTR ModuleName, DWORD BaseOfDll, DWORD DllSize,
562 PMODLOAD_DATA Data, DWORD Flags);
563 extern BOOL WINAPI SymUnloadModule(HANDLE hProcess, DWORD BaseOfDll);
565 /*************************
567 *************************/
569 #define IMAGEHLP_SYMBOL_INFO_VALUEPRESENT 1
570 #define IMAGEHLP_SYMBOL_INFO_REGISTER SYMF_REGISTER /* 0x08 */
571 #define IMAGEHLP_SYMBOL_INFO_REGRELATIVE SYMF_REGREL /* 0x10 */
572 #define IMAGEHLP_SYMBOL_INFO_FRAMERELATIVE SYMF_FRAMEREL /* 0x20 */
573 #define IMAGEHLP_SYMBOL_INFO_PARAMETER SYMF_PARAMETER /* 0x40 */
574 #define IMAGEHLP_SYMBOL_INFO_LOCAL SYMF_LOCAL /* 0x80 */
575 #define IMAGEHLP_SYMBOL_INFO_CONSTANT SYMF_CONSTANT /* 0x100 */
576 #define IMAGEHLP_SYMBOL_FUNCTION SYMF_FUNCTION /* 0x800 */
578 #define SYMFLAG_VALUEPRESENT 0x00000001
579 #define SYMFLAG_REGISTER 0x00000008
580 #define SYMFLAG_REGREL 0x00000010
581 #define SYMFLAG_FRAMEREL 0x00000020
582 #define SYMFLAG_PARAMETER 0x00000040
583 #define SYMFLAG_LOCAL 0x00000080
584 #define SYMFLAG_CONSTANT 0x00000100
585 #define SYMFLAG_EXPORT 0x00000200
586 #define SYMFLAG_FORWARDER 0x00000400
587 #define SYMFLAG_FUNCTION 0x00000800
588 #define SYMFLAG_VIRTUAL 0x00001000
589 #define SYMFLAG_THUNK 0x00002000
590 #define SYMFLAG_TLSREL 0x00004000
592 typedef struct _SYMBOL_INFO
597 ULONG info; /* sdk states info, while MSDN says it's Index... */
609 } SYMBOL_INFO, *PSYMBOL_INFO;
611 typedef enum _IMAGEHLP_SYMBOL_TYPE_INFO
619 TI_GET_ARRAYINDEXTYPEID,
622 TI_GET_ADDRESSOFFSET,
626 TI_GET_CHILDRENCOUNT,
628 TI_GET_VIRTUALBASECLASS,
629 TI_GET_VIRTUALTABLESHAPEID,
630 TI_GET_VIRTUALBASEPOINTEROFFSET,
631 TI_GET_CLASSPARENTID,
634 TI_GET_LEXICALPARENT,
639 TI_GET_CALLING_CONVENTION,
640 } IMAGEHLP_SYMBOL_TYPE_INFO;
642 typedef struct _TI_FINDCHILDREN_PARAMS
647 } TI_FINDCHILDREN_PARAMS;
649 #define UNDNAME_COMPLETE (0x0000)
650 #define UNDNAME_NO_LEADING_UNDERSCORES (0x0001)
651 #define UNDNAME_NO_MS_KEYWORDS (0x0002)
652 #define UNDNAME_NO_FUNCTION_RETURNS (0x0004)
653 #define UNDNAME_NO_ALLOCATION_MODEL (0x0008)
654 #define UNDNAME_NO_ALLOCATION_LANGUAGE (0x0010)
655 #define UNDNAME_NO_MS_THISTYPE (0x0020)
656 #define UNDNAME_NO_CV_THISTYPE (0x0040)
657 #define UNDNAME_NO_THISTYPE (0x0060)
658 #define UNDNAME_NO_ACCESS_SPECIFIERS (0x0080)
659 #define UNDNAME_NO_THROW_SIGNATURES (0x0100)
660 #define UNDNAME_NO_MEMBER_TYPE (0x0200)
661 #define UNDNAME_NO_RETURN_UDT_MODEL (0x0400)
662 #define UNDNAME_32_BIT_DECODE (0x0800)
663 #define UNDNAME_NAME_ONLY (0x1000)
664 #define UNDNAME_NO_ARGUMENTS (0x2000)
665 #define UNDNAME_NO_SPECIAL_SYMS (0x4000)
667 BOOL WINAPI SymGetTypeInfo(HANDLE hProcess, DWORD ModBase, ULONG TypeId,
668 IMAGEHLP_SYMBOL_TYPE_INFO GetType, PVOID);
669 typedef BOOL (CALLBACK *PSYM_ENUMERATESYMBOLS_CALLBACK)(PSYMBOL_INFO pSymInfo,
670 ULONG SymbolSize, PVOID UserContext);
671 BOOL WINAPI SymEnumTypes(HANDLE hProcess, DWORD BaseOfDll,
672 PSYM_ENUMERATESYMBOLS_CALLBACK EnumSymbolsCallback,
674 BOOL WINAPI SymFromAddr(HANDLE hProcess, DWORD addr, DWORD* displacement,
675 SYMBOL_INFO* sym_info);
676 BOOL WINAPI SymFromName(HANDLE hProcess, LPSTR Name, PSYMBOL_INFO Symbol);
677 BOOL WINAPI SymGetSymFromAddr(HANDLE,DWORD,PDWORD,PIMAGEHLP_SYMBOL);
678 BOOL WINAPI SymGetSymFromName(HANDLE,PSTR,PIMAGEHLP_SYMBOL);
679 BOOL WINAPI SymGetTypeFromName(HANDLE hProcess, DWORD BaseOfDll, LPSTR Name,
680 PSYMBOL_INFO Symbol);
681 BOOL WINAPI SymGetSymNext(HANDLE,PIMAGEHLP_SYMBOL);
682 BOOL WINAPI SymGetSymPrev(HANDLE,PIMAGEHLP_SYMBOL);
683 BOOL WINAPI SymEnumSymbols(HANDLE hProcess, ULONG BaseOfDll, PCSTR Mask,
684 PSYM_ENUMERATESYMBOLS_CALLBACK EnumSymbolsCallback,
686 typedef BOOL (CALLBACK *PSYM_ENUMSYMBOLS_CALLBACK)(PSTR SymbolName, DWORD SymbolAddress,
687 ULONG SymbolSize, PVOID UserContext);
688 BOOL WINAPI SymEnumerateSymbols(HANDLE hProcess, DWORD BaseOfDll,
689 PSYM_ENUMSYMBOLS_CALLBACK EnumSymbolsCallback,
691 typedef BOOL (CALLBACK *PSYMBOL_REGISTERED_CALLBACK)(HANDLE hProcess, ULONG ActionCode,
692 PVOID CallbackData, PVOID UserContext);
693 BOOL WINAPI SymRegisterCallback(HANDLE hProcess,
694 PSYMBOL_REGISTERED_CALLBACK CallbackFunction,
696 BOOL WINAPI SymUnDName(PIMAGEHLP_SYMBOL,PSTR,DWORD);
697 DWORD WINAPI UnDecorateSymbolName(LPCSTR DecoratedName, LPSTR UnDecoratedName,
698 DWORD UndecoratedLength, DWORD Flags);
700 /*************************
702 *************************/
703 typedef BOOL (CALLBACK *PSYM_ENUMSOURCFILES_CALLBACK)(PSOURCEFILE pSourceFile,
706 BOOL WINAPI SymEnumSourceFiles(HANDLE hProcess, ULONG ModBase, LPSTR Mask,
707 PSYM_ENUMSOURCFILES_CALLBACK cbSrcFiles,
709 BOOL WINAPI SymGetLineFromAddr(HANDLE hProcess, DWORD dwAddr,
710 PDWORD pdwDisplacement, PIMAGEHLP_LINE Line);
711 BOOL WINAPI SymGetLinePrev(HANDLE hProcess, PIMAGEHLP_LINE Line);
712 BOOL WINAPI SymGetLineNext(HANDLE hProcess, PIMAGEHLP_LINE Line);
714 /*************************
715 * File & image handling *
716 *************************/
717 BOOL WINAPI SymInitialize(HANDLE hProcess, PSTR UserSearchPath, BOOL fInvadeProcess);
718 BOOL WINAPI SymCleanup(HANDLE hProcess);
720 HANDLE WINAPI FindDebugInfoFile(PSTR FileName, PSTR SymbolPath, PSTR DebugFilePath);
721 typedef BOOL (CALLBACK *PFIND_DEBUG_FILE_CALLBACK)(HANDLE FileHandle, PSTR FileName,
723 HANDLE WINAPI FindDebugInfoFileEx(PSTR FileName, PSTR SymbolPath, PSTR DebugFilePath,
724 PFIND_DEBUG_FILE_CALLBACK Callback, PVOID CallerData);
725 typedef BOOL (CALLBACK *PFINDFILEINPATHCALLBACK)(PSTR filename, PVOID context);
727 BOOL WINAPI SymFindFileInPath(HANDLE hProcess, LPSTR searchPath, LPSTR FileName,
728 PVOID id, DWORD two, DWORD three, DWORD flags,
729 LPSTR FilePath, PFINDFILEINPATHCALLBACK callback,
731 HANDLE WINAPI FindExecutableImage(PSTR FileName, PSTR SymbolPath, PSTR ImageFilePath);
732 typedef BOOL (CALLBACK *PFIND_EXE_FILE_CALLBACK)(HANDLE FileHandle, PSTR FileName,
734 HANDLE WINAPI FindExecutableImageEx(PSTR FileName, PSTR SymbolPath, PSTR ImageFilePath,
735 PFIND_EXE_FILE_CALLBACK Callback, PVOID CallerData);
736 PIMAGE_NT_HEADERS WINAPI ImageNtHeader(PVOID Base);
738 PVOID WINAPI ImageDirectoryEntryToDataEx(PVOID Base, BOOLEAN MappedAsImage,
739 USHORT DirectoryEntry, PULONG Size,
740 PIMAGE_SECTION_HEADER *FoundHeader);
741 PVOID WINAPI ImageDirectoryEntryToData(PVOID Base, BOOLEAN MappedAsImage,
742 USHORT DirectoryEntry, PULONG Size);
743 PIMAGE_SECTION_HEADER WINAPI ImageRvaToSection(PIMAGE_NT_HEADERS NtHeaders,
744 PVOID Base, ULONG Rva);
745 PVOID WINAPI ImageRvaToVa(PIMAGE_NT_HEADERS NtHeaders, PVOID Base,
746 ULONG Rva, OUT PIMAGE_SECTION_HEADER *LastRvaSection);
747 BOOL WINAPI SymGetSearchPath(HANDLE,PSTR,DWORD);
748 BOOL WINAPI SymSetSearchPath(HANDLE,PSTR);
749 DWORD WINAPI GetTimestampForLoadedLibrary(HMODULE);
750 BOOL WINAPI MakeSureDirectoryPathExists(PCSTR);
751 BOOL WINAPI SearchTreeForFile(PSTR,PSTR,PSTR);
752 typedef BOOL (CALLBACK *PENUMDIRTREE_CALLBACK)(LPCSTR path, PVOID user);
753 BOOL WINAPI EnumDirTree(HANDLE hProcess, PCSTR root, PCSTR file,
754 LPSTR buffer, PENUMDIRTREE_CALLBACK cb, void* user);
755 BOOL WINAPI SymMatchFileName(LPSTR file, LPSTR match, LPSTR* filestop, LPSTR* matchstop);
757 /*************************
758 * Context management *
759 *************************/
760 BOOL WINAPI SymSetContext(HANDLE hProcess, PIMAGEHLP_STACK_FRAME StackFrame,
761 PIMAGEHLP_CONTEXT Context);
764 /*************************
766 *************************/
768 typedef struct _KDHELP
771 DWORD ThCallbackStack;
774 DWORD KiCallUserMode;
775 DWORD KeUserCallbackDispatcher;
776 DWORD SystemRangeStart;
779 typedef struct _STACKFRAME
785 PVOID FuncTableEntry;
791 } STACKFRAME, *LPSTACKFRAME;
793 typedef BOOL (CALLBACK *PREAD_PROCESS_MEMORY_ROUTINE)
794 (HANDLE hProcess, LPCVOID lpBaseAddress, PVOID lpBuffer,
795 DWORD nSize, PDWORD lpNumberOfBytesRead);
797 typedef PVOID (CALLBACK *PFUNCTION_TABLE_ACCESS_ROUTINE)
798 (HANDLE hProcess, DWORD AddrBase);
800 typedef DWORD (CALLBACK *PGET_MODULE_BASE_ROUTINE)
801 (HANDLE hProcess, DWORD ReturnAddress);
803 typedef DWORD (CALLBACK *PTRANSLATE_ADDRESS_ROUTINE)
804 (HANDLE hProcess, HANDLE hThread, LPADDRESS lpaddr);
806 BOOL WINAPI StackWalk(DWORD MachineType, HANDLE hProcess, HANDLE hThread,
807 LPSTACKFRAME StackFrame, PVOID ContextRecord,
808 PREAD_PROCESS_MEMORY_ROUTINE ReadMemoryRoutine,
809 PFUNCTION_TABLE_ACCESS_ROUTINE FunctionTableAccessRoutine,
810 PGET_MODULE_BASE_ROUTINE GetModuleBaseRoutine,
811 PTRANSLATE_ADDRESS_ROUTINE TranslateAddress);
813 PVOID WINAPI SymFunctionTableAccess(HANDLE hProcess, DWORD AddrBase);
815 /*************************
816 * Version, global stuff *
817 *************************/
819 typedef struct API_VERSION
825 } API_VERSION, *LPAPI_VERSION;
827 LPAPI_VERSION WINAPI ImagehlpApiVersion(void);
828 LPAPI_VERSION WINAPI ImagehlpApiVersionEx(LPAPI_VERSION AppVersion);
830 typedef struct _IMAGE_DEBUG_INFORMATION
834 PVOID ReservedMappedBase;
835 USHORT ReservedMachine;
836 USHORT ReservedCharacteristics;
837 DWORD ReservedCheckSum;
840 DWORD ReservedNumberOfSections;
841 PIMAGE_SECTION_HEADER ReservedSections;
842 DWORD ReservedExportedNamesSize;
843 PSTR ReservedExportedNames;
844 DWORD ReservedNumberOfFunctionTableEntries;
845 PIMAGE_FUNCTION_ENTRY ReservedFunctionTableEntries;
846 DWORD ReservedLowestFunctionStartingAddress;
847 DWORD ReservedHighestFunctionEndingAddress;
848 DWORD ReservedNumberOfFpoTableEntries;
849 PFPO_DATA ReservedFpoTableEntries;
850 DWORD SizeOfCoffSymbols;
851 PIMAGE_COFF_SYMBOLS_HEADER CoffSymbols;
852 DWORD ReservedSizeOfCodeViewSymbols;
853 PVOID ReservedCodeViewSymbols;
856 PSTR ReservedDebugFilePath;
857 DWORD ReservedTimeDateStamp;
858 BOOL ReservedRomImage;
859 PIMAGE_DEBUG_DIRECTORY ReservedDebugDirectory;
860 DWORD ReservedNumberOfDebugDirectories;
861 DWORD ReservedOriginalFunctionTableBaseAddress;
863 } IMAGE_DEBUG_INFORMATION, *PIMAGE_DEBUG_INFORMATION;
866 PIMAGE_DEBUG_INFORMATION WINAPI MapDebugInformation(HANDLE FileHandle, PSTR FileName,
867 PSTR SymbolPath, DWORD ImageBase);
869 BOOL WINAPI UnmapDebugInformation(PIMAGE_DEBUG_INFORMATION DebugInfo);
871 DWORD WINAPI SymGetOptions(void);
872 DWORD WINAPI SymSetOptions(DWORD);
876 #endif /* defined(__cplusplus) */
878 #endif /* __WINE_DBGHELP_H */