- more FIXME -> TRACE
[wine.git] / include / dbghelp.h
blob5df1cd79fcda317a0a9f17a5e8f373ed8c33a8fa
1 /*
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
24 #ifdef __cplusplus
25 extern "C" {
26 #endif /* defined(__cplusplus) */
28 typedef struct _LOADED_IMAGE
30 LPSTR ModuleName;
31 HANDLE hFile;
32 PUCHAR MappedAddress;
33 PIMAGE_NT_HEADERS FileHeader;
34 PIMAGE_SECTION_HEADER LastRvaSection;
35 ULONG NumberOfSections;
36 PIMAGE_SECTION_HEADER Sections;
37 ULONG Characteristics;
38 BOOLEAN fSystemImage;
39 BOOLEAN fDOSImage;
40 LIST_ENTRY Links;
41 ULONG SizeOfImage;
42 } LOADED_IMAGE, *PLOADED_IMAGE;
44 /*************************
45 * IMAGEHLP equiv *
46 *************************/
48 typedef enum
50 AddrMode1616,
51 AddrMode1632,
52 AddrModeReal,
53 AddrModeFlat
54 } ADDRESS_MODE;
56 typedef struct _tagADDRESS
58 DWORD Offset;
59 WORD Segment;
60 ADDRESS_MODE Mode;
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
76 typedef enum
78 SymNone = 0,
79 SymCoff,
80 SymCv,
81 SymPdb,
82 SymExport,
83 SymDeferred,
84 SymSym,
85 SymDia,
86 NumSymTypes
87 } SYM_TYPE;
89 typedef struct _IMAGEHLP_SYMBOL
91 DWORD SizeOfStruct;
92 DWORD Address;
93 DWORD Size;
94 DWORD Flags;
95 DWORD MaxNameLength;
96 CHAR Name[1];
97 } IMAGEHLP_SYMBOL, *PIMAGEHLP_SYMBOL;
99 typedef struct _IMAGEHLP_MODULE
101 DWORD SizeOfStruct;
102 DWORD BaseOfImage;
103 DWORD ImageSize;
104 DWORD TimeDateStamp;
105 DWORD CheckSum;
106 DWORD NumSyms;
107 SYM_TYPE SymType;
108 CHAR ModuleName[32];
109 CHAR ImageName[256];
110 CHAR LoadedImageName[256];
111 } IMAGEHLP_MODULE, *PIMAGEHLP_MODULE;
113 typedef struct _IMAGEHLP_MODULEW {
114 DWORD SizeOfStruct;
115 DWORD BaseOfImage;
116 DWORD ImageSize;
117 DWORD TimeDateStamp;
118 DWORD CheckSum;
119 DWORD NumSyms;
120 SYM_TYPE SymType;
121 WCHAR ModuleName[32];
122 WCHAR ImageName[256];
123 WCHAR LoadedImageName[256];
124 } IMAGEHLP_MODULEW, *PIMAGEHLP_MODULEW;
126 typedef struct _IMAGEHLP_LINE
128 DWORD SizeOfStruct;
129 PVOID Key;
130 DWORD LineNumber;
131 PCHAR FileName;
132 DWORD Address;
133 } IMAGEHLP_LINE, *PIMAGEHLP_LINE;
135 typedef struct _SOURCEFILE
137 DWORD ModBase;
138 PCHAR FileName;
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
154 DWORD addr;
155 PVOID buf;
156 DWORD bytes;
157 DWORD *bytesread;
158 } IMAGEHLP_CBA_READ_MEMORY, *PIMAGEHLP_CBA_READ_MEMORY;
160 enum {
161 sevInfo = 0,
162 sevProblem,
163 sevAttn,
164 sevFatal,
165 sevMax
168 typedef struct _IMAGEHLP_CBA_EVENT
170 DWORD severity;
171 DWORD code;
172 PCHAR desc;
173 PVOID object;
174 } IMAGEHLP_CBA_EVENT, *PIMAGEHLP_CBA_EVENT;
176 typedef struct _IMAGEHLP_DEFERRED_SYMBOL_LOAD
178 DWORD SizeOfStruct;
179 DWORD64 BaseOfImage;
180 DWORD CheckSum;
181 DWORD TimeDateStamp;
182 CHAR FileName[MAX_PATH];
183 BOOLEAN Reparse;
184 } IMAGEHLP_DEFERRED_SYMBOL_LOAD, *PIMAGEHLP_DEFERRED_SYMBOL_LOAD;
186 typedef struct _IMAGEHLP_DUPLICATE_SYMBOL
188 DWORD SizeOfStruct;
189 DWORD NumberOfDups;
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;
220 ULONG ReturnOffset;
221 ULONG FrameOffset;
222 ULONG StackOffset;
223 ULONG BackingStoreOffset;
224 ULONG FuncTableEntry;
225 ULONG Params[4];
226 ULONG Reserved[5];
227 BOOL Virtual;
228 ULONG Reserved2;
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
236 DWORD ssize;
237 DWORD ssig;
238 PVOID data;
239 DWORD size;
240 DWORD flags;
241 } MODLOAD_DATA, *PMODLOAD_DATA;
243 /*************************
244 * MiniDUMP *
245 *************************/
247 /* DebugHelp */
249 #define MINIDUMP_SIGNATURE 0x4D444D50 /* 'PMDM' */
250 #define MINIDUMP_VERSION (42899)
252 typedef DWORD RVA;
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
263 } MINIDUMP_TYPE;
265 typedef enum _MINIDUMP_CALLBACK_TYPE
267 ModuleCallback,
268 ThreadCallback,
269 ThreadExCallback,
270 IncludeThreadCallback,
271 IncludeModuleCallback,
272 } MINIDUMP_CALLBACK_TYPE;
274 typedef struct _MINIDUMP_THREAD_CALLBACK
276 ULONG ThreadId;
277 HANDLE ThreadHandle;
278 CONTEXT Context;
279 ULONG SizeOfContext;
280 ULONGLONG StackBase;
281 ULONG64 StackEnd;
282 } MINIDUMP_THREAD_CALLBACK, *PMINIDUMP_THREAD_CALLBACK;
284 typedef struct _MINIDUMP_THREAD_EX_CALLBACK
286 ULONG ThreadId;
287 HANDLE ThreadHandle;
288 CONTEXT Context;
289 ULONG SizeOfContext;
290 ULONGLONG StackBase;
291 ULONGLONG StackEnd;
292 ULONGLONG BackingStoreBase;
293 ULONGLONG BackingStoreEnd;
294 } MINIDUMP_THREAD_EX_CALLBACK, *PMINIDUMP_THREAD_EX_CALLBACK;
296 typedef struct _MINIDUMP_INCLUDE_THREAD_CALLBACK
298 ULONG ThreadId;
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
312 PWCHAR FullPath;
313 ULONGLONG BaseOfImage;
314 ULONG SizeOfImage;
315 ULONG CheckSum;
316 ULONG TimeDateStamp;
317 VS_FIXEDFILEINFO VersionInfo;
318 PVOID CvRecord;
319 ULONG SizeOfCvRecord;
320 PVOID MiscRecord;
321 ULONG SizeOfMiscRecord;
322 } MINIDUMP_MODULE_CALLBACK, *PMINIDUMP_MODULE_CALLBACK;
324 typedef struct _MINIDUMP_INCLUDE_MODULE_CALLBACK
326 ULONG64 BaseOfImage;
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
340 ULONG ProcessId;
341 HANDLE ProcessHandle;
342 ULONG CallbackType;
343 union
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;
350 } u;
351 } MINIDUMP_CALLBACK_INPUT, *PMINIDUMP_CALLBACK_INPUT;
353 typedef struct _MINIDUMP_CALLBACK_OUTPUT
355 union
357 ULONG ModuleWriteFlags;
358 ULONG ThreadWriteFlags;
359 } u;
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;
369 void* CallbackParam;
370 } MINIDUMP_CALLBACK_INFORMATION, *PMINIDUMP_CALLBACK_INFORMATION;
372 typedef struct _MINIDUMP_LOCATION_DESCRIPTOR
374 ULONG DataSize;
375 RVA Rva;
376 } MINIDUMP_LOCATION_DESCRIPTOR;
378 typedef struct _MINIDUMP_DIRECTORY
380 ULONG StreamType;
381 MINIDUMP_LOCATION_DESCRIPTOR Location;
382 } MINIDUMP_DIRECTORY, *PMINIDUMP_DIRECTORY;
384 typedef struct _MINIDUMP_EXCEPTION
386 ULONG ExceptionCode;
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
397 DWORD ThreadId;
398 PEXCEPTION_POINTERS ExceptionPointers;
399 BOOL ClientPointers;
400 } MINIDUMP_EXCEPTION_INFORMATION, *PMINIDUMP_EXCEPTION_INFORMATION;
402 typedef struct MINIDUMP_EXCEPTION_STREAM
404 ULONG ThreadId;
405 ULONG __alignment;
406 MINIDUMP_EXCEPTION ExceptionRecord;
407 MINIDUMP_LOCATION_DESCRIPTOR ThreadContext;
408 } MINIDUMP_EXCEPTION_STREAM, *PMINIDUMP_EXCEPTION_STREAM;
410 typedef struct _MINIDUMP_HEADER
412 DWORD Signature;
413 DWORD Version;
414 DWORD NumberOfStreams;
415 RVA StreamDirectoryRva;
416 DWORD CheckSum;
417 union
419 DWORD Reserved;
420 DWORD TimeDateStamp;
421 } u;
422 ULONGLONG Flags;
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;
434 ULONG SizeOfImage;
435 ULONG CheckSum;
436 ULONG TimeDateStamp;
437 RVA ModuleNameRva;
438 VS_FIXEDFILEINFO VersionInfo;
439 MINIDUMP_LOCATION_DESCRIPTOR CvRecord;
440 MINIDUMP_LOCATION_DESCRIPTOR MiscRecord;
441 ULONGLONG Reserved0;
442 ULONGLONG Reserved1;
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
453 ULONG Type;
454 ULONG BufferSize;
455 void* Buffer;
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
466 UnusedStream = 0,
467 ReservedStream0 = 1,
468 ReservedStream1 = 2,
469 ThreadListStream = 3,
470 ModuleListStream = 4,
471 MemoryListStream = 5,
472 ExceptionStream = 6,
473 SystemInfoStream = 7,
474 ThreadExListStream = 8,
475 Memory64ListStream = 9,
476 CommentStreamA = 10,
477 CommentStreamW = 11,
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;
489 USHORT Reserved0;
491 ULONG MajorVersion;
492 ULONG MinorVersion;
493 ULONG BuildNumber;
494 ULONG PlatformId;
496 RVA CSDVersionRva;
497 ULONG Reserved1;
498 union _CPU_INFORMATION
500 struct
502 ULONG VendorId[3];
503 ULONG VersionInformation;
504 ULONG FeatureInformation;
505 ULONG AMDExtendedCpuFeatures;
506 } X86CpuInfo;
507 struct
509 ULONGLONG ProcessorFeatures[2];
510 } OtherCpuInfo;
511 } Cpu;
513 } MINIDUMP_SYSTEM_INFO, *PMINIDUMP_SYSTEM_INFO;
515 typedef struct _MINIDUMP_THREAD
517 ULONG ThreadId;
518 ULONG SuspendCount;
519 ULONG PriorityClass;
520 ULONG Priority;
521 ULONGLONG Teb;
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 /*************************
533 * MODULE handling *
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,
539 PVOID UserContext);
540 typedef BOOL (CALLBACK *PSYM_ENUMMODULES_CALLBACK)(PSTR ModuleName, DWORD BaseOfDll,
541 PVOID UserContext);
542 extern BOOL WINAPI SymEnumerateModules(HANDLE hProcess,
543 PSYM_ENUMMODULES_CALLBACK EnumModulesCallback,
544 PVOID UserContext);
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 /*************************
558 * Symbol Handling *
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
586 ULONG SizeOfStruct;
587 ULONG TypeIndex;
588 ULONG Reserved[2];
589 ULONG info;
590 ULONG Size;
591 ULONG ModBase;
592 ULONG Flags;
593 ULONG Value;
594 ULONG Address;
595 ULONG Register;
596 ULONG Scope;
597 ULONG Tag;
598 ULONG NameLen;
599 ULONG MaxNameLen;
600 CHAR Name[1];
601 } SYMBOL_INFO, *PSYMBOL_INFO;
603 typedef enum _IMAGEHLP_SYMBOL_TYPE_INFO
605 TI_GET_SYMTAG,
606 TI_GET_SYMNAME,
607 TI_GET_LENGTH,
608 TI_GET_TYPE,
609 TI_GET_TYPEID,
610 TI_GET_BASETYPE,
611 TI_GET_ARRAYINDEXTYPEID,
612 TI_FINDCHILDREN,
613 TI_GET_DATAKIND,
614 TI_GET_ADDRESSOFFSET,
615 TI_GET_OFFSET,
616 TI_GET_VALUE,
617 TI_GET_COUNT,
618 TI_GET_CHILDRENCOUNT,
619 TI_GET_BITPOSITION,
620 TI_GET_VIRTUALBASECLASS,
621 TI_GET_VIRTUALTABLESHAPEID,
622 TI_GET_VIRTUALBASEPOINTEROFFSET,
623 TI_GET_CLASSPARENTID,
624 TI_GET_NESTED,
625 TI_GET_SYMINDEX,
626 TI_GET_LEXICALPARENT,
627 TI_GET_ADDRESS,
628 TI_GET_THISADJUST,
629 TI_GET_UDTKIND,
630 TI_IS_EQUIV_TO,
631 TI_GET_CALLING_CONVENTION,
632 } IMAGEHLP_SYMBOL_TYPE_INFO;
634 typedef struct _TI_FINDCHILDREN_PARAMS
636 ULONG Count;
637 ULONG Start;
638 ULONG ChildId[1];
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,
665 PVOID UserContext);
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,
673 PVOID UserContext);
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,
678 PVOID UserContext);
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,
683 PVOID UserContext);
684 DWORD WINAPI UnDecorateSymbolName(LPCSTR DecoratedName, LPSTR UnDecoratedName,
685 DWORD UndecoratedLength, DWORD Flags);
687 /*************************
688 * Source Files *
689 *************************/
690 typedef BOOL (CALLBACK *PSYM_ENUMSOURCFILES_CALLBACK)(PSOURCEFILE pSourceFile,
691 PVOID UserContext);
693 BOOL WINAPI SymEnumSourceFiles(HANDLE hProcess, ULONG ModBase, LPSTR Mask,
694 PSYM_ENUMSOURCFILES_CALLBACK cbSrcFiles,
695 PVOID UserContext);
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,
709 PVOID CallerData);
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,
717 PVOID context);
718 HANDLE WINAPI FindExecutableImage(PSTR FileName, PSTR SymbolPath, PSTR ImageFilePath);
719 typedef BOOL (CALLBACK *PFIND_EXE_FILE_CALLBACK)(HANDLE FileHandle, PSTR FileName,
720 PVOID CallerData);
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 /*************************
743 * Stack management *
744 *************************/
746 typedef struct _KDHELP
748 DWORD Thread;
749 DWORD ThCallbackStack;
750 DWORD NextCallback;
751 DWORD FramePointer;
752 DWORD KiCallUserMode;
753 DWORD KeUserCallbackDispatcher;
754 DWORD SystemRangeStart;
755 } KDHELP, *PKDHELP;
757 typedef struct _STACKFRAME
759 ADDRESS AddrPC;
760 ADDRESS AddrReturn;
761 ADDRESS AddrFrame;
762 ADDRESS AddrStack;
763 PVOID FuncTableEntry;
764 DWORD Params[4];
765 BOOL Far;
766 BOOL Virtual;
767 DWORD Reserved[3];
768 KDHELP KdHelp;
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
799 USHORT MajorVersion;
800 USHORT MinorVersion;
801 USHORT Revision;
802 USHORT Reserved;
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
810 LIST_ENTRY List;
811 DWORD ReservedSize;
812 PVOID ReservedMappedBase;
813 USHORT ReservedMachine;
814 USHORT ReservedCharacteristics;
815 DWORD ReservedCheckSum;
816 DWORD ImageBase;
817 DWORD SizeOfImage;
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;
832 PSTR ImageFilePath;
833 PSTR ImageFileName;
834 PSTR ReservedDebugFilePath;
835 DWORD ReservedTimeDateStamp;
836 BOOL ReservedRomImage;
837 PIMAGE_DEBUG_DIRECTORY ReservedDebugDirectory;
838 DWORD ReservedNumberOfDebugDirectories;
839 DWORD ReservedOriginalFunctionTableBaseAddress;
840 DWORD Reserved[ 2 ];
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);
852 #ifdef __cplusplus
853 } /* extern "C" */
854 #endif /* defined(__cplusplus) */
856 #endif /* __WINE_DBGHELP_H */