win32u: Avoid unnecessary copy of adapter path and device name.
[wine.git] / include / dbghelp.h
blobe56d8de0d5d3659c640417872e237146ee0fac9d
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #ifndef __WINE_DBGHELP_H
22 #define __WINE_DBGHELP_H
24 #include <minidumpapiset.h>
26 #ifdef __cplusplus
27 extern "C" {
28 #endif /* defined(__cplusplus) */
30 #ifdef _WIN64
31 #ifndef _IMAGEHLP64
32 #define _IMAGEHLP64
33 #endif
34 #endif
36 #define IMAGEAPI WINAPI
37 #define DBHLPAPI IMAGEAPI
39 typedef struct _LOADED_IMAGE
41 PSTR ModuleName;
42 HANDLE hFile;
43 PUCHAR MappedAddress;
44 PIMAGE_NT_HEADERS FileHeader;
45 PIMAGE_SECTION_HEADER LastRvaSection;
46 ULONG NumberOfSections;
47 PIMAGE_SECTION_HEADER Sections;
48 ULONG Characteristics;
49 BOOLEAN fSystemImage;
50 BOOLEAN fDOSImage;
51 BOOLEAN fReadOnly;
52 UCHAR Version;
53 LIST_ENTRY Links;
54 ULONG SizeOfImage;
55 } LOADED_IMAGE, *PLOADED_IMAGE;
57 /*************************
58 * IMAGEHLP equiv *
59 *************************/
61 typedef enum
63 AddrMode1616,
64 AddrMode1632,
65 AddrModeReal,
66 AddrModeFlat
67 } ADDRESS_MODE;
69 #if !defined(_IMAGEHLP_SOURCE_) && defined(_IMAGEHLP64)
70 #define ADDRESS ADDRESS64
71 #define LPADDRESS LPADDRESS64
72 #else
73 typedef struct _tagADDRESS
75 DWORD Offset;
76 WORD Segment;
77 ADDRESS_MODE Mode;
78 } ADDRESS, *LPADDRESS;
79 #endif
81 typedef struct _tagADDRESS64
83 DWORD64 Offset;
84 WORD Segment;
85 ADDRESS_MODE Mode;
86 } ADDRESS64, *LPADDRESS64;
88 #define SYMF_OMAP_GENERATED 0x00000001
89 #define SYMF_OMAP_MODIFIED 0x00000002
90 #define SYMF_USER_GENERATED 0x00000004
91 #define SYMF_REGISTER 0x00000008
92 #define SYMF_REGREL 0x00000010
93 #define SYMF_FRAMEREL 0x00000020
94 #define SYMF_PARAMETER 0x00000040
95 #define SYMF_LOCAL 0x00000080
96 #define SYMF_CONSTANT 0x00000100
97 #define SYMF_EXPORT 0x00000200
98 #define SYMF_FORWARDER 0x00000400
99 #define SYMF_FUNCTION 0x00000800
100 #define SYMF_VIRTUAL 0x00001000
101 #define SYMF_THUNK 0x00002000
102 #define SYMF_TLSREL 0x00004000
104 typedef enum
106 SymNone = 0,
107 SymCoff,
108 SymCv,
109 SymPdb,
110 SymExport,
111 SymDeferred,
112 SymSym,
113 SymDia,
114 SymVirtual,
115 NumSymTypes
116 } SYM_TYPE;
118 #if !defined(_IMAGEHLP_SOURCE_) && defined(_IMAGEHLP64)
119 #define IMAGEHLP_SYMBOL IMAGEHLP_SYMBOL64
120 #define IMAGEHLP_SYMBOLW IMAGEHLP_SYMBOLW64
121 #define PIMAGEHLP_SYMBOL PIMAGEHLP_SYMBOL64
122 #define PIMAGEHLP_SYMBOLW PIMAGEHLP_SYMBOLW64
123 #else
124 typedef struct _IMAGEHLP_SYMBOL
126 DWORD SizeOfStruct;
127 DWORD Address;
128 DWORD Size;
129 DWORD Flags;
130 DWORD MaxNameLength;
131 CHAR Name[1];
132 } IMAGEHLP_SYMBOL, *PIMAGEHLP_SYMBOL;
134 typedef struct _IMAGEHLP_SYMBOLW
136 DWORD SizeOfStruct;
137 DWORD Address;
138 DWORD Size;
139 DWORD Flags;
140 DWORD MaxNameLength;
141 WCHAR Name[1];
142 } IMAGEHLP_SYMBOLW, *PIMAGEHLP_SYMBOLW;
143 #endif
145 typedef struct _IMAGEHLP_SYMBOL64
147 DWORD SizeOfStruct;
148 DWORD64 Address;
149 DWORD Size;
150 DWORD Flags;
151 DWORD MaxNameLength;
152 CHAR Name[1];
153 } IMAGEHLP_SYMBOL64, *PIMAGEHLP_SYMBOL64;
155 typedef struct _IMAGEHLP_SYMBOLW64
157 DWORD SizeOfStruct;
158 DWORD64 Address;
159 DWORD Size;
160 DWORD Flags;
161 DWORD MaxNameLength;
162 WCHAR Name[1];
163 } IMAGEHLP_SYMBOLW64, *PIMAGEHLP_SYMBOLW64;
165 #if !defined(_IMAGEHLP_SOURCE_) && defined(_IMAGEHLP64)
166 #define IMAGEHLP_MODULE IMAGEHLP_MODULE64
167 #define PIMAGEHLP_MODULE PIMAGEHLP_MODULE64
168 #define IMAGEHLP_MODULEW IMAGEHLP_MODULEW64
169 #define PIMAGEHLP_MODULEW PIMAGEHLP_MODULEW64
170 #else
171 typedef struct _IMAGEHLP_MODULE
173 DWORD SizeOfStruct;
174 DWORD BaseOfImage;
175 DWORD ImageSize;
176 DWORD TimeDateStamp;
177 DWORD CheckSum;
178 DWORD NumSyms;
179 SYM_TYPE SymType;
180 CHAR ModuleName[32];
181 CHAR ImageName[256];
182 CHAR LoadedImageName[256];
183 } IMAGEHLP_MODULE, *PIMAGEHLP_MODULE;
185 typedef struct _IMAGEHLP_MODULEW
187 DWORD SizeOfStruct;
188 DWORD BaseOfImage;
189 DWORD ImageSize;
190 DWORD TimeDateStamp;
191 DWORD CheckSum;
192 DWORD NumSyms;
193 SYM_TYPE SymType;
194 WCHAR ModuleName[32];
195 WCHAR ImageName[256];
196 WCHAR LoadedImageName[256];
197 } IMAGEHLP_MODULEW, *PIMAGEHLP_MODULEW;
198 #endif
200 typedef struct _IMAGEHLP_MODULE64
202 DWORD SizeOfStruct;
203 DWORD64 BaseOfImage;
204 DWORD ImageSize;
205 DWORD TimeDateStamp;
206 DWORD CheckSum;
207 DWORD NumSyms;
208 SYM_TYPE SymType;
209 CHAR ModuleName[32];
210 CHAR ImageName[256];
211 CHAR LoadedImageName[256];
212 CHAR LoadedPdbName[256];
213 DWORD CVSig;
214 CHAR CVData[MAX_PATH*3];
215 DWORD PdbSig;
216 GUID PdbSig70;
217 DWORD PdbAge;
218 BOOL PdbUnmatched;
219 BOOL DbgUnmatched;
220 BOOL LineNumbers;
221 BOOL GlobalSymbols;
222 BOOL TypeInfo;
223 BOOL SourceIndexed;
224 BOOL Publics;
225 DWORD MachineType;
226 DWORD Reserved;
227 } IMAGEHLP_MODULE64, *PIMAGEHLP_MODULE64;
229 typedef struct _IMAGEHLP_MODULEW64
231 DWORD SizeOfStruct;
232 DWORD64 BaseOfImage;
233 DWORD ImageSize;
234 DWORD TimeDateStamp;
235 DWORD CheckSum;
236 DWORD NumSyms;
237 SYM_TYPE SymType;
238 WCHAR ModuleName[32];
239 WCHAR ImageName[256];
240 WCHAR LoadedImageName[256];
241 WCHAR LoadedPdbName[256];
242 DWORD CVSig;
243 WCHAR CVData[MAX_PATH*3];
244 DWORD PdbSig;
245 GUID PdbSig70;
246 DWORD PdbAge;
247 BOOL PdbUnmatched;
248 BOOL DbgUnmatched;
249 BOOL LineNumbers;
250 BOOL GlobalSymbols;
251 BOOL TypeInfo;
252 BOOL SourceIndexed;
253 BOOL Publics;
254 DWORD MachineType;
255 DWORD Reserved;
256 } IMAGEHLP_MODULEW64, *PIMAGEHLP_MODULEW64;
258 #if !defined(_IMAGEHLP_SOURCE_) && defined(_IMAGEHLP64)
259 #define IMAGEHLP_LINE IMAGEHLP_LINE64
260 #define PIMAGEHLP_LINE PIMAGEHLP_LINE64
261 #define IMAGEHLP_LINEW IMAGEHLP_LINEW64
262 #define PIMAGEHLP_LINEW PIMAGEHLP_LINEW64
263 #else
264 typedef struct _IMAGEHLP_LINE
266 DWORD SizeOfStruct;
267 PVOID Key;
268 DWORD LineNumber;
269 PCHAR FileName;
270 DWORD Address;
271 } IMAGEHLP_LINE, *PIMAGEHLP_LINE;
273 typedef struct _IMAGEHLP_LINEW
275 DWORD SizeOfStruct;
276 PVOID Key;
277 DWORD LineNumber;
278 PWSTR FileName;
279 DWORD Address;
280 } IMAGEHLP_LINEW, *PIMAGEHLP_LINEW;
281 #endif
283 typedef struct _IMAGEHLP_LINE64
285 DWORD SizeOfStruct;
286 PVOID Key;
287 DWORD LineNumber;
288 PCHAR FileName;
289 DWORD64 Address;
290 } IMAGEHLP_LINE64, *PIMAGEHLP_LINE64;
292 typedef struct _IMAGEHLP_LINEW64
294 DWORD SizeOfStruct;
295 PVOID Key;
296 DWORD LineNumber;
297 PWSTR FileName;
298 DWORD64 Address;
299 } IMAGEHLP_LINEW64, *PIMAGEHLP_LINEW64;
301 typedef struct _SOURCEFILE
303 DWORD64 ModBase;
304 PCHAR FileName;
305 } SOURCEFILE, *PSOURCEFILE;
307 typedef struct _SOURCEFILEW
309 DWORD64 ModBase;
310 PWSTR FileName;
311 } SOURCEFILEW, *PSOURCEFILEW;
313 #define CBA_DEFERRED_SYMBOL_LOAD_START 0x00000001
314 #define CBA_DEFERRED_SYMBOL_LOAD_COMPLETE 0x00000002
315 #define CBA_DEFERRED_SYMBOL_LOAD_FAILURE 0x00000003
316 #define CBA_SYMBOLS_UNLOADED 0x00000004
317 #define CBA_DUPLICATE_SYMBOL 0x00000005
318 #define CBA_READ_MEMORY 0x00000006
319 #define CBA_DEFERRED_SYMBOL_LOAD_CANCEL 0x00000007
320 #define CBA_SET_OPTIONS 0x00000008
321 #define CBA_EVENT 0x00000010
322 #define CBA_DEFERRED_SYMBOL_LOAD_PARTIAL 0x00000020
323 #define CBA_DEBUG_INFO 0x10000000
325 typedef struct _IMAGEHLP_CBA_READ_MEMORY
327 DWORD64 addr;
328 PVOID buf;
329 DWORD bytes;
330 DWORD *bytesread;
331 } IMAGEHLP_CBA_READ_MEMORY, *PIMAGEHLP_CBA_READ_MEMORY;
333 enum
335 sevInfo = 0,
336 sevProblem,
337 sevAttn,
338 sevFatal,
339 sevMax
342 #define EVENT_SRCSPEW_START 100
343 #define EVENT_SRCSPEW 100
344 #define EVENT_SRCSPEW_END 199
346 typedef struct _IMAGEHLP_CBA_EVENT
348 DWORD severity;
349 DWORD code;
350 PCHAR desc;
351 PVOID object;
352 } IMAGEHLP_CBA_EVENT, *PIMAGEHLP_CBA_EVENT;
354 typedef struct _IMAGEHLP_CBA_EVENTW
356 DWORD severity;
357 DWORD code;
358 PCWSTR desc;
359 PVOID object;
360 } IMAGEHLP_CBA_EVENTW, *PIMAGEHLP_CBA_EVENTW;
362 #if !defined(_IMAGEHLP_SOURCE_) && defined(_IMAGEHLP64)
363 #define IMAGEHLP_DEFERRED_SYMBOL_LOAD IMAGEHLP_DEFERRED_SYMBOL_LOAD64
364 #define PIMAGEHLP_DEFERRED_SYMBOL_LOAD PIMAGEHLP_DEFERRED_SYMBOL_LOAD64
365 #else
366 typedef struct _IMAGEHLP_DEFERRED_SYMBOL_LOAD
368 DWORD SizeOfStruct;
369 DWORD BaseOfImage;
370 DWORD CheckSum;
371 DWORD TimeDateStamp;
372 CHAR FileName[MAX_PATH];
373 BOOLEAN Reparse;
374 HANDLE hFile;
375 } IMAGEHLP_DEFERRED_SYMBOL_LOAD, *PIMAGEHLP_DEFERRED_SYMBOL_LOAD;
376 #endif
378 typedef struct _IMAGEHLP_DEFERRED_SYMBOL_LOAD64
380 DWORD SizeOfStruct;
381 DWORD64 BaseOfImage;
382 DWORD CheckSum;
383 DWORD TimeDateStamp;
384 CHAR FileName[MAX_PATH];
385 BOOLEAN Reparse;
386 HANDLE hFile;
387 DWORD Flags;
388 } IMAGEHLP_DEFERRED_SYMBOL_LOAD64, *PIMAGEHLP_DEFERRED_SYMBOL_LOAD64;
390 typedef struct _IMAGEHLP_DEFERRED_SYMBOL_LOADW64
392 DWORD SizeOfStruct;
393 DWORD64 BaseOfImage;
394 DWORD CheckSum;
395 DWORD TimeDateStamp;
396 WCHAR FileName[MAX_PATH + 1];
397 BOOLEAN Reparse;
398 HANDLE hFile;
399 DWORD Flags;
400 } IMAGEHLP_DEFERRED_SYMBOL_LOADW64, *PIMAGEHLP_DEFERRED_SYMBOL_LOADW64;
402 #if !defined(_IMAGEHLP_SOURCE_) && defined(_IMAGEHLP64)
403 #define IMAGEHLP_DUPLICATE_SYMBOL IMAGEHLP_DUPLICATE_SYMBOL64
404 #define PIMAGEHLP_DUPLICATE_SYMBOL PIMAGEHLP_DUPLICATE_SYMBOL64
405 #else
406 typedef struct _IMAGEHLP_DUPLICATE_SYMBOL
408 DWORD SizeOfStruct;
409 DWORD NumberOfDups;
410 PIMAGEHLP_SYMBOL Symbol;
411 DWORD SelectedSymbol;
412 } IMAGEHLP_DUPLICATE_SYMBOL, *PIMAGEHLP_DUPLICATE_SYMBOL;
413 #endif
415 typedef struct _IMAGEHLP_DUPLICATE_SYMBOL64
417 DWORD SizeOfStruct;
418 DWORD NumberOfDups;
419 PIMAGEHLP_SYMBOL64 Symbol;
420 DWORD SelectedSymbol;
421 } IMAGEHLP_DUPLICATE_SYMBOL64, *PIMAGEHLP_DUPLICATE_SYMBOL64;
423 #define SYMOPT_CASE_INSENSITIVE 0x00000001
424 #define SYMOPT_UNDNAME 0x00000002
425 #define SYMOPT_DEFERRED_LOADS 0x00000004
426 #define SYMOPT_NO_CPP 0x00000008
427 #define SYMOPT_LOAD_LINES 0x00000010
428 #define SYMOPT_OMAP_FIND_NEAREST 0x00000020
429 #define SYMOPT_LOAD_ANYTHING 0x00000040
430 #define SYMOPT_IGNORE_CVREC 0x00000080
431 #define SYMOPT_NO_UNQUALIFIED_LOADS 0x00000100
432 #define SYMOPT_FAIL_CRITICAL_ERRORS 0x00000200
433 #define SYMOPT_EXACT_SYMBOLS 0x00000400
434 #define SYMOPT_WILD_UNDERSCORE 0x00000800
435 #define SYMOPT_USE_DEFAULTS 0x00001000
436 /* latest SDK defines:
437 #define SYMOPT_ALLOW_ABSOLUTE_SYMBOLS 0x00000800
438 #define SYMOPT_IGNORE_NT_SYMPATH 0x00001000
440 #define SYMOPT_INCLUDE_32BIT_MODULES 0x00002000
441 #define SYMOPT_PUBLICS_ONLY 0x00004000
442 #define SYMOPT_NO_PUBLICS 0x00008000
443 #define SYMOPT_AUTO_PUBLICS 0x00010000
444 #define SYMOPT_NO_IMAGE_SEARCH 0x00020000
445 #define SYMOPT_SECURE 0x00040000
446 #define SYMOPT_NO_PROMPTS 0x00080000
447 #define SYMOPT_OVERWRITE 0x00100000
448 #define SYMOPT_IGNORE_IMAGEDIR 0x00200000
449 #define SYMOPT_FLAT_DIRECTORY 0x00400000
450 #define SYMOPT_FAVOR_COMPRESSED 0x00800000
451 #define SYMOPT_ALLOW_ZERO_ADDRESS 0x01000000
452 #define SYMOPT_DISABLE_SYMSRV_AUTODETECT 0x02000000
453 #define SYMOPT_READONLY_CACHE 0x04000000
454 #define SYMOPT_SYMPATH_LAST 0x08000000
455 #define SYMOPT_DISABLE_FAST_SYMBOLS 0x10000000
456 #define SYMOPT_DISABLE_SYMSRV_TIMEOUT 0x20000000
457 #define SYMOPT_DISABLE_SRVSTAR_ON_STARTUP 0x40000000
458 #define SYMOPT_DEBUG 0x80000000
460 typedef struct _IMAGEHLP_STACK_FRAME
462 ULONG64 InstructionOffset;
463 ULONG64 ReturnOffset;
464 ULONG64 FrameOffset;
465 ULONG64 StackOffset;
466 ULONG64 BackingStoreOffset;
467 ULONG64 FuncTableEntry;
468 ULONG64 Params[4];
469 ULONG64 Reserved[5];
470 BOOL Virtual;
471 ULONG Reserved2;
472 } IMAGEHLP_STACK_FRAME, *PIMAGEHLP_STACK_FRAME;
474 typedef VOID IMAGEHLP_CONTEXT, *PIMAGEHLP_CONTEXT;
476 #define DBHHEADER_DEBUGDIRS 0x1
477 typedef struct _DBGHELP_MODLOAD_DATA
479 DWORD ssize;
480 DWORD ssig;
481 PVOID data;
482 DWORD size;
483 DWORD flags;
484 } MODLOAD_DATA, *PMODLOAD_DATA;
486 /*************************
487 * MODULE handling *
488 *************************/
490 /* flags for SymLoadModuleEx */
491 #define SLMFLAG_VIRTUAL 0x1
492 #define SLMFLAG_NO_SYMBOLS 0x4
494 typedef BOOL (CALLBACK *PENUMLOADED_MODULES_CALLBACK64)(PCSTR, DWORD64, ULONG, PVOID);
495 BOOL WINAPI EnumerateLoadedModules64(HANDLE, PENUMLOADED_MODULES_CALLBACK64, PVOID);
496 typedef BOOL (CALLBACK *PENUMLOADED_MODULES_CALLBACKW64)(PCWSTR, DWORD64, ULONG, PVOID);
497 BOOL WINAPI EnumerateLoadedModulesW64(HANDLE, PENUMLOADED_MODULES_CALLBACKW64, PVOID);
498 BOOL WINAPI EnumerateLoadedModulesEx(HANDLE, PENUMLOADED_MODULES_CALLBACK64, PVOID);
499 BOOL WINAPI EnumerateLoadedModulesExW(HANDLE, PENUMLOADED_MODULES_CALLBACKW64, PVOID);
500 typedef BOOL (CALLBACK *PSYM_ENUMMODULES_CALLBACK64)(PCSTR, DWORD64, PVOID);
501 BOOL WINAPI SymEnumerateModules64(HANDLE, PSYM_ENUMMODULES_CALLBACK64, PVOID);
502 typedef BOOL (CALLBACK *PSYM_ENUMMODULES_CALLBACKW64)(PCWSTR, DWORD64, PVOID);
503 BOOL WINAPI SymEnumerateModulesW64(HANDLE, PSYM_ENUMMODULES_CALLBACKW64, PVOID);
504 BOOL WINAPI SymGetModuleInfo64(HANDLE, DWORD64, PIMAGEHLP_MODULE64);
505 BOOL WINAPI SymGetModuleInfoW64(HANDLE, DWORD64, PIMAGEHLP_MODULEW64);
506 DWORD64 WINAPI SymGetModuleBase64(HANDLE, DWORD64);
507 DWORD64 WINAPI SymLoadModule64(HANDLE, HANDLE, PCSTR, PCSTR, DWORD64, DWORD);
508 DWORD64 WINAPI SymLoadModuleEx(HANDLE, HANDLE, PCSTR, PCSTR, DWORD64, DWORD,
509 PMODLOAD_DATA, DWORD);
510 DWORD64 WINAPI SymLoadModuleExW(HANDLE, HANDLE, PCWSTR, PCWSTR, DWORD64, DWORD,
511 PMODLOAD_DATA, DWORD);
512 BOOL WINAPI SymUnloadModule64(HANDLE, DWORD64);
514 /*************************
515 * Symbol Handling *
516 *************************/
518 #define IMAGEHLP_SYMBOL_INFO_VALUEPRESENT 1
519 #define IMAGEHLP_SYMBOL_INFO_REGISTER SYMF_REGISTER /* 0x08 */
520 #define IMAGEHLP_SYMBOL_INFO_REGRELATIVE SYMF_REGREL /* 0x10 */
521 #define IMAGEHLP_SYMBOL_INFO_FRAMERELATIVE SYMF_FRAMEREL /* 0x20 */
522 #define IMAGEHLP_SYMBOL_INFO_PARAMETER SYMF_PARAMETER /* 0x40 */
523 #define IMAGEHLP_SYMBOL_INFO_LOCAL SYMF_LOCAL /* 0x80 */
524 #define IMAGEHLP_SYMBOL_INFO_CONSTANT SYMF_CONSTANT /* 0x100 */
525 #define IMAGEHLP_SYMBOL_FUNCTION SYMF_FUNCTION /* 0x800 */
527 #define SYMFLAG_VALUEPRESENT 0x00000001
528 #define SYMFLAG_REGISTER 0x00000008
529 #define SYMFLAG_REGREL 0x00000010
530 #define SYMFLAG_FRAMEREL 0x00000020
531 #define SYMFLAG_PARAMETER 0x00000040
532 #define SYMFLAG_LOCAL 0x00000080
533 #define SYMFLAG_CONSTANT 0x00000100
534 #define SYMFLAG_EXPORT 0x00000200
535 #define SYMFLAG_FORWARDER 0x00000400
536 #define SYMFLAG_FUNCTION 0x00000800
537 #define SYMFLAG_VIRTUAL 0x00001000
538 #define SYMFLAG_THUNK 0x00002000
539 #define SYMFLAG_TLSREL 0x00004000
540 #define SYMFLAG_SLOT 0x00008000
541 #define SYMFLAG_ILREL 0x00010000
542 #define SYMFLAG_METADATA 0x00020000
543 #define SYMFLAG_CLR_TOKEN 0x00040000
544 #define SYMFLAG_NULL 0x00080000
545 #define SYMFLAG_FUNC_NO_RETURN 0x00100000
546 #define SYMFLAG_SYNTHETIC_ZEROBASE 0x00200000
547 #define SYMFLAG_PUBLIC_CODE 0x00400000
549 #define MAX_SYM_NAME 2000
551 typedef struct _SYMBOL_INFO
553 ULONG SizeOfStruct;
554 ULONG TypeIndex;
555 ULONG64 Reserved[2];
556 ULONG Index;
557 ULONG Size;
558 ULONG64 ModBase;
559 ULONG Flags;
560 ULONG64 Value;
561 ULONG64 Address;
562 ULONG Register;
563 ULONG Scope;
564 ULONG Tag;
565 ULONG NameLen;
566 ULONG MaxNameLen;
567 CHAR Name[1];
568 } SYMBOL_INFO, *PSYMBOL_INFO;
570 typedef struct _SYMBOL_INFOW
572 ULONG SizeOfStruct;
573 ULONG TypeIndex;
574 ULONG64 Reserved[2];
575 ULONG Index;
576 ULONG Size;
577 ULONG64 ModBase;
578 ULONG Flags;
579 ULONG64 Value;
580 ULONG64 Address;
581 ULONG Register;
582 ULONG Scope;
583 ULONG Tag;
584 ULONG NameLen;
585 ULONG MaxNameLen;
586 WCHAR Name[1];
587 } SYMBOL_INFOW, *PSYMBOL_INFOW;
589 typedef struct _SYMBOL_INFO_PACKAGE
591 SYMBOL_INFO si;
592 CHAR name[MAX_SYM_NAME+1];
593 } SYMBOL_INFO_PACKAGE, *PSYMBOL_INFO_PACKAGE;
595 typedef struct _SYMBOL_INFO_PACKAGEW
597 SYMBOL_INFOW si;
598 WCHAR name[MAX_SYM_NAME+1];
599 } SYMBOL_INFO_PACKAGEW, *PSYMBOL_INFO_PACKAGEW;
601 typedef struct _SYMSRV_INDEX_INFO
603 DWORD sizeofstruct;
604 CHAR file[MAX_PATH + 1];
605 BOOL stripped;
606 DWORD timestamp;
607 DWORD size;
608 CHAR dbgfile[MAX_PATH + 1];
609 CHAR pdbfile[MAX_PATH + 1];
610 GUID guid;
611 DWORD sig;
612 DWORD age;
613 } SYMSRV_INDEX_INFO, *PSYMSRV_INDEX_INFO;
615 typedef struct
617 DWORD sizeofstruct;
618 WCHAR file[MAX_PATH + 1];
619 BOOL stripped;
620 DWORD timestamp;
621 DWORD size;
622 WCHAR dbgfile[MAX_PATH + 1];
623 WCHAR pdbfile[MAX_PATH + 1];
624 GUID guid;
625 DWORD sig;
626 DWORD age;
627 } SYMSRV_INDEX_INFOW, *PSYMSRV_INDEX_INFOW;
629 typedef enum _IMAGEHLP_SYMBOL_TYPE_INFO
631 TI_GET_SYMTAG,
632 TI_GET_SYMNAME,
633 TI_GET_LENGTH,
634 TI_GET_TYPE,
635 TI_GET_TYPEID,
636 TI_GET_BASETYPE,
637 TI_GET_ARRAYINDEXTYPEID,
638 TI_FINDCHILDREN,
639 TI_GET_DATAKIND,
640 TI_GET_ADDRESSOFFSET,
641 TI_GET_OFFSET,
642 TI_GET_VALUE,
643 TI_GET_COUNT,
644 TI_GET_CHILDRENCOUNT,
645 TI_GET_BITPOSITION,
646 TI_GET_VIRTUALBASECLASS,
647 TI_GET_VIRTUALTABLESHAPEID,
648 TI_GET_VIRTUALBASEPOINTEROFFSET,
649 TI_GET_CLASSPARENTID,
650 TI_GET_NESTED,
651 TI_GET_SYMINDEX,
652 TI_GET_LEXICALPARENT,
653 TI_GET_ADDRESS,
654 TI_GET_THISADJUST,
655 TI_GET_UDTKIND,
656 TI_IS_EQUIV_TO,
657 TI_GET_CALLING_CONVENTION,
658 TI_IS_CLOSE_EQUIV_TO,
659 TI_GTIEX_REQS_VALID,
660 TI_GET_VIRTUALBASEOFFSET,
661 TI_GET_VIRTUALBASEDISPINDEX,
662 TI_GET_IS_REFERENCE,
663 TI_GET_INDIRECTVIRTUALBASECLASS,
664 TI_GET_VIRTUALBASETABLETYPE,
665 TI_GET_OBJECTPOINTERTYPE,
666 IMAGEHLP_SYMBOL_TYPE_INFO_MAX
667 } IMAGEHLP_SYMBOL_TYPE_INFO;
669 #define IMAGEHLP_GET_TYPE_INFO_UNCACHED 0x00000001
670 #define IMAGEHLP_GET_TYPE_INFO_CHILDREN 0x00000002
671 typedef struct _IMAGEHLP_GET_TYPE_INFO_PARAMS
673 ULONG SizeOfStruct;
674 ULONG Flags;
675 ULONG NumIds;
676 PULONG TypeIds;
677 ULONG64 TagFilter;
678 ULONG NumReqs;
679 IMAGEHLP_SYMBOL_TYPE_INFO* ReqKinds;
680 PULONG_PTR ReqOffsets;
681 PULONG ReqSizes;
682 ULONG_PTR ReqStride;
683 ULONG_PTR BufferSize;
684 PVOID Buffer;
685 ULONG EntriesMatched;
686 ULONG EntriesFilled;
687 ULONG64 TagsFound;
688 ULONG64 AllReqsValid;
689 ULONG NumReqsValid;
690 PULONG64 ReqsValid;
691 } IMAGEHLP_GET_TYPE_INFO_PARAMS, *PIMAGEHLP_GET_TYPE_INFO_PARAMS;
693 typedef struct _TI_FINDCHILDREN_PARAMS
695 ULONG Count;
696 ULONG Start;
697 ULONG ChildId[1];
698 } TI_FINDCHILDREN_PARAMS;
700 #define UNDNAME_COMPLETE (0x0000)
701 #define UNDNAME_NO_LEADING_UNDERSCORES (0x0001)
702 #define UNDNAME_NO_MS_KEYWORDS (0x0002)
703 #define UNDNAME_NO_FUNCTION_RETURNS (0x0004)
704 #define UNDNAME_NO_ALLOCATION_MODEL (0x0008)
705 #define UNDNAME_NO_ALLOCATION_LANGUAGE (0x0010)
706 #define UNDNAME_NO_MS_THISTYPE (0x0020)
707 #define UNDNAME_NO_CV_THISTYPE (0x0040)
708 #define UNDNAME_NO_THISTYPE (0x0060)
709 #define UNDNAME_NO_ACCESS_SPECIFIERS (0x0080)
710 #define UNDNAME_NO_THROW_SIGNATURES (0x0100)
711 #define UNDNAME_NO_MEMBER_TYPE (0x0200)
712 #define UNDNAME_NO_RETURN_UDT_MODEL (0x0400)
713 #define UNDNAME_32_BIT_DECODE (0x0800)
714 #define UNDNAME_NAME_ONLY (0x1000)
715 #define UNDNAME_NO_ARGUMENTS (0x2000)
716 #define UNDNAME_NO_SPECIAL_SYMS (0x4000)
718 #define SYMSEARCH_MASKOBJS 0x01
719 #define SYMSEARCH_RECURSE 0x02
720 #define SYMSEARCH_GLOBALSONLY 0x04
722 BOOL WINAPI SymGetTypeInfo(HANDLE, DWORD64, ULONG, IMAGEHLP_SYMBOL_TYPE_INFO, PVOID);
723 BOOL WINAPI SymGetTypeInfoEx(HANDLE, DWORD64, PIMAGEHLP_GET_TYPE_INFO_PARAMS);
724 typedef BOOL (CALLBACK *PSYM_ENUMERATESYMBOLS_CALLBACK)(PSYMBOL_INFO, ULONG, PVOID);
725 typedef BOOL (CALLBACK *PSYM_ENUMERATESYMBOLS_CALLBACKW)(PSYMBOL_INFOW, ULONG, PVOID);
726 BOOL WINAPI SymEnumTypes(HANDLE, ULONG64, PSYM_ENUMERATESYMBOLS_CALLBACK, PVOID);
727 BOOL WINAPI SymEnumTypesW(HANDLE, ULONG64, PSYM_ENUMERATESYMBOLS_CALLBACKW, PVOID);
728 BOOL WINAPI SymEnumTypesByName(HANDLE, ULONG64, PCSTR, PSYM_ENUMERATESYMBOLS_CALLBACK, PVOID);
729 BOOL WINAPI SymEnumTypesByNameW(HANDLE, ULONG64, PCWSTR, PSYM_ENUMERATESYMBOLS_CALLBACKW, PVOID);
730 BOOL WINAPI SymFromAddr(HANDLE, DWORD64, DWORD64*, SYMBOL_INFO*);
731 BOOL WINAPI SymFromAddrW(HANDLE, DWORD64, DWORD64*, SYMBOL_INFOW*);
732 BOOL WINAPI SymFromInlineContext(HANDLE, DWORD64, ULONG, PDWORD64, PSYMBOL_INFO);
733 BOOL WINAPI SymFromInlineContextW(HANDLE, DWORD64, ULONG, PDWORD64, PSYMBOL_INFOW);
734 BOOL WINAPI SymFromToken(HANDLE, DWORD64, DWORD, PSYMBOL_INFO);
735 BOOL WINAPI SymFromTokenW(HANDLE, DWORD64, DWORD, PSYMBOL_INFOW);
736 BOOL WINAPI SymFromName(HANDLE, PCSTR, PSYMBOL_INFO);
737 BOOL WINAPI SymFromNameW(HANDLE, PCWSTR, PSYMBOL_INFOW);
738 BOOL WINAPI SymGetSymFromAddr64(HANDLE, DWORD64, PDWORD64, PIMAGEHLP_SYMBOL64);
739 BOOL WINAPI SymGetSymFromName64(HANDLE, PCSTR, PIMAGEHLP_SYMBOL64);
740 BOOL WINAPI SymGetTypeFromName(HANDLE, ULONG64, PCSTR, PSYMBOL_INFO);
741 BOOL WINAPI SymGetTypeFromNameW(HANDLE, ULONG64, PCWSTR, PSYMBOL_INFOW);
742 BOOL WINAPI SymGetSymNext64(HANDLE, PIMAGEHLP_SYMBOL64);
743 BOOL WINAPI SymGetSymNextW64(HANDLE, PIMAGEHLP_SYMBOLW64);
744 BOOL WINAPI SymGetSymPrev64(HANDLE, PIMAGEHLP_SYMBOL64);
745 BOOL WINAPI SymGetSymPrevW64(HANDLE, PIMAGEHLP_SYMBOLW64);
746 BOOL WINAPI SymEnumSym(HANDLE,ULONG64,PSYM_ENUMERATESYMBOLS_CALLBACK,PVOID);
747 BOOL WINAPI SymEnumSymbols(HANDLE, ULONG64, PCSTR, PSYM_ENUMERATESYMBOLS_CALLBACK,
748 PVOID);
749 BOOL WINAPI SymEnumSymbolsW(HANDLE, ULONG64, PCWSTR, PSYM_ENUMERATESYMBOLS_CALLBACKW,
750 PVOID);
751 typedef BOOL (CALLBACK *PSYM_ENUMSYMBOLS_CALLBACK64)(PCSTR, DWORD64, ULONG, PVOID);
752 typedef BOOL (CALLBACK *PSYM_ENUMSYMBOLS_CALLBACK64W)(PCWSTR, DWORD64, ULONG, PVOID);
753 BOOL WINAPI SymEnumerateSymbols64(HANDLE, ULONG64, PSYM_ENUMSYMBOLS_CALLBACK64, PVOID);
754 BOOL WINAPI SymEnumerateSymbolsW64(HANDLE, ULONG64, PSYM_ENUMSYMBOLS_CALLBACK64W, PVOID);
755 BOOL WINAPI SymEnumSymbolsForAddr(HANDLE, DWORD64, PSYM_ENUMERATESYMBOLS_CALLBACK, PVOID);
756 BOOL WINAPI SymEnumSymbolsForAddrW(HANDLE, DWORD64, PSYM_ENUMERATESYMBOLS_CALLBACKW, PVOID);
757 typedef BOOL (CALLBACK *PSYMBOL_REGISTERED_CALLBACK64)(HANDLE, ULONG, ULONG64, ULONG64);
758 BOOL WINAPI SymRegisterCallback64(HANDLE, PSYMBOL_REGISTERED_CALLBACK64, ULONG64);
759 BOOL WINAPI SymRegisterCallbackW64(HANDLE, PSYMBOL_REGISTERED_CALLBACK64, ULONG64);
760 BOOL WINAPI SymUnDName64(PIMAGEHLP_SYMBOL64, PSTR, DWORD);
761 BOOL WINAPI SymMatchString(PCSTR, PCSTR, BOOL);
762 BOOL WINAPI SymMatchStringA(PCSTR, PCSTR, BOOL);
763 BOOL WINAPI SymMatchStringW(PCWSTR, PCWSTR, BOOL);
764 BOOL WINAPI SymSearch(HANDLE, ULONG64, DWORD, DWORD, PCSTR, DWORD64, PSYM_ENUMERATESYMBOLS_CALLBACK, PVOID, DWORD);
765 BOOL WINAPI SymSearchW(HANDLE, ULONG64, DWORD, DWORD, PCWSTR, DWORD64, PSYM_ENUMERATESYMBOLS_CALLBACKW, PVOID, DWORD);
766 DWORD WINAPI UnDecorateSymbolName(PCSTR, PSTR, DWORD, DWORD);
767 DWORD WINAPI UnDecorateSymbolNameW(PCWSTR, PWSTR, DWORD, DWORD);
768 BOOL WINAPI SymGetScope(HANDLE, ULONG64, DWORD, PSYMBOL_INFO);
769 BOOL WINAPI SymGetScopeW(HANDLE, ULONG64, DWORD, PSYMBOL_INFOW);
770 BOOL WINAPI SymFromIndex(HANDLE, ULONG64, DWORD, PSYMBOL_INFO);
771 BOOL WINAPI SymFromIndexW(HANDLE, ULONG64, DWORD, PSYMBOL_INFOW);
772 BOOL WINAPI SymAddSymbol(HANDLE, ULONG64, PCSTR, DWORD64, DWORD, DWORD);
773 BOOL WINAPI SymAddSymbolW(HANDLE, ULONG64, PCWSTR, DWORD64, DWORD, DWORD);
774 BOOL WINAPI SymDeleteSymbol(HANDLE, ULONG64, PCSTR, DWORD64, DWORD);
775 BOOL WINAPI SymDeleteSymbolW(HANDLE, ULONG64, PCWSTR, DWORD64, DWORD);
777 typedef struct _OMAP
779 ULONG rva;
780 ULONG rvaTo;
781 } OMAP, *POMAP;
783 BOOL WINAPI SymGetOmaps(HANDLE, DWORD64, POMAP*, PDWORD64, POMAP*, PDWORD64);
785 /*************************
786 * Source Files *
787 *************************/
788 typedef BOOL (CALLBACK *PSYM_ENUMSOURCEFILES_CALLBACK)(PSOURCEFILE, PVOID);
789 typedef BOOL (CALLBACK *PSYM_ENUMSOURCEFILES_CALLBACKW)(PSOURCEFILEW, PVOID);
791 BOOL WINAPI SymEnumSourceFiles(HANDLE, ULONG64, PCSTR, PSYM_ENUMSOURCEFILES_CALLBACK,
792 PVOID);
793 BOOL WINAPI SymEnumSourceFilesW(HANDLE, ULONG64, PCWSTR, PSYM_ENUMSOURCEFILES_CALLBACKW, PVOID);
794 BOOL WINAPI SymGetLineFromAddr64(HANDLE, DWORD64, PDWORD, PIMAGEHLP_LINE64);
795 BOOL WINAPI SymGetLineFromAddrW64(HANDLE, DWORD64, PDWORD, PIMAGEHLP_LINEW64);
796 BOOL WINAPI SymGetLineFromInlineContext(HANDLE, DWORD64, ULONG, DWORD64, PDWORD, PIMAGEHLP_LINE64);
797 BOOL WINAPI SymGetLineFromInlineContextW(HANDLE, DWORD64, ULONG, DWORD64, PDWORD, PIMAGEHLP_LINEW64);
798 BOOL WINAPI SymGetLinePrev64(HANDLE, PIMAGEHLP_LINE64);
799 BOOL WINAPI SymGetLinePrevW64(HANDLE, PIMAGEHLP_LINEW64);
800 BOOL WINAPI SymGetLineNext64(HANDLE, PIMAGEHLP_LINE64);
801 BOOL WINAPI SymGetLineNextW64(HANDLE, PIMAGEHLP_LINEW64);
802 BOOL WINAPI SymGetLineFromName64(HANDLE, PCSTR, PCSTR, DWORD, PLONG, PIMAGEHLP_LINE64);
803 BOOL WINAPI SymGetLineFromNameW64(HANDLE, PCWSTR, PCWSTR, DWORD, PLONG, PIMAGEHLP_LINEW64);
804 ULONG WINAPI SymGetFileLineOffsets64(HANDLE, PCSTR, PCSTR, PDWORD64, ULONG);
805 BOOL WINAPI SymGetSourceFile(HANDLE, ULONG64, PCSTR, PCSTR, PSTR, DWORD);
806 BOOL WINAPI SymGetSourceFileW(HANDLE, ULONG64, PCWSTR, PCWSTR, PWSTR, DWORD);
807 BOOL WINAPI SymGetSourceFileToken(HANDLE, ULONG64, PCSTR, PVOID*, DWORD*);
808 BOOL WINAPI SymGetSourceFileTokenW(HANDLE, ULONG64, PCWSTR, PVOID*, DWORD*);
809 BOOL WINAPI SymGetSourceFileFromToken(HANDLE, PVOID, PCSTR, PSTR, DWORD);
810 BOOL WINAPI SymGetSourceFileFromTokenW(HANDLE, PVOID, PCWSTR, PWSTR, DWORD);
811 BOOL WINAPI SymGetSourceVarFromToken(HANDLE, PVOID, PCSTR, PCSTR, PSTR, DWORD);
812 BOOL WINAPI SymGetSourceVarFromTokenW(HANDLE, PVOID, PCWSTR, PCWSTR, PWSTR, DWORD);
814 typedef struct _SRCCODEINFO
816 DWORD SizeOfStruct;
817 PVOID Key;
818 DWORD64 ModBase;
819 CHAR Obj[MAX_PATH+1];
820 CHAR FileName[MAX_PATH+1];
821 DWORD LineNumber;
822 DWORD64 Address;
823 } SRCCODEINFO, *PSRCCODEINFO;
825 typedef struct _SRCCODEINFOW
827 DWORD SizeOfStruct;
828 PVOID Key;
829 DWORD64 ModBase;
830 WCHAR Obj[MAX_PATH+1];
831 WCHAR FileName[MAX_PATH+1];
832 DWORD LineNumber;
833 DWORD64 Address;
834 } SRCCODEINFOW, *PSRCCODEINFOW;
836 typedef BOOL (CALLBACK* PSYM_ENUMLINES_CALLBACK)(PSRCCODEINFO, PVOID);
837 typedef BOOL (CALLBACK* PSYM_ENUMLINES_CALLBACKW)(PSRCCODEINFOW, PVOID);
838 BOOL WINAPI SymEnumLines(HANDLE, ULONG64, PCSTR, PCSTR, PSYM_ENUMLINES_CALLBACK, PVOID);
839 BOOL WINAPI SymEnumLinesW(HANDLE, ULONG64, PCWSTR, PCWSTR, PSYM_ENUMLINES_CALLBACKW, PVOID);
840 BOOL WINAPI SymEnumSourceLines(HANDLE, ULONG64, PCSTR, PCSTR, DWORD, DWORD, PSYM_ENUMLINES_CALLBACK, PVOID);
841 BOOL WINAPI SymEnumSourceLinesW(HANDLE, ULONG64, PCWSTR, PCWSTR, DWORD, DWORD, PSYM_ENUMLINES_CALLBACKW, PVOID);
843 /*************************
844 * File & image handling *
845 *************************/
846 BOOL WINAPI SymInitialize(HANDLE, PCSTR, BOOL);
847 BOOL WINAPI SymInitializeW(HANDLE, PCWSTR, BOOL);
848 BOOL WINAPI SymCleanup(HANDLE);
850 HANDLE WINAPI FindDebugInfoFile(PCSTR, PCSTR, PSTR);
851 typedef BOOL (CALLBACK *PFIND_DEBUG_FILE_CALLBACK)(HANDLE, PCSTR, PVOID);
852 typedef BOOL (CALLBACK *PFIND_DEBUG_FILE_CALLBACKW)(HANDLE, PCWSTR, PVOID);
853 HANDLE WINAPI FindDebugInfoFileEx(PCSTR, PCSTR, PSTR, PFIND_DEBUG_FILE_CALLBACK, PVOID);
854 HANDLE WINAPI FindDebugInfoFileExW(PCWSTR, PCWSTR, PWSTR, PFIND_DEBUG_FILE_CALLBACKW, PVOID);
855 HANDLE WINAPI SymFindDebugInfoFile(HANDLE, PCSTR, PSTR, PFIND_DEBUG_FILE_CALLBACK, PVOID);
856 HANDLE WINAPI SymFindDebugInfoFileW(HANDLE, PCWSTR, PWSTR, PFIND_DEBUG_FILE_CALLBACKW, PVOID);
857 typedef BOOL (CALLBACK *PFINDFILEINPATHCALLBACK)(PCSTR, PVOID);
858 typedef BOOL (CALLBACK *PFINDFILEINPATHCALLBACKW)(PCWSTR, PVOID);
859 BOOL WINAPI FindFileInPath(HANDLE, PCSTR, PCSTR, PVOID, DWORD, DWORD, DWORD,
860 PSTR, PFINDFILEINPATHCALLBACK, PVOID);
861 BOOL WINAPI SymFindFileInPath(HANDLE, PCSTR, PCSTR, PVOID, DWORD, DWORD, DWORD,
862 PSTR, PFINDFILEINPATHCALLBACK, PVOID);
863 BOOL WINAPI SymFindFileInPathW(HANDLE, PCWSTR, PCWSTR, PVOID, DWORD, DWORD, DWORD,
864 PWSTR, PFINDFILEINPATHCALLBACKW, PVOID);
865 HANDLE WINAPI FindExecutableImage(PCSTR, PCSTR, PSTR);
866 typedef BOOL (CALLBACK *PFIND_EXE_FILE_CALLBACK)(HANDLE, PCSTR, PVOID);
867 typedef BOOL (CALLBACK *PFIND_EXE_FILE_CALLBACKW)(HANDLE, PCWSTR, PVOID);
868 HANDLE WINAPI FindExecutableImageEx(PCSTR, PCSTR, PSTR, PFIND_EXE_FILE_CALLBACK, PVOID);
869 HANDLE WINAPI FindExecutableImageExW(PCWSTR, PCWSTR, PWSTR, PFIND_EXE_FILE_CALLBACKW, PVOID);
870 HANDLE WINAPI SymFindExecutableImage(HANDLE, PCSTR, PSTR, PFIND_EXE_FILE_CALLBACK, PVOID);
871 HANDLE WINAPI SymFindExecutableImageW(HANDLE, PCWSTR, PWSTR, PFIND_EXE_FILE_CALLBACKW, PVOID);
872 PIMAGE_NT_HEADERS WINAPI ImageNtHeader(PVOID);
873 PVOID WINAPI ImageDirectoryEntryToDataEx(PVOID, BOOLEAN, USHORT, PULONG,
874 PIMAGE_SECTION_HEADER *);
875 PVOID WINAPI ImageDirectoryEntryToData(PVOID, BOOLEAN, USHORT, PULONG);
876 PIMAGE_SECTION_HEADER WINAPI ImageRvaToSection(PIMAGE_NT_HEADERS, PVOID, ULONG);
877 PVOID WINAPI ImageRvaToVa(PIMAGE_NT_HEADERS, PVOID, ULONG, PIMAGE_SECTION_HEADER*);
878 BOOL WINAPI SymGetSearchPath(HANDLE, PSTR, DWORD);
879 BOOL WINAPI SymGetSearchPathW(HANDLE, PWSTR, DWORD);
880 BOOL WINAPI SymSetSearchPath(HANDLE, PCSTR);
881 BOOL WINAPI SymSetSearchPathW(HANDLE, PCWSTR);
882 DWORD WINAPI GetTimestampForLoadedLibrary(HMODULE);
883 BOOL WINAPI MakeSureDirectoryPathExists(PCSTR);
884 BOOL WINAPI SearchTreeForFile(PCSTR, PCSTR, PSTR);
885 BOOL WINAPI SearchTreeForFileW(PCWSTR, PCWSTR, PWSTR);
886 typedef BOOL (CALLBACK *PENUMDIRTREE_CALLBACK)(PCSTR, PVOID);
887 typedef BOOL (CALLBACK *PENUMDIRTREE_CALLBACKW)(PCWSTR, PVOID);
888 BOOL WINAPI EnumDirTree(HANDLE, PCSTR, PCSTR, PSTR, PENUMDIRTREE_CALLBACK, PVOID);
889 BOOL WINAPI EnumDirTreeW(HANDLE, PCWSTR, PCWSTR, PWSTR, PENUMDIRTREE_CALLBACKW, PVOID);
890 BOOL WINAPI SymMatchFileName(PCSTR, PCSTR, PSTR*, PSTR*);
891 BOOL WINAPI SymMatchFileNameW(PCWSTR, PCWSTR, PWSTR*, PWSTR*);
892 PCHAR WINAPI SymSetHomeDirectory(HANDLE, PCSTR);
893 PWSTR WINAPI SymSetHomeDirectoryW(HANDLE, PCWSTR);
894 PCHAR WINAPI SymGetHomeDirectory(DWORD, PSTR, size_t);
895 PWSTR WINAPI SymGetHomeDirectoryW(DWORD, PWSTR, size_t);
896 #define hdBase 0
897 #define hdSym 1
898 #define hdSrc 2
899 #define hdMax 3
901 /*************************
902 * Context management *
903 *************************/
904 BOOL WINAPI SymSetContext(HANDLE, PIMAGEHLP_STACK_FRAME, PIMAGEHLP_CONTEXT);
905 BOOL WINAPI SymSetScopeFromIndex(HANDLE, ULONG64, ULONG);
906 BOOL WINAPI SymSetScopeFromAddr(HANDLE, ULONG64);
907 BOOL WINAPI SymSetScopeFromInlineContext(HANDLE, ULONG64, ULONG);
909 /*************************
910 * Stack management *
911 *************************/
913 #if !defined(_IMAGEHLP_SOURCE_) && defined(_IMAGEHLP64)
914 #define KDHELP KDHELP64
915 #define PKDHELP PKDHELP64
916 #else
917 typedef struct _KDHELP
919 DWORD Thread;
920 DWORD ThCallbackStack;
921 DWORD NextCallback;
922 DWORD FramePointer;
923 DWORD KiCallUserMode;
924 DWORD KeUserCallbackDispatcher;
925 DWORD SystemRangeStart;
926 } KDHELP, *PKDHELP;
927 #endif
929 typedef struct _KDHELP64
931 DWORD64 Thread;
932 DWORD ThCallbackStack;
933 DWORD ThCallbackBStore;
934 DWORD NextCallback;
935 DWORD FramePointer;
936 DWORD64 KiCallUserMode;
937 DWORD64 KeUserCallbackDispatcher;
938 DWORD64 SystemRangeStart;
939 DWORD64 Reserved[8];
940 } KDHELP64, *PKDHELP64;
942 #if !defined(_IMAGEHLP_SOURCE_) && defined(_IMAGEHLP64)
943 #define STACKFRAME STACKFRAME64
944 #define LPSTACKFRAME LPSTACKFRAME64
945 #else
946 typedef struct _STACKFRAME
948 ADDRESS AddrPC;
949 ADDRESS AddrReturn;
950 ADDRESS AddrFrame;
951 ADDRESS AddrStack;
952 PVOID FuncTableEntry;
953 DWORD Params[4];
954 BOOL Far;
955 BOOL Virtual;
956 DWORD Reserved[3];
957 KDHELP KdHelp;
958 ADDRESS AddrBStore;
959 } STACKFRAME, *LPSTACKFRAME;
960 #endif
962 typedef struct _STACKFRAME64
964 ADDRESS64 AddrPC;
965 ADDRESS64 AddrReturn;
966 ADDRESS64 AddrFrame;
967 ADDRESS64 AddrStack;
968 ADDRESS64 AddrBStore;
969 PVOID FuncTableEntry;
970 DWORD64 Params[4];
971 BOOL Far;
972 BOOL Virtual;
973 DWORD64 Reserved[3];
974 KDHELP64 KdHelp;
975 } STACKFRAME64, *LPSTACKFRAME64;
977 #define INLINE_FRAME_CONTEXT_INIT 0
978 #define INLINE_FRAME_CONTEXT_IGNORE 0xFFFFFFFF
980 typedef struct _tagSTACKFRAME_EX
982 ADDRESS64 AddrPC;
983 ADDRESS64 AddrReturn;
984 ADDRESS64 AddrFrame;
985 ADDRESS64 AddrStack;
986 ADDRESS64 AddrBStore;
987 PVOID FuncTableEntry;
988 DWORD64 Params[4];
989 BOOL Far;
990 BOOL Virtual;
991 DWORD64 Reserved[3];
992 KDHELP64 KdHelp;
994 DWORD StackFrameSize;
995 DWORD InlineFrameContext;
996 } STACKFRAME_EX, *LPSTACKFRAME_EX;
999 typedef BOOL (CALLBACK *PREAD_PROCESS_MEMORY_ROUTINE64)
1000 (HANDLE, DWORD64, PVOID, DWORD, PDWORD);
1001 typedef PVOID (CALLBACK *PFUNCTION_TABLE_ACCESS_ROUTINE64)(HANDLE, DWORD64);
1002 typedef DWORD64 (CALLBACK *PGET_MODULE_BASE_ROUTINE64)(HANDLE, DWORD64);
1003 typedef DWORD64 (CALLBACK *PTRANSLATE_ADDRESS_ROUTINE64)(HANDLE, HANDLE, LPADDRESS64);
1004 BOOL WINAPI StackWalk64(DWORD, HANDLE, HANDLE, LPSTACKFRAME64, PVOID,
1005 PREAD_PROCESS_MEMORY_ROUTINE64,
1006 PFUNCTION_TABLE_ACCESS_ROUTINE64,
1007 PGET_MODULE_BASE_ROUTINE64,
1008 PTRANSLATE_ADDRESS_ROUTINE64);
1009 #define SYM_STKWALK_DEFAULT 0x00000000
1010 #define SYM_STKWALK_FORCE_FRAMEPTR 0x00000001
1011 BOOL WINAPI StackWalkEx(DWORD, HANDLE, HANDLE, LPSTACKFRAME_EX, PVOID,
1012 PREAD_PROCESS_MEMORY_ROUTINE64,
1013 PFUNCTION_TABLE_ACCESS_ROUTINE64,
1014 PGET_MODULE_BASE_ROUTINE64,
1015 PTRANSLATE_ADDRESS_ROUTINE64,
1016 DWORD);
1017 PVOID WINAPI SymFunctionTableAccess64(HANDLE, DWORD64);
1019 typedef PVOID (CALLBACK *PSYMBOL_FUNCENTRY_CALLBACK64)(HANDLE, ULONG64, ULONG64);
1021 BOOL WINAPI SymRegisterFunctionEntryCallback64(HANDLE, PSYMBOL_FUNCENTRY_CALLBACK64, ULONG64);
1022 BOOL WINAPI SymGetUnwindInfo(HANDLE, DWORD64, PVOID, PULONG);
1024 /* Inline context related APIs */
1025 DWORD WINAPI SymAddrIncludeInlineTrace(HANDLE, DWORD64);
1027 #define SYM_INLINE_COMP_ERROR 0
1028 #define SYM_INLINE_COMP_IDENTICAL 1
1029 #define SYM_INLINE_COMP_STEPIN 2
1030 #define SYM_INLINE_COMP_STEPOUT 3
1031 #define SYM_INLINE_COMP_STEPOVER 4
1032 #define SYM_INLINE_COMP_DIFFERENT 5
1034 DWORD WINAPI SymCompareInlineTrace(HANDLE, DWORD64, DWORD, DWORD64, DWORD64, DWORD64);
1035 BOOL WINAPI SymQueryInlineTrace(HANDLE, DWORD64, DWORD, DWORD64, DWORD64, LPDWORD, LPDWORD);
1037 /*************************
1038 * Version, global stuff *
1039 *************************/
1041 #define API_VERSION_NUMBER 9
1043 typedef struct API_VERSION
1045 USHORT MajorVersion;
1046 USHORT MinorVersion;
1047 USHORT Revision;
1048 USHORT Reserved;
1049 } API_VERSION, *LPAPI_VERSION;
1051 LPAPI_VERSION WINAPI ImagehlpApiVersion(void);
1052 LPAPI_VERSION WINAPI ImagehlpApiVersionEx(LPAPI_VERSION);
1054 #ifndef _WIN64
1055 typedef struct _IMAGE_DEBUG_INFORMATION
1057 LIST_ENTRY List;
1058 DWORD ReservedSize;
1059 PVOID ReservedMappedBase;
1060 USHORT ReservedMachine;
1061 USHORT ReservedCharacteristics;
1062 DWORD ReservedCheckSum;
1063 DWORD ImageBase;
1064 DWORD SizeOfImage;
1065 DWORD ReservedNumberOfSections;
1066 PIMAGE_SECTION_HEADER ReservedSections;
1067 DWORD ReservedExportedNamesSize;
1068 PSTR ReservedExportedNames;
1069 DWORD ReservedNumberOfFunctionTableEntries;
1070 PIMAGE_FUNCTION_ENTRY ReservedFunctionTableEntries;
1071 DWORD ReservedLowestFunctionStartingAddress;
1072 DWORD ReservedHighestFunctionEndingAddress;
1073 DWORD ReservedNumberOfFpoTableEntries;
1074 PFPO_DATA ReservedFpoTableEntries;
1075 DWORD SizeOfCoffSymbols;
1076 PIMAGE_COFF_SYMBOLS_HEADER CoffSymbols;
1077 DWORD ReservedSizeOfCodeViewSymbols;
1078 PVOID ReservedCodeViewSymbols;
1079 PSTR ImageFilePath;
1080 PSTR ImageFileName;
1081 PSTR ReservedDebugFilePath;
1082 DWORD ReservedTimeDateStamp;
1083 BOOL ReservedRomImage;
1084 PIMAGE_DEBUG_DIRECTORY ReservedDebugDirectory;
1085 DWORD ReservedNumberOfDebugDirectories;
1086 DWORD ReservedOriginalFunctionTableBaseAddress;
1087 DWORD Reserved[ 2 ];
1088 } IMAGE_DEBUG_INFORMATION, *PIMAGE_DEBUG_INFORMATION;
1090 PIMAGE_DEBUG_INFORMATION WINAPI MapDebugInformation(HANDLE, PCSTR, PCSTR, ULONG);
1091 BOOL WINAPI UnmapDebugInformation(PIMAGE_DEBUG_INFORMATION);
1092 #endif
1094 typedef enum
1096 SYMOPT_EX_DISABLEACCESSTIMEUPDATE,
1097 SYMOPT_EX_MAX,
1099 #ifdef __WINESRC__
1100 SYMOPT_EX_WINE_NATIVE_MODULES = 1000,
1101 #endif
1102 } IMAGEHLP_EXTENDED_OPTIONS;
1104 DWORD WINAPI SymGetOptions(void);
1105 DWORD WINAPI SymSetOptions(DWORD);
1107 BOOL WINAPI SymGetExtendedOption(IMAGEHLP_EXTENDED_OPTIONS option);
1108 BOOL WINAPI SymSetExtendedOption(IMAGEHLP_EXTENDED_OPTIONS option, BOOL value);
1110 BOOL WINAPI SymSetParentWindow(HWND);
1112 /*************************
1113 * Version, global stuff *
1114 *************************/
1116 typedef BOOL (WINAPI* PSYMBOLSERVERPROC)(PCSTR, PCSTR, PVOID, DWORD, DWORD, PSTR);
1117 typedef BOOL (WINAPI* PSYMBOLSERVERPROCA)(PCSTR, PCSTR, PVOID, DWORD, DWORD, PSTR);
1118 typedef BOOL (WINAPI* PSYMBOLSERVERPROCW)(PCWSTR, PCWSTR, PVOID, DWORD, DWORD, PWSTR);
1119 typedef BOOL (WINAPI* PSYMBOLSERVEROPENPROC)(void);
1120 typedef BOOL (WINAPI* PSYMBOLSERVERCLOSEPROC)(void);
1121 typedef BOOL (WINAPI* PSYMBOLSERVERSETOPTIONSPROC)(UINT_PTR, ULONG64);
1122 typedef BOOL (CALLBACK* PSYMBOLSERVERCALLBACKPROC)(UINT_PTR, ULONG64, ULONG64);
1123 typedef UINT_PTR (WINAPI* PSYMBOLSERVERGETOPTIONSPROC)(void);
1124 typedef BOOL (WINAPI* PSYMBOLSERVERPINGPROC)(PCSTR);
1125 typedef BOOL (WINAPI* PSYMBOLSERVERPINGPROCA)(PCSTR);
1126 typedef BOOL (WINAPI* PSYMBOLSERVERPINGPROCW)(PCWSTR);
1128 #define SSRVOPT_CALLBACK 0x0001
1129 #define SSRVOPT_DWORD 0x0002
1130 #define SSRVOPT_DWORDPTR 0x0004
1131 #define SSRVOPT_GUIDPTR 0x0008
1132 #define SSRVOPT_OLDGUIDPTR 0x0010
1133 #define SSRVOPT_UNATTENDED 0x0020
1134 #define SSRVOPT_NOCOPY 0x0040
1135 #define SSRVOPT_PARENTWIN 0x0080
1136 #define SSRVOPT_PARAMTYPE 0x0100
1137 #define SSRVOPT_SECURE 0x0200
1138 #define SSRVOPT_TRACE 0x0400
1139 #define SSRVOPT_SETCONTEXT 0x0800
1140 #define SSRVOPT_PROXY 0x1000
1141 #define SSRVOPT_DOWNSTREAM_STORE 0x2000
1142 #define SSRVOPT_RESET ((ULONG_PTR)-1)
1144 #define SSRVACTION_TRACE 1
1145 #define SSRVACTION_QUERYCANCEL 2
1146 #define SSRVACTION_EVENT 3
1148 /* 32-bit functions */
1150 #if !defined(_IMAGEHLP_SOURCE_) && defined(_IMAGEHLP64)
1152 #define PENUMLOADED_MODULES_CALLBACK PENUMLOADED_MODULES_CALLBACK64
1153 #define PFUNCTION_TABLE_ACCESS_ROUTINE PFUNCTION_TABLE_ACCESS_ROUTINE64
1154 #define PGET_MODULE_BASE_ROUTINE PGET_MODULE_BASE_ROUTINE64
1155 #define PREAD_PROCESS_MEMORY_ROUTINE PREAD_PROCESS_MEMORY_ROUTINE64
1156 #define PSYMBOL_FUNCENTRY_CALLBACK PSYMBOL_FUNCENTRY_CALLBACK64
1157 #define PSYMBOL_REGISTERED_CALLBACK PSYMBOL_REGISTERED_CALLBACK64
1158 #define PSYM_ENUMMODULES_CALLBACK PSYM_ENUMMODULES_CALLBACK64
1159 #define PSYM_ENUMSYMBOLS_CALLBACK PSYM_ENUMSYMBOLS_CALLBACK64
1160 #define PSYM_ENUMSYMBOLS_CALLBACKW PSYM_ENUMSYMBOLS_CALLBACKW64
1161 #define PTRANSLATE_ADDRESS_ROUTINE PTRANSLATE_ADDRESS_ROUTINE64
1163 #define EnumerateLoadedModules EnumerateLoadedModules64
1164 #define StackWalk StackWalk64
1165 #define SymEnumerateModules SymEnumerateModules64
1166 #define SymEnumerateSymbols SymEnumerateSymbols64
1167 #define SymEnumerateSymbolsW SymEnumerateSymbolsW64
1168 #define SymFunctionTableAccess SymFunctionTableAccess64
1169 #define SymGetLineFromAddr SymGetLineFromAddr64
1170 #define SymGetLineFromAddrW SymGetLineFromAddrW64
1171 #define SymGetLineFromName SymGetLineFromName64
1172 #define SymGetLineNext SymGetLineNext64
1173 #define SymGetLineNextW SymGetLineNextW64
1174 #define SymGetLinePrev SymGetLinePrev64
1175 #define SymGetLinePrevW SymGetLinePrevW64
1176 #define SymGetModuleBase SymGetModuleBase64
1177 #define SymGetModuleInfo SymGetModuleInfo64
1178 #define SymGetModuleInfoW SymGetModuleInfoW64
1179 #define SymGetSymFromAddr SymGetSymFromAddr64
1180 #define SymGetSymFromName SymGetSymFromName64
1181 #define SymGetSymNext SymGetSymNext64
1182 #define SymGetSymNextW SymGetSymNextW64
1183 #define SymGetSymPrev SymGetSymPrev64
1184 #define SymGetSymPrevW SymGetSymPrevW64
1185 #define SymLoadModule SymLoadModule64
1186 #define SymRegisterCallback SymRegisterCallback64
1187 #define SymRegisterFunctionEntryCallback SymRegisterFunctionEntryCallback64
1188 #define SymUnDName SymUnDName64
1189 #define SymUnloadModule SymUnloadModule64
1191 #else
1193 typedef BOOL (CALLBACK *PENUMLOADED_MODULES_CALLBACK)(PCSTR, ULONG, ULONG, PVOID);
1194 typedef PVOID (CALLBACK *PFUNCTION_TABLE_ACCESS_ROUTINE)(HANDLE, DWORD);
1195 typedef DWORD (CALLBACK *PGET_MODULE_BASE_ROUTINE)(HANDLE, DWORD);
1196 typedef BOOL (CALLBACK *PREAD_PROCESS_MEMORY_ROUTINE)(HANDLE, DWORD, PVOID, DWORD, PDWORD);
1197 typedef BOOL (CALLBACK *PSYM_ENUMMODULES_CALLBACK)(PCSTR, ULONG, PVOID);
1198 typedef BOOL (CALLBACK *PSYM_ENUMSYMBOLS_CALLBACK)(PCSTR, ULONG, ULONG, PVOID);
1199 typedef BOOL (CALLBACK *PSYM_ENUMSYMBOLS_CALLBACKW)(PCWSTR, ULONG, ULONG, PVOID);
1200 typedef BOOL (CALLBACK *PSYMBOL_REGISTERED_CALLBACK)(HANDLE, ULONG, PVOID, PVOID);
1201 typedef PVOID (CALLBACK *PSYMBOL_FUNCENTRY_CALLBACK)(HANDLE, DWORD, PVOID);
1202 typedef DWORD (CALLBACK *PTRANSLATE_ADDRESS_ROUTINE)(HANDLE, HANDLE, LPADDRESS);
1204 BOOL WINAPI EnumerateLoadedModules(HANDLE, PENUMLOADED_MODULES_CALLBACK, PVOID);
1205 BOOL WINAPI StackWalk(DWORD, HANDLE, HANDLE, LPSTACKFRAME, PVOID, PREAD_PROCESS_MEMORY_ROUTINE, PFUNCTION_TABLE_ACCESS_ROUTINE, PGET_MODULE_BASE_ROUTINE, PTRANSLATE_ADDRESS_ROUTINE);
1206 BOOL WINAPI SymEnumerateModules(HANDLE, PSYM_ENUMMODULES_CALLBACK, PVOID);
1207 BOOL WINAPI SymEnumerateSymbols(HANDLE, ULONG, PSYM_ENUMSYMBOLS_CALLBACK, PVOID);
1208 BOOL WINAPI SymEnumerateSymbolsW(HANDLE, ULONG, PSYM_ENUMSYMBOLS_CALLBACKW, PVOID);
1209 PVOID WINAPI SymFunctionTableAccess(HANDLE, DWORD);
1210 BOOL WINAPI SymGetLineFromAddr(HANDLE, DWORD, PDWORD, PIMAGEHLP_LINE);
1211 BOOL WINAPI SymGetLineFromAddrW(HANDLE, DWORD, PDWORD, PIMAGEHLP_LINEW);
1212 BOOL WINAPI SymGetLineFromName(HANDLE, PCSTR, PCSTR, DWORD, PLONG, PIMAGEHLP_LINE);
1213 BOOL WINAPI SymGetLineNext(HANDLE, PIMAGEHLP_LINE);
1214 BOOL WINAPI SymGetLineNextW(HANDLE, PIMAGEHLP_LINEW);
1215 BOOL WINAPI SymGetLinePrev(HANDLE, PIMAGEHLP_LINE);
1216 BOOL WINAPI SymGetLinePrevW(HANDLE, PIMAGEHLP_LINEW);
1217 DWORD WINAPI SymGetModuleBase(HANDLE, DWORD);
1218 BOOL WINAPI SymGetModuleInfo(HANDLE, DWORD, PIMAGEHLP_MODULE);
1219 BOOL WINAPI SymGetModuleInfoW(HANDLE, DWORD, PIMAGEHLP_MODULEW);
1220 BOOL WINAPI SymGetSymFromAddr(HANDLE, DWORD, PDWORD, PIMAGEHLP_SYMBOL);
1221 BOOL WINAPI SymGetSymFromName(HANDLE, PCSTR, PIMAGEHLP_SYMBOL);
1222 BOOL WINAPI SymGetSymNext(HANDLE, PIMAGEHLP_SYMBOL);
1223 BOOL WINAPI SymGetSymNextW(HANDLE, PIMAGEHLP_SYMBOLW);
1224 BOOL WINAPI SymGetSymPrev(HANDLE, PIMAGEHLP_SYMBOL);
1225 BOOL WINAPI SymGetSymPrevW(HANDLE, PIMAGEHLP_SYMBOLW);
1226 DWORD WINAPI SymLoadModule(HANDLE, HANDLE, PCSTR, PCSTR, DWORD, DWORD);
1227 BOOL WINAPI SymRegisterCallback(HANDLE, PSYMBOL_REGISTERED_CALLBACK, PVOID);
1228 BOOL WINAPI SymRegisterFunctionEntryCallback(HANDLE, PSYMBOL_FUNCENTRY_CALLBACK, PVOID);
1229 BOOL WINAPI SymRefreshModuleList(HANDLE);
1230 BOOL WINAPI SymUnDName(PIMAGEHLP_SYMBOL, PSTR, DWORD);
1231 BOOL WINAPI SymUnloadModule(HANDLE, DWORD);
1233 #endif
1235 #ifdef __cplusplus
1236 } /* extern "C" */
1237 #endif /* defined(__cplusplus) */
1239 #endif /* __WINE_DBGHELP_H */