1 /* 2 * Declarations for DBGHELP 3 * 4 * Copyright (C) 2003 Eric Pouech 5 * 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. 10 * 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. 15 * 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 19 */ 20 21 #ifndef __WINE_DBGHELP_H 22 #define __WINE_DBGHELP_H 23 24 /* A set of documentation macros (see also imagehlp.h) */ 25 #ifndef __deref_out 26 # define __deref_out 27 #endif 28 #ifndef __deref_out_opt 29 # define __deref_out_opt 30 #endif 31 #ifndef __deref_opt_out 32 # define __deref_opt_out 33 #endif 34 #ifndef __in 35 # define __in 36 #endif 37 #ifndef __in_opt 38 # define __in_opt 39 #endif 40 #ifndef __in_bcount 41 # define __in_bcount(x) 42 #endif 43 #ifndef __in_bcount_opt 44 # define __in_bcount_opt(x) 45 #endif 46 #ifndef __in_ecount 47 # define __in_ecount(x) 48 #endif 49 #ifndef __inout 50 # define __inout 51 #endif 52 #ifndef __inout_opt 53 # define __inout_opt 54 #endif 55 #ifndef __inout_bcount 56 # define __inout_bcount(x) 57 #endif 58 #ifndef __inout_ecount 59 # define __inout_ecount(x) 60 #endif 61 #ifndef __out 62 # define __out 63 #endif 64 #ifndef __out_opt 65 # define __out_opt 66 #endif 67 #ifndef __out_bcount 68 # define __out_bcount(x) 69 #endif 70 #ifndef __out_bcount_opt 71 # define __out_bcount_opt(x) 72 #endif 73 #ifndef __out_ecount 74 # define __out_ecount(x) 75 #endif 76 #ifndef __out_ecount_opt 77 # define __out_ecount_opt(x) 78 #endif 79 #ifndef __out_xcount 80 # define __out_xcount(x) 81 #endif 82 83 84 #ifdef __cplusplus 85 extern "C" { 86 #endif /* defined(__cplusplus) */ 87 88 #ifdef _WIN64 89 #ifndef _IMAGEHLP64 90 #define _IMAGEHLP64 91 #endif 92 #endif 93 94 #define IMAGEAPI WINAPI 95 #define DBHLPAPI IMAGEAPI 96 97 typedef struct _LOADED_IMAGE 98 { 99 PSTR ModuleName; 100 HANDLE hFile; 101 PUCHAR MappedAddress; 102 #ifdef _IMAGEHLP64 103 PIMAGE_NT_HEADERS64 FileHeader; 104 #else 105 PIMAGE_NT_HEADERS32 FileHeader; 106 #endif 107 PIMAGE_SECTION_HEADER LastRvaSection; 108 ULONG NumberOfSections; 109 PIMAGE_SECTION_HEADER Sections; 110 ULONG Characteristics; 111 BOOLEAN fSystemImage; 112 BOOLEAN fDOSImage; 113 BOOLEAN fReadOnly; 114 UCHAR Version; 115 LIST_ENTRY Links; 116 ULONG SizeOfImage; 117 } LOADED_IMAGE, *PLOADED_IMAGE; 118 119 /************************* 120 * IMAGEHLP equiv * 121 *************************/ 122 123 typedef enum 124 { 125 AddrMode1616, 126 AddrMode1632, 127 AddrModeReal, 128 AddrModeFlat 129 } ADDRESS_MODE; 130 131 #if !defined(_IMAGEHLP_SOURCE_) && defined(_IMAGEHLP64) 132 #define ADDRESS ADDRESS64 133 #define LPADDRESS LPADDRESS64 134 #else 135 typedef struct _tagADDRESS 136 { 137 DWORD Offset; 138 WORD Segment; 139 ADDRESS_MODE Mode; 140 } ADDRESS, *LPADDRESS; 141 #endif 142 143 typedef struct _tagADDRESS64 144 { 145 DWORD64 Offset; 146 WORD Segment; 147 ADDRESS_MODE Mode; 148 } ADDRESS64, *LPADDRESS64; 149 150 #define SYMF_OMAP_GENERATED 0x00000001 151 #define SYMF_OMAP_MODIFIED 0x00000002 152 #define SYMF_USER_GENERATED 0x00000004 153 #define SYMF_REGISTER 0x00000008 154 #define SYMF_REGREL 0x00000010 155 #define SYMF_FRAMEREL 0x00000020 156 #define SYMF_PARAMETER 0x00000040 157 #define SYMF_LOCAL 0x00000080 158 #define SYMF_CONSTANT 0x00000100 159 #define SYMF_EXPORT 0x00000200 160 #define SYMF_FORWARDER 0x00000400 161 #define SYMF_FUNCTION 0x00000800 162 #define SYMF_VIRTUAL 0x00001000 163 #define SYMF_THUNK 0x00002000 164 #define SYMF_TLSREL 0x00004000 165 166 typedef enum 167 { 168 SymNone = 0, 169 SymCoff, 170 SymCv, 171 SymPdb, 172 SymExport, 173 SymDeferred, 174 SymSym, 175 SymDia, 176 SymVirtual, 177 NumSymTypes 178 } SYM_TYPE; 179 180 #ifdef _NO_CVCONST_H 181 enum SymTagEnum 182 { 183 SymTagNull, 184 SymTagExe, 185 SymTagCompiland, 186 SymTagCompilandDetails, 187 SymTagCompilandEnv, 188 SymTagFunction, 189 SymTagBlock, 190 SymTagData, 191 SymTagAnnotation, 192 SymTagLabel, 193 SymTagPublicSymbol, 194 SymTagUDT, 195 SymTagEnum, 196 SymTagFunctionType, 197 SymTagPointerType, 198 SymTagArrayType, 199 SymTagBaseType, 200 SymTagTypedef, 201 SymTagBaseClass, 202 SymTagFriend, 203 SymTagFunctionArgType, 204 SymTagFuncDebugStart, 205 SymTagFuncDebugEnd, 206 SymTagUsingNamespace, 207 SymTagVTableShape, 208 SymTagVTable, 209 SymTagCustom, 210 SymTagThunk, 211 SymTagCustomType, 212 SymTagManagedType, 213 SymTagDimension, 214 SymTagCallSite, 215 SymTagInlineSite, 216 SymTagBaseInterface, 217 SymTagVectorType, 218 SymTagMatrixType, 219 SymTagHLSLType, 220 SymTagCaller, 221 SymTagCallee, 222 SymTagExport, 223 SymTagHeapAllocationSite, 224 SymTagCoffGroup, 225 SymTagMax 226 }; 227 #endif // _NO_CVCONST_H 228 229 #if !defined(_IMAGEHLP_SOURCE_) && defined(_IMAGEHLP64) 230 #define IMAGEHLP_SYMBOL IMAGEHLP_SYMBOL64 231 #define IMAGEHLP_SYMBOLW IMAGEHLP_SYMBOLW64 232 #define PIMAGEHLP_SYMBOL PIMAGEHLP_SYMBOL64 233 #define PIMAGEHLP_SYMBOLW PIMAGEHLP_SYMBOLW64 234 #else 235 typedef struct _IMAGEHLP_SYMBOL 236 { 237 DWORD SizeOfStruct; 238 DWORD Address; 239 DWORD Size; 240 DWORD Flags; 241 DWORD MaxNameLength; 242 CHAR Name[1]; 243 } IMAGEHLP_SYMBOL, *PIMAGEHLP_SYMBOL; 244 245 typedef struct _IMAGEHLP_SYMBOLW 246 { 247 DWORD SizeOfStruct; 248 DWORD Address; 249 DWORD Size; 250 DWORD Flags; 251 DWORD MaxNameLength; 252 WCHAR Name[1]; 253 } IMAGEHLP_SYMBOLW, *PIMAGEHLP_SYMBOLW; 254 #endif 255 256 typedef struct _IMAGEHLP_SYMBOL64 257 { 258 DWORD SizeOfStruct; 259 DWORD64 Address; 260 DWORD Size; 261 DWORD Flags; 262 DWORD MaxNameLength; 263 CHAR Name[1]; 264 } IMAGEHLP_SYMBOL64, *PIMAGEHLP_SYMBOL64; 265 266 typedef struct _IMAGEHLP_SYMBOLW64 267 { 268 DWORD SizeOfStruct; 269 DWORD64 Address; 270 DWORD Size; 271 DWORD Flags; 272 DWORD MaxNameLength; 273 WCHAR Name[1]; 274 } IMAGEHLP_SYMBOLW64, *PIMAGEHLP_SYMBOLW64; 275 276 #if !defined(_IMAGEHLP_SOURCE_) && defined(_IMAGEHLP64) 277 #define IMAGEHLP_MODULE IMAGEHLP_MODULE64 278 #define PIMAGEHLP_MODULE PIMAGEHLP_MODULE64 279 #define IMAGEHLP_MODULEW IMAGEHLP_MODULEW64 280 #define PIMAGEHLP_MODULEW PIMAGEHLP_MODULEW64 281 #else 282 typedef struct _IMAGEHLP_MODULE 283 { 284 DWORD SizeOfStruct; 285 DWORD BaseOfImage; 286 DWORD ImageSize; 287 DWORD TimeDateStamp; 288 DWORD CheckSum; 289 DWORD NumSyms; 290 SYM_TYPE SymType; 291 CHAR ModuleName[32]; 292 CHAR ImageName[256]; 293 CHAR LoadedImageName[256]; 294 } IMAGEHLP_MODULE, *PIMAGEHLP_MODULE; 295 296 typedef struct _IMAGEHLP_MODULEW 297 { 298 DWORD SizeOfStruct; 299 DWORD BaseOfImage; 300 DWORD ImageSize; 301 DWORD TimeDateStamp; 302 DWORD CheckSum; 303 DWORD NumSyms; 304 SYM_TYPE SymType; 305 WCHAR ModuleName[32]; 306 WCHAR ImageName[256]; 307 WCHAR LoadedImageName[256]; 308 } IMAGEHLP_MODULEW, *PIMAGEHLP_MODULEW; 309 #endif 310 311 typedef struct _IMAGEHLP_MODULE64 312 { 313 DWORD SizeOfStruct; 314 DWORD64 BaseOfImage; 315 DWORD ImageSize; 316 DWORD TimeDateStamp; 317 DWORD CheckSum; 318 DWORD NumSyms; 319 SYM_TYPE SymType; 320 CHAR ModuleName[32]; 321 CHAR ImageName[256]; 322 CHAR LoadedImageName[256]; 323 CHAR LoadedPdbName[256]; 324 DWORD CVSig; 325 CHAR CVData[MAX_PATH*3]; 326 DWORD PdbSig; 327 GUID PdbSig70; 328 DWORD PdbAge; 329 BOOL PdbUnmatched; 330 BOOL DbgUnmatched; 331 BOOL LineNumbers; 332 BOOL GlobalSymbols; 333 BOOL TypeInfo; 334 BOOL SourceIndexed; 335 BOOL Publics; 336 } IMAGEHLP_MODULE64, *PIMAGEHLP_MODULE64; 337 338 typedef struct _IMAGEHLP_MODULEW64 339 { 340 DWORD SizeOfStruct; 341 DWORD64 BaseOfImage; 342 DWORD ImageSize; 343 DWORD TimeDateStamp; 344 DWORD CheckSum; 345 DWORD NumSyms; 346 SYM_TYPE SymType; 347 WCHAR ModuleName[32]; 348 WCHAR ImageName[256]; 349 WCHAR LoadedImageName[256]; 350 WCHAR LoadedPdbName[256]; 351 DWORD CVSig; 352 WCHAR CVData[MAX_PATH*3]; 353 DWORD PdbSig; 354 GUID PdbSig70; 355 DWORD PdbAge; 356 BOOL PdbUnmatched; 357 BOOL DbgUnmatched; 358 BOOL LineNumbers; 359 BOOL GlobalSymbols; 360 BOOL TypeInfo; 361 BOOL SourceIndexed; 362 BOOL Publics; 363 } IMAGEHLP_MODULEW64, *PIMAGEHLP_MODULEW64; 364 365 #if !defined(_IMAGEHLP_SOURCE_) && defined(_IMAGEHLP64) 366 #define IMAGEHLP_LINE IMAGEHLP_LINE64 367 #define PIMAGEHLP_LINE PIMAGEHLP_LINE64 368 #define IMAGEHLP_LINEW IMAGEHLP_LINEW64 369 #define PIMAGEHLP_LINEW PIMAGEHLP_LINEW64 370 #else 371 typedef struct _IMAGEHLP_LINE 372 { 373 DWORD SizeOfStruct; 374 PVOID Key; 375 DWORD LineNumber; 376 PCHAR FileName; 377 DWORD Address; 378 } IMAGEHLP_LINE, *PIMAGEHLP_LINE; 379 380 typedef struct _IMAGEHLP_LINEW 381 { 382 DWORD SizeOfStruct; 383 PVOID Key; 384 DWORD LineNumber; 385 PWSTR FileName; 386 DWORD Address; 387 } IMAGEHLP_LINEW, *PIMAGEHLP_LINEW; 388 #endif 389 390 typedef struct _IMAGEHLP_LINE64 391 { 392 DWORD SizeOfStruct; 393 PVOID Key; 394 DWORD LineNumber; 395 PCHAR FileName; 396 DWORD64 Address; 397 } IMAGEHLP_LINE64, *PIMAGEHLP_LINE64; 398 399 typedef struct _IMAGEHLP_LINEW64 400 { 401 DWORD SizeOfStruct; 402 PVOID Key; 403 DWORD LineNumber; 404 PWSTR FileName; 405 DWORD64 Address; 406 } IMAGEHLP_LINEW64, *PIMAGEHLP_LINEW64; 407 408 typedef struct _SOURCEFILE 409 { 410 DWORD64 ModBase; 411 PCHAR FileName; 412 } SOURCEFILE, *PSOURCEFILE; 413 414 typedef struct _SOURCEFILEW 415 { 416 DWORD64 ModBase; 417 PWSTR FileName; 418 } SOURCEFILEW, *PSOURCEFILEW; 419 420 #define CBA_DEFERRED_SYMBOL_LOAD_START 0x00000001 421 #define CBA_DEFERRED_SYMBOL_LOAD_COMPLETE 0x00000002 422 #define CBA_DEFERRED_SYMBOL_LOAD_FAILURE 0x00000003 423 #define CBA_SYMBOLS_UNLOADED 0x00000004 424 #define CBA_DUPLICATE_SYMBOL 0x00000005 425 #define CBA_READ_MEMORY 0x00000006 426 #define CBA_DEFERRED_SYMBOL_LOAD_CANCEL 0x00000007 427 #define CBA_SET_OPTIONS 0x00000008 428 #define CBA_EVENT 0x00000010 429 #define CBA_DEFERRED_SYMBOL_LOAD_PARTIAL 0x00000020 430 #define CBA_DEBUG_INFO 0x10000000 431 432 typedef struct _IMAGEHLP_CBA_READ_MEMORY 433 { 434 DWORD64 addr; 435 PVOID buf; 436 DWORD bytes; 437 DWORD *bytesread; 438 } IMAGEHLP_CBA_READ_MEMORY, *PIMAGEHLP_CBA_READ_MEMORY; 439 440 enum 441 { 442 sevInfo = 0, 443 sevProblem, 444 sevAttn, 445 sevFatal, 446 sevMax 447 }; 448 449 #define EVENT_SRCSPEW_START 100 450 #define EVENT_SRCSPEW 100 451 #define EVENT_SRCSPEW_END 199 452 453 typedef struct _IMAGEHLP_CBA_EVENT 454 { 455 DWORD severity; 456 DWORD code; 457 PCHAR desc; 458 PVOID object; 459 } IMAGEHLP_CBA_EVENT, *PIMAGEHLP_CBA_EVENT; 460 461 typedef struct _IMAGEHLP_CBA_EVENTW 462 { 463 DWORD severity; 464 DWORD code; 465 PCWSTR desc; 466 PVOID object; 467 } IMAGEHLP_CBA_EVENTW, *PIMAGEHLP_CBA_EVENTW; 468 469 #if !defined(_IMAGEHLP_SOURCE_) && defined(_IMAGEHLP64) 470 #define IMAGEHLP_DEFERRED_SYMBOL_LOAD IMAGEHLP_DEFERRED_SYMBOL_LOAD64 471 #define PIMAGEHLP_DEFERRED_SYMBOL_LOAD PIMAGEHLP_DEFERRED_SYMBOL_LOAD64 472 #else 473 typedef struct _IMAGEHLP_DEFERRED_SYMBOL_LOAD 474 { 475 DWORD SizeOfStruct; 476 DWORD BaseOfImage; 477 DWORD CheckSum; 478 DWORD TimeDateStamp; 479 CHAR FileName[MAX_PATH]; 480 BOOLEAN Reparse; 481 HANDLE hFile; 482 } IMAGEHLP_DEFERRED_SYMBOL_LOAD, *PIMAGEHLP_DEFERRED_SYMBOL_LOAD; 483 #endif 484 485 typedef struct _IMAGEHLP_DEFERRED_SYMBOL_LOAD64 486 { 487 DWORD SizeOfStruct; 488 DWORD64 BaseOfImage; 489 DWORD CheckSum; 490 DWORD TimeDateStamp; 491 CHAR FileName[MAX_PATH]; 492 BOOLEAN Reparse; 493 HANDLE hFile; 494 DWORD Flags; 495 } IMAGEHLP_DEFERRED_SYMBOL_LOAD64, *PIMAGEHLP_DEFERRED_SYMBOL_LOAD64; 496 497 typedef struct _IMAGEHLP_DEFERRED_SYMBOL_LOADW64 498 { 499 DWORD SizeOfStruct; 500 DWORD64 BaseOfImage; 501 DWORD CheckSum; 502 DWORD TimeDateStamp; 503 WCHAR FileName[MAX_PATH + 1]; 504 BOOLEAN Reparse; 505 HANDLE hFile; 506 DWORD Flags; 507 } IMAGEHLP_DEFERRED_SYMBOL_LOADW64, *PIMAGEHLP_DEFERRED_SYMBOL_LOADW64; 508 509 #if !defined(_IMAGEHLP_SOURCE_) && defined(_IMAGEHLP64) 510 #define IMAGEHLP_DUPLICATE_SYMBOL IMAGEHLP_DUPLICATE_SYMBOL64 511 #define PIMAGEHLP_DUPLICATE_SYMBOL PIMAGEHLP_DUPLICATE_SYMBOL64 512 #else 513 typedef struct _IMAGEHLP_DUPLICATE_SYMBOL 514 { 515 DWORD SizeOfStruct; 516 DWORD NumberOfDups; 517 PIMAGEHLP_SYMBOL Symbol; 518 DWORD SelectedSymbol; 519 } IMAGEHLP_DUPLICATE_SYMBOL, *PIMAGEHLP_DUPLICATE_SYMBOL; 520 #endif 521 522 typedef struct _IMAGEHLP_DUPLICATE_SYMBOL64 523 { 524 DWORD SizeOfStruct; 525 DWORD NumberOfDups; 526 PIMAGEHLP_SYMBOL64 Symbol; 527 DWORD SelectedSymbol; 528 } IMAGEHLP_DUPLICATE_SYMBOL64, *PIMAGEHLP_DUPLICATE_SYMBOL64; 529 530 #define SYMOPT_CASE_INSENSITIVE 0x00000001 531 #define SYMOPT_UNDNAME 0x00000002 532 #define SYMOPT_DEFERRED_LOADS 0x00000004 533 #define SYMOPT_NO_CPP 0x00000008 534 #define SYMOPT_LOAD_LINES 0x00000010 535 #define SYMOPT_OMAP_FIND_NEAREST 0x00000020 536 #define SYMOPT_LOAD_ANYTHING 0x00000040 537 #define SYMOPT_IGNORE_CVREC 0x00000080 538 #define SYMOPT_NO_UNQUALIFIED_LOADS 0x00000100 539 #define SYMOPT_FAIL_CRITICAL_ERRORS 0x00000200 540 #define SYMOPT_EXACT_SYMBOLS 0x00000400 541 #define SYMOPT_WILD_UNDERSCORE 0x00000800 542 #define SYMOPT_USE_DEFAULTS 0x00001000 543 #define SYMOPT_ALLOW_ABSOLUTE_SYMBOLS 0x00000800 544 #define SYMOPT_IGNORE_NT_SYMPATH 0x00001000 545 #define SYMOPT_INCLUDE_32BIT_MODULES 0x00002000 546 #define SYMOPT_PUBLICS_ONLY 0x00004000 547 #define SYMOPT_NO_PUBLICS 0x00008000 548 #define SYMOPT_AUTO_PUBLICS 0x00010000 549 #define SYMOPT_NO_IMAGE_SEARCH 0x00020000 550 #define SYMOPT_SECURE 0x00040000 551 #define SYMOPT_NO_PROMPTS 0x00080000 552 #define SYMOPT_OVERWRITE 0x00100000 553 #define SYMOPT_IGNORE_IMAGEDIR 0x00200000 554 #define SYMOPT_FLAT_DIRECTORY 0x00400000 555 #define SYMOPT_FAVOR_COMPRESSED 0x00800000 556 #define SYMOPT_ALLOW_ZERO_ADDRESS 0x01000000 557 #define SYMOPT_DISABLE_SYMSRV_AUTODETECT 0x02000000 558 #define SYMOPT_READONLY_CACHE 0x04000000 559 #define SYMOPT_SYMPATH_LAST 0x08000000 560 #define SYMOPT_DISABLE_FAST_SYMBOLS 0x10000000 561 #define SYMOPT_DISABLE_SYMSRV_TIMEOUT 0x20000000 562 #define SYMOPT_DISABLE_SRVSTAR_ON_STARTUP 0x40000000 563 #define SYMOPT_DEBUG 0x80000000 564 565 typedef struct _IMAGEHLP_STACK_FRAME 566 { 567 ULONG64 InstructionOffset; 568 ULONG64 ReturnOffset; 569 ULONG64 FrameOffset; 570 ULONG64 StackOffset; 571 ULONG64 BackingStoreOffset; 572 ULONG64 FuncTableEntry; 573 ULONG64 Params[4]; 574 ULONG64 Reserved[5]; 575 BOOL Virtual; 576 ULONG Reserved2; 577 } IMAGEHLP_STACK_FRAME, *PIMAGEHLP_STACK_FRAME; 578 579 typedef VOID IMAGEHLP_CONTEXT, *PIMAGEHLP_CONTEXT; 580 581 #define DBHHEADER_DEBUGDIRS 0x1 582 typedef struct _DBGHELP_MODLOAD_DATA 583 { 584 DWORD ssize; 585 DWORD ssig; 586 PVOID data; 587 DWORD size; 588 DWORD flags; 589 } MODLOAD_DATA, *PMODLOAD_DATA; 590 591 /************************* 592 * MiniDUMP * 593 *************************/ 594 595 #include <pshpack4.h> 596 /* DebugHelp */ 597 598 #define MINIDUMP_SIGNATURE 0x504D444D /* 'MDMP' */ 599 #define MINIDUMP_VERSION (42899) 600 601 typedef DWORD RVA; 602 typedef ULONG64 RVA64; 603 604 typedef enum _MINIDUMP_TYPE 605 { 606 MiniDumpNormal = 0x0000, 607 MiniDumpWithDataSegs = 0x0001, 608 MiniDumpWithFullMemory = 0x0002, 609 MiniDumpWithHandleData = 0x0004, 610 MiniDumpFilterMemory = 0x0008, 611 MiniDumpScanMemory = 0x0010, 612 MiniDumpWithUnloadedModules = 0x0020, 613 MiniDumpWithIndirectlyReferencedMemory = 0x0040, 614 MiniDumpFilterModulePaths = 0x0080, 615 MiniDumpWithProcessThreadData = 0x0100, 616 MiniDumpWithPrivateReadWriteMemory = 0x0200, 617 MiniDumpWithoutOptionalData = 0x0400, 618 MiniDumpWithFullMemoryInfo = 0x0800, 619 MiniDumpWithThreadInfo = 0x1000, 620 MiniDumpWithCodeSegs = 0x2000 621 } MINIDUMP_TYPE; 622 623 typedef enum _MINIDUMP_CALLBACK_TYPE 624 { 625 ModuleCallback, 626 ThreadCallback, 627 ThreadExCallback, 628 IncludeThreadCallback, 629 IncludeModuleCallback, 630 MemoryCallback, 631 } MINIDUMP_CALLBACK_TYPE; 632 633 typedef struct _MINIDUMP_THREAD_CALLBACK 634 { 635 ULONG ThreadId; 636 HANDLE ThreadHandle; 637 CONTEXT Context; 638 ULONG SizeOfContext; 639 ULONG64 StackBase; 640 ULONG64 StackEnd; 641 } MINIDUMP_THREAD_CALLBACK, *PMINIDUMP_THREAD_CALLBACK; 642 643 typedef struct _MINIDUMP_THREAD_EX_CALLBACK 644 { 645 ULONG ThreadId; 646 HANDLE ThreadHandle; 647 CONTEXT Context; 648 ULONG SizeOfContext; 649 ULONG64 StackBase; 650 ULONG64 StackEnd; 651 ULONG64 BackingStoreBase; 652 ULONG64 BackingStoreEnd; 653 } MINIDUMP_THREAD_EX_CALLBACK, *PMINIDUMP_THREAD_EX_CALLBACK; 654 655 typedef struct _MINIDUMP_INCLUDE_THREAD_CALLBACK 656 { 657 ULONG ThreadId; 658 } MINIDUMP_INCLUDE_THREAD_CALLBACK, *PMINIDUMP_INCLUDE_THREAD_CALLBACK; 659 660 typedef enum _THREAD_WRITE_FLAGS 661 { 662 ThreadWriteThread = 0x0001, 663 ThreadWriteStack = 0x0002, 664 ThreadWriteContext = 0x0004, 665 ThreadWriteBackingStore = 0x0008, 666 ThreadWriteInstructionWindow = 0x0010, 667 ThreadWriteThreadData = 0x0020, 668 ThreadWriteThreadInfo = 0x0040 669 } THREAD_WRITE_FLAGS; 670 671 typedef struct _MINIDUMP_MODULE_CALLBACK 672 { 673 PWCHAR FullPath; 674 ULONG64 BaseOfImage; 675 ULONG SizeOfImage; 676 ULONG CheckSum; 677 ULONG TimeDateStamp; 678 VS_FIXEDFILEINFO VersionInfo; 679 PVOID CvRecord; 680 ULONG SizeOfCvRecord; 681 PVOID MiscRecord; 682 ULONG SizeOfMiscRecord; 683 } MINIDUMP_MODULE_CALLBACK, *PMINIDUMP_MODULE_CALLBACK; 684 685 typedef struct _MINIDUMP_INCLUDE_MODULE_CALLBACK 686 { 687 ULONG64 BaseOfImage; 688 } MINIDUMP_INCLUDE_MODULE_CALLBACK, *PMINIDUMP_INCLUDE_MODULE_CALLBACK; 689 690 typedef enum _MODULE_WRITE_FLAGS 691 { 692 ModuleWriteModule = 0x0001, 693 ModuleWriteDataSeg = 0x0002, 694 ModuleWriteMiscRecord = 0x0004, 695 ModuleWriteCvRecord = 0x0008, 696 ModuleReferencedByMemory = 0x0010, 697 ModuleWriteTlsData = 0x0020, 698 ModuleWriteCodeSegs = 0x0040, 699 } MODULE_WRITE_FLAGS; 700 701 typedef struct _MINIDUMP_CALLBACK_INPUT 702 { 703 ULONG ProcessId; 704 HANDLE ProcessHandle; 705 ULONG CallbackType; 706 union 707 { 708 MINIDUMP_THREAD_CALLBACK Thread; 709 MINIDUMP_THREAD_EX_CALLBACK ThreadEx; 710 MINIDUMP_MODULE_CALLBACK Module; 711 MINIDUMP_INCLUDE_THREAD_CALLBACK IncludeThread; 712 MINIDUMP_INCLUDE_MODULE_CALLBACK IncludeModule; 713 } DUMMYUNIONNAME; 714 } MINIDUMP_CALLBACK_INPUT, *PMINIDUMP_CALLBACK_INPUT; 715 716 typedef struct _MINIDUMP_CALLBACK_OUTPUT 717 { 718 union 719 { 720 ULONG ModuleWriteFlags; 721 ULONG ThreadWriteFlags; 722 struct 723 { 724 ULONG64 MemoryBase; 725 ULONG MemorySize; 726 } DUMMYSTRUCTNAME; 727 } DUMMYUNIONNAME; 728 } MINIDUMP_CALLBACK_OUTPUT, *PMINIDUMP_CALLBACK_OUTPUT; 729 730 typedef BOOL 731 (WINAPI* MINIDUMP_CALLBACK_ROUTINE)( 732 _Inout_ PVOID, 733 _In_ const PMINIDUMP_CALLBACK_INPUT, 734 _Inout_ PMINIDUMP_CALLBACK_OUTPUT); 735 736 typedef struct _MINIDUMP_CALLBACK_INFORMATION 737 { 738 MINIDUMP_CALLBACK_ROUTINE CallbackRoutine; 739 void* CallbackParam; 740 } MINIDUMP_CALLBACK_INFORMATION, *PMINIDUMP_CALLBACK_INFORMATION; 741 742 typedef struct _MINIDUMP_LOCATION_DESCRIPTOR 743 { 744 ULONG DataSize; 745 RVA Rva; 746 } MINIDUMP_LOCATION_DESCRIPTOR; 747 748 typedef struct _MINIDUMP_LOCATION_DESCRIPTOR64 749 { 750 ULONG64 DataSize; 751 RVA64 Rva; 752 } MINIDUMP_LOCATION_DESCRIPTOR64; 753 754 typedef struct _MINIDUMP_DIRECTORY 755 { 756 ULONG StreamType; 757 MINIDUMP_LOCATION_DESCRIPTOR Location; 758 } MINIDUMP_DIRECTORY, *PMINIDUMP_DIRECTORY; 759 760 typedef struct _MINIDUMP_EXCEPTION 761 { 762 ULONG ExceptionCode; 763 ULONG ExceptionFlags; 764 ULONG64 ExceptionRecord; 765 ULONG64 ExceptionAddress; 766 ULONG NumberParameters; 767 ULONG __unusedAlignment; 768 ULONG64 ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS]; 769 } MINIDUMP_EXCEPTION, *PMINIDUMP_EXCEPTION; 770 771 typedef struct _MINIDUMP_EXCEPTION_INFORMATION 772 { 773 DWORD ThreadId; 774 PEXCEPTION_POINTERS ExceptionPointers; 775 BOOL ClientPointers; 776 } MINIDUMP_EXCEPTION_INFORMATION, *PMINIDUMP_EXCEPTION_INFORMATION; 777 778 typedef struct MINIDUMP_EXCEPTION_STREAM 779 { 780 ULONG ThreadId; 781 ULONG __alignment; 782 MINIDUMP_EXCEPTION ExceptionRecord; 783 MINIDUMP_LOCATION_DESCRIPTOR ThreadContext; 784 } MINIDUMP_EXCEPTION_STREAM, *PMINIDUMP_EXCEPTION_STREAM; 785 786 typedef struct _MINIDUMP_HEADER 787 { 788 DWORD Signature; 789 DWORD Version; 790 DWORD NumberOfStreams; 791 RVA StreamDirectoryRva; 792 DWORD CheckSum; 793 union 794 { 795 DWORD Reserved; 796 DWORD TimeDateStamp; 797 } DUMMYUNIONNAME; 798 ULONG64 Flags; 799 } MINIDUMP_HEADER, *PMINIDUMP_HEADER; 800 801 typedef struct _MINIDUMP_MEMORY_DESCRIPTOR 802 { 803 ULONG64 StartOfMemoryRange; 804 MINIDUMP_LOCATION_DESCRIPTOR Memory; 805 } MINIDUMP_MEMORY_DESCRIPTOR, *PMINIDUMP_MEMORY_DESCRIPTOR; 806 807 typedef struct _MINIDUMP_MEMORY_LIST 808 { 809 ULONG NumberOfMemoryRanges; 810 MINIDUMP_MEMORY_DESCRIPTOR MemoryRanges[1]; /* FIXME: 0-sized array not supported */ 811 } MINIDUMP_MEMORY_LIST, *PMINIDUMP_MEMORY_LIST; 812 813 typedef struct _MINIDUMP_MEMORY_DESCRIPTOR64 814 { 815 ULONG64 StartOfMemoryRange; 816 ULONG64 DataSize; 817 } MINIDUMP_MEMORY_DESCRIPTOR64, *PMINIDUMP_MEMORY_DESCRIPTOR64; 818 819 typedef struct _MINIDUMP_MEMORY64_LIST 820 { 821 ULONG64 NumberOfMemoryRanges; 822 RVA64 BaseRva; 823 MINIDUMP_MEMORY_DESCRIPTOR64 MemoryRanges[1]; /* FIXME: 0-sized array not supported */ 824 } MINIDUMP_MEMORY64_LIST, *PMINIDUMP_MEMORY64_LIST; 825 826 #define MINIDUMP_MISC1_PROCESS_ID 0x00000001 827 #define MINIDUMP_MISC1_PROCESS_TIMES 0x00000002 828 829 typedef struct _MINIDUMP_MISC_INFO 830 { 831 ULONG SizeOfInfo; 832 ULONG Flags1; 833 ULONG ProcessId; 834 ULONG ProcessCreateTime; 835 ULONG ProcessUserTime; 836 ULONG ProcessKernelTime; 837 } MINIDUMP_MISC_INFO, *PMINIDUMP_MISC_INFO; 838 839 typedef struct _MINIDUMP_MODULE 840 { 841 ULONG64 BaseOfImage; 842 ULONG SizeOfImage; 843 ULONG CheckSum; 844 ULONG TimeDateStamp; 845 RVA ModuleNameRva; 846 VS_FIXEDFILEINFO VersionInfo; 847 MINIDUMP_LOCATION_DESCRIPTOR CvRecord; 848 MINIDUMP_LOCATION_DESCRIPTOR MiscRecord; 849 ULONG64 Reserved0; 850 ULONG64 Reserved1; 851 } MINIDUMP_MODULE, *PMINIDUMP_MODULE; 852 853 typedef struct _MINIDUMP_MODULE_LIST 854 { 855 ULONG NumberOfModules; 856 MINIDUMP_MODULE Modules[1]; /* FIXME: 0-sized array not supported */ 857 } MINIDUMP_MODULE_LIST, *PMINIDUMP_MODULE_LIST; 858 859 typedef struct _MINIDUMP_STRING 860 { 861 ULONG Length; 862 WCHAR Buffer[1]; /* FIXME: O-sized array not supported */ 863 } MINIDUMP_STRING, *PMINIDUMP_STRING; 864 865 typedef struct _MINIDUMP_SYSTEM_INFO 866 { 867 USHORT ProcessorArchitecture; 868 USHORT ProcessorLevel; 869 USHORT ProcessorRevision; 870 union 871 { 872 USHORT Reserved0; 873 struct 874 { 875 UCHAR NumberOfProcessors; 876 UCHAR ProductType; 877 } DUMMYSTRUCTNAME; 878 } DUMMYUNIONNAME; 879 880 ULONG MajorVersion; 881 ULONG MinorVersion; 882 ULONG BuildNumber; 883 ULONG PlatformId; 884 885 RVA CSDVersionRva; 886 union 887 { 888 ULONG Reserved1; 889 struct 890 { 891 USHORT SuiteMask; 892 USHORT Reserved2; 893 } DUMMYSTRUCTNAME; 894 } DUMMYUNIONNAME1; 895 union _CPU_INFORMATION 896 { 897 struct 898 { 899 ULONG VendorId[3]; 900 ULONG VersionInformation; 901 ULONG FeatureInformation; 902 ULONG AMDExtendedCpuFeatures; 903 } X86CpuInfo; 904 struct 905 { 906 ULONG64 ProcessorFeatures[2]; 907 } OtherCpuInfo; 908 } Cpu; 909 910 } MINIDUMP_SYSTEM_INFO, *PMINIDUMP_SYSTEM_INFO; 911 912 typedef struct _MINIDUMP_THREAD 913 { 914 ULONG ThreadId; 915 ULONG SuspendCount; 916 ULONG PriorityClass; 917 ULONG Priority; 918 ULONG64 Teb; 919 MINIDUMP_MEMORY_DESCRIPTOR Stack; 920 MINIDUMP_LOCATION_DESCRIPTOR ThreadContext; 921 } MINIDUMP_THREAD, *PMINIDUMP_THREAD; 922 923 typedef struct _MINIDUMP_THREAD_LIST 924 { 925 ULONG NumberOfThreads; 926 MINIDUMP_THREAD Threads[1]; /* FIXME: no support of 0 sized array */ 927 } MINIDUMP_THREAD_LIST, *PMINIDUMP_THREAD_LIST; 928 929 typedef struct _MINIDUMP_USER_STREAM 930 { 931 ULONG Type; 932 ULONG BufferSize; 933 void* Buffer; 934 } MINIDUMP_USER_STREAM, *PMINIDUMP_USER_STREAM; 935 936 typedef struct _MINIDUMP_USER_STREAM_INFORMATION 937 { 938 ULONG UserStreamCount; 939 PMINIDUMP_USER_STREAM UserStreamArray; 940 } MINIDUMP_USER_STREAM_INFORMATION, *PMINIDUMP_USER_STREAM_INFORMATION; 941 942 typedef enum _MINIDUMP_STREAM_TYPE 943 { 944 UnusedStream = 0, 945 ReservedStream0 = 1, 946 ReservedStream1 = 2, 947 ThreadListStream = 3, 948 ModuleListStream = 4, 949 MemoryListStream = 5, 950 ExceptionStream = 6, 951 SystemInfoStream = 7, 952 ThreadExListStream = 8, 953 Memory64ListStream = 9, 954 CommentStreamA = 10, 955 CommentStreamW = 11, 956 HandleDataStream = 12, 957 FunctionTableStream = 13, 958 UnloadedModuleListStream = 14, 959 MiscInfoStream = 15, 960 MemoryInfoListStream = 16, 961 ThreadInfoListStream = 17, 962 963 LastReservedStream = 0xffff 964 } MINIDUMP_STREAM_TYPE; 965 966 BOOL 967 WINAPI 968 MiniDumpWriteDump( 969 _In_ HANDLE, 970 _In_ DWORD, 971 _In_ HANDLE, 972 _In_ MINIDUMP_TYPE, 973 _In_opt_ PMINIDUMP_EXCEPTION_INFORMATION, 974 _In_opt_ PMINIDUMP_USER_STREAM_INFORMATION, 975 _In_opt_ PMINIDUMP_CALLBACK_INFORMATION); 976 977 BOOL 978 WINAPI 979 MiniDumpReadDumpStream( 980 _In_ PVOID, 981 _In_ ULONG, 982 _Outptr_result_maybenull_ PMINIDUMP_DIRECTORY*, 983 _Outptr_result_maybenull_ PVOID*, 984 _Out_opt_ ULONG*); 985 986 #include <poppack.h> 987 988 /************************* 989 * MODULE handling * 990 *************************/ 991 992 /* flags for SymLoadModuleEx */ 993 #define SLMFLAG_VIRTUAL 0x1 994 #define SLMFLAG_NO_SYMBOLS 0x4 995 996 typedef BOOL 997 (CALLBACK *PENUMLOADED_MODULES_CALLBACK64)( 998 _In_ PCSTR, 999 _In_ DWORD64, 1000 _In_ ULONG, 1001 _In_opt_ PVOID); 1002 1003 BOOL 1004 WINAPI 1005 EnumerateLoadedModules64( 1006 _In_ HANDLE, 1007 _In_ PENUMLOADED_MODULES_CALLBACK64, 1008 _In_opt_ PVOID); 1009 1010 typedef BOOL 1011 (CALLBACK *PENUMLOADED_MODULES_CALLBACKW64)( 1012 _In_ PCWSTR, 1013 _In_ DWORD64, 1014 _In_ ULONG, 1015 _In_opt_ PVOID); 1016 1017 BOOL 1018 WINAPI 1019 EnumerateLoadedModulesW64( 1020 _In_ HANDLE, 1021 _In_ PENUMLOADED_MODULES_CALLBACKW64, 1022 _In_opt_ PVOID); 1023 1024 typedef BOOL 1025 (CALLBACK *PSYM_ENUMMODULES_CALLBACK64)( 1026 _In_ PCSTR, 1027 _In_ DWORD64, 1028 _In_opt_ PVOID); 1029 1030 BOOL 1031 WINAPI 1032 SymEnumerateModules64( 1033 _In_ HANDLE, 1034 _In_ PSYM_ENUMMODULES_CALLBACK64, 1035 _In_opt_ PVOID); 1036 1037 typedef BOOL 1038 (CALLBACK *PSYM_ENUMMODULES_CALLBACKW64)( 1039 _In_ PCWSTR, 1040 _In_ DWORD64, 1041 _In_opt_ PVOID); 1042 1043 BOOL 1044 WINAPI 1045 SymEnumerateModulesW64( 1046 _In_ HANDLE, 1047 _In_ PSYM_ENUMMODULES_CALLBACKW64, 1048 _In_opt_ PVOID); 1049 1050 BOOL 1051 WINAPI 1052 SymGetModuleInfo64( 1053 _In_ HANDLE, 1054 _In_ DWORD64, 1055 _Out_ PIMAGEHLP_MODULE64); 1056 1057 BOOL 1058 WINAPI 1059 SymGetModuleInfoW64( 1060 _In_ HANDLE, 1061 _In_ DWORD64, 1062 _Out_ PIMAGEHLP_MODULEW64); 1063 1064 DWORD64 WINAPI SymGetModuleBase64(_In_ HANDLE, _In_ DWORD64); 1065 1066 DWORD64 1067 WINAPI 1068 SymLoadModule64( 1069 _In_ HANDLE, 1070 _In_opt_ HANDLE, 1071 _In_opt_ PCSTR, 1072 _In_opt_ PCSTR, 1073 _In_ DWORD64, 1074 _In_ DWORD); 1075 1076 DWORD64 1077 WINAPI 1078 SymLoadModuleEx( 1079 _In_ HANDLE, 1080 _In_opt_ HANDLE, 1081 _In_opt_ PCSTR, 1082 _In_opt_ PCSTR, 1083 _In_ DWORD64, 1084 _In_ DWORD, 1085 _In_opt_ PMODLOAD_DATA, 1086 _In_opt_ DWORD); 1087 1088 DWORD64 1089 WINAPI 1090 SymLoadModuleExW( 1091 _In_ HANDLE, 1092 _In_opt_ HANDLE, 1093 _In_opt_ PCWSTR, 1094 _In_opt_ PCWSTR, 1095 _In_ DWORD64, 1096 _In_ DWORD, 1097 _In_opt_ PMODLOAD_DATA, 1098 _In_opt_ DWORD); 1099 1100 BOOL WINAPI SymUnloadModule64(_In_ HANDLE, _In_ DWORD64); 1101 1102 /************************* 1103 * Symbol Handling * 1104 *************************/ 1105 1106 #define IMAGEHLP_SYMBOL_INFO_VALUEPRESENT 1 1107 #define IMAGEHLP_SYMBOL_INFO_REGISTER SYMF_REGISTER /* 0x08 */ 1108 #define IMAGEHLP_SYMBOL_INFO_REGRELATIVE SYMF_REGREL /* 0x10 */ 1109 #define IMAGEHLP_SYMBOL_INFO_FRAMERELATIVE SYMF_FRAMEREL /* 0x20 */ 1110 #define IMAGEHLP_SYMBOL_INFO_PARAMETER SYMF_PARAMETER /* 0x40 */ 1111 #define IMAGEHLP_SYMBOL_INFO_LOCAL SYMF_LOCAL /* 0x80 */ 1112 #define IMAGEHLP_SYMBOL_INFO_CONSTANT SYMF_CONSTANT /* 0x100 */ 1113 #define IMAGEHLP_SYMBOL_FUNCTION SYMF_FUNCTION /* 0x800 */ 1114 1115 #define SYMFLAG_VALUEPRESENT 0x00000001 1116 #define SYMFLAG_REGISTER 0x00000008 1117 #define SYMFLAG_REGREL 0x00000010 1118 #define SYMFLAG_FRAMEREL 0x00000020 1119 #define SYMFLAG_PARAMETER 0x00000040 1120 #define SYMFLAG_LOCAL 0x00000080 1121 #define SYMFLAG_CONSTANT 0x00000100 1122 #define SYMFLAG_EXPORT 0x00000200 1123 #define SYMFLAG_FORWARDER 0x00000400 1124 #define SYMFLAG_FUNCTION 0x00000800 1125 #define SYMFLAG_VIRTUAL 0x00001000 1126 #define SYMFLAG_THUNK 0x00002000 1127 #define SYMFLAG_TLSREL 0x00004000 1128 #define SYMFLAG_SLOT 0x00008000 1129 #define SYMFLAG_ILREL 0x00010000 1130 #define SYMFLAG_METADATA 0x00020000 1131 #define SYMFLAG_CLR_TOKEN 0x00040000 1132 #define SYMFLAG_NULL 0x00080000 1133 #define SYMFLAG_FUNC_NO_RETURN 0x00100000 1134 #define SYMFLAG_SYNTHETIC_ZEROBASE 0x00200000 1135 #define SYMFLAG_PUBLIC_CODE 0x00400000 1136 1137 #define MAX_SYM_NAME 2000 1138 1139 typedef struct _SYMBOL_INFO 1140 { 1141 ULONG SizeOfStruct; 1142 ULONG TypeIndex; 1143 ULONG64 Reserved[2]; 1144 ULONG Index; 1145 ULONG Size; 1146 ULONG64 ModBase; 1147 ULONG Flags; 1148 ULONG64 Value; 1149 ULONG64 Address; 1150 ULONG Register; 1151 ULONG Scope; 1152 ULONG Tag; 1153 ULONG NameLen; 1154 ULONG MaxNameLen; 1155 CHAR Name[1]; 1156 } SYMBOL_INFO, *PSYMBOL_INFO; 1157 1158 typedef struct _SYMBOL_INFOW 1159 { 1160 ULONG SizeOfStruct; 1161 ULONG TypeIndex; 1162 ULONG64 Reserved[2]; 1163 ULONG Index; 1164 ULONG Size; 1165 ULONG64 ModBase; 1166 ULONG Flags; 1167 ULONG64 Value; 1168 ULONG64 Address; 1169 ULONG Register; 1170 ULONG Scope; 1171 ULONG Tag; 1172 ULONG NameLen; 1173 ULONG MaxNameLen; 1174 WCHAR Name[1]; 1175 } SYMBOL_INFOW, *PSYMBOL_INFOW; 1176 1177 typedef struct _SYMBOL_INFO_PACKAGE 1178 { 1179 SYMBOL_INFO si; 1180 CHAR name[MAX_SYM_NAME+1]; 1181 } SYMBOL_INFO_PACKAGE, *PSYMBOL_INFO_PACKAGE; 1182 1183 typedef struct _SYMBOL_INFO_PACKAGEW 1184 { 1185 SYMBOL_INFOW si; 1186 WCHAR name[MAX_SYM_NAME+1]; 1187 } SYMBOL_INFO_PACKAGEW, *PSYMBOL_INFO_PACKAGEW; 1188 1189 typedef enum _IMAGEHLP_SYMBOL_TYPE_INFO 1190 { 1191 TI_GET_SYMTAG, 1192 TI_GET_SYMNAME, 1193 TI_GET_LENGTH, 1194 TI_GET_TYPE, 1195 TI_GET_TYPEID, 1196 TI_GET_BASETYPE, 1197 TI_GET_ARRAYINDEXTYPEID, 1198 TI_FINDCHILDREN, 1199 TI_GET_DATAKIND, 1200 TI_GET_ADDRESSOFFSET, 1201 TI_GET_OFFSET, 1202 TI_GET_VALUE, 1203 TI_GET_COUNT, 1204 TI_GET_CHILDRENCOUNT, 1205 TI_GET_BITPOSITION, 1206 TI_GET_VIRTUALBASECLASS, 1207 TI_GET_VIRTUALTABLESHAPEID, 1208 TI_GET_VIRTUALBASEPOINTEROFFSET, 1209 TI_GET_CLASSPARENTID, 1210 TI_GET_NESTED, 1211 TI_GET_SYMINDEX, 1212 TI_GET_LEXICALPARENT, 1213 TI_GET_ADDRESS, 1214 TI_GET_THISADJUST, 1215 TI_GET_UDTKIND, 1216 TI_IS_EQUIV_TO, 1217 TI_GET_CALLING_CONVENTION, 1218 } IMAGEHLP_SYMBOL_TYPE_INFO; 1219 1220 #define IMAGEHLP_GET_TYPE_INFO_UNCACHED 0x00000001 1221 #define IMAGEHLP_GET_TYPE_INFO_CHILDREN 0x00000002 1222 typedef struct _IMAGEHLP_GET_TYPE_INFO_PARAMS 1223 { 1224 ULONG SizeOfStruct; 1225 ULONG Flags; 1226 ULONG NumIds; 1227 PULONG TypeIds; 1228 ULONG64 TagFilter; 1229 ULONG NumReqs; 1230 IMAGEHLP_SYMBOL_TYPE_INFO* ReqKinds; 1231 PULONG_PTR ReqOffsets; 1232 PULONG ReqSizes; 1233 ULONG_PTR ReqStride; 1234 ULONG_PTR BufferSize; 1235 PVOID Buffer; 1236 ULONG EntriesMatched; 1237 ULONG EntriesFilled; 1238 ULONG64 TagsFound; 1239 ULONG64 AllReqsValid; 1240 ULONG NumReqsValid; 1241 PULONG64 ReqsValid; 1242 } IMAGEHLP_GET_TYPE_INFO_PARAMS, *PIMAGEHLP_GET_TYPE_INFO_PARAMS; 1243 1244 typedef struct _TI_FINDCHILDREN_PARAMS 1245 { 1246 ULONG Count; 1247 ULONG Start; 1248 ULONG ChildId[1]; 1249 } TI_FINDCHILDREN_PARAMS; 1250 1251 #define UNDNAME_COMPLETE (0x0000) 1252 #define UNDNAME_NO_LEADING_UNDERSCORES (0x0001) 1253 #define UNDNAME_NO_MS_KEYWORDS (0x0002) 1254 #define UNDNAME_NO_FUNCTION_RETURNS (0x0004) 1255 #define UNDNAME_NO_ALLOCATION_MODEL (0x0008) 1256 #define UNDNAME_NO_ALLOCATION_LANGUAGE (0x0010) 1257 #define UNDNAME_NO_MS_THISTYPE (0x0020) 1258 #define UNDNAME_NO_CV_THISTYPE (0x0040) 1259 #define UNDNAME_NO_THISTYPE (0x0060) 1260 #define UNDNAME_NO_ACCESS_SPECIFIERS (0x0080) 1261 #define UNDNAME_NO_THROW_SIGNATURES (0x0100) 1262 #define UNDNAME_NO_MEMBER_TYPE (0x0200) 1263 #define UNDNAME_NO_RETURN_UDT_MODEL (0x0400) 1264 #define UNDNAME_32_BIT_DECODE (0x0800) 1265 #define UNDNAME_NAME_ONLY (0x1000) 1266 #define UNDNAME_NO_ARGUMENTS (0x2000) 1267 #define UNDNAME_NO_SPECIAL_SYMS (0x4000) 1268 1269 #define SYMSEARCH_MASKOBJS 0x01 1270 #define SYMSEARCH_RECURSE 0x02 1271 #define SYMSEARCH_GLOBALSONLY 0x04 1272 1273 BOOL 1274 WINAPI 1275 SymGetTypeInfo( 1276 _In_ HANDLE, 1277 _In_ DWORD64, 1278 _In_ ULONG, 1279 _In_ IMAGEHLP_SYMBOL_TYPE_INFO, 1280 _Out_ PVOID); 1281 1282 BOOL 1283 WINAPI 1284 SymGetTypeInfoEx( 1285 _In_ HANDLE, 1286 _In_ DWORD64, 1287 _Inout_ PIMAGEHLP_GET_TYPE_INFO_PARAMS); 1288 1289 typedef BOOL 1290 (CALLBACK *PSYM_ENUMERATESYMBOLS_CALLBACK)( 1291 _In_ PSYMBOL_INFO, 1292 _In_ ULONG, 1293 _In_opt_ PVOID); 1294 1295 typedef BOOL 1296 (CALLBACK *PSYM_ENUMERATESYMBOLS_CALLBACKW)( 1297 _In_ PSYMBOL_INFOW, 1298 _In_ ULONG, 1299 _In_opt_ PVOID); 1300 1301 BOOL 1302 WINAPI 1303 SymEnumTypes( 1304 _In_ HANDLE, 1305 _In_ ULONG64, 1306 _In_ PSYM_ENUMERATESYMBOLS_CALLBACK, 1307 _In_opt_ PVOID); 1308 1309 BOOL 1310 WINAPI 1311 SymEnumTypesW( 1312 _In_ HANDLE, 1313 _In_ ULONG64, 1314 _In_ PSYM_ENUMERATESYMBOLS_CALLBACKW, 1315 _In_opt_ PVOID); 1316 1317 BOOL 1318 WINAPI 1319 SymFromAddr( 1320 _In_ HANDLE, 1321 _In_ DWORD64, 1322 _Out_opt_ DWORD64*, 1323 _Inout_ SYMBOL_INFO*); 1324 1325 BOOL 1326 WINAPI 1327 SymFromAddrW( 1328 _In_ HANDLE, 1329 _In_ DWORD64, 1330 _Out_opt_ DWORD64*, 1331 _Inout_ SYMBOL_INFOW*); 1332 1333 BOOL 1334 WINAPI 1335 SymFromToken( 1336 _In_ HANDLE, 1337 _In_ DWORD64, 1338 _In_ DWORD, 1339 _Inout_ PSYMBOL_INFO); 1340 1341 BOOL 1342 WINAPI 1343 SymFromTokenW( 1344 _In_ HANDLE, 1345 _In_ DWORD64, 1346 _In_ DWORD, 1347 _Inout_ PSYMBOL_INFOW); 1348 1349 BOOL WINAPI SymFromName(_In_ HANDLE, _In_ PCSTR, _Inout_ PSYMBOL_INFO); 1350 BOOL WINAPI SymFromNameW(_In_ HANDLE, _In_ PCWSTR, _Inout_ PSYMBOL_INFOW); 1351 1352 BOOL 1353 WINAPI 1354 SymGetSymFromAddr64( 1355 _In_ HANDLE, 1356 _In_ DWORD64, 1357 _Out_opt_ PDWORD64, 1358 _Inout_ PIMAGEHLP_SYMBOL64); 1359 1360 BOOL 1361 WINAPI 1362 SymGetSymFromName64( 1363 _In_ HANDLE, 1364 _In_ PCSTR, 1365 _Inout_ PIMAGEHLP_SYMBOL64); 1366 1367 BOOL 1368 WINAPI 1369 SymGetTypeFromName( 1370 _In_ HANDLE, 1371 _In_ ULONG64, 1372 _In_ PCSTR, 1373 _Inout_ PSYMBOL_INFO); 1374 1375 BOOL 1376 WINAPI 1377 SymGetTypeFromNameW( 1378 _In_ HANDLE, 1379 _In_ ULONG64, 1380 _In_ PCWSTR, 1381 _Inout_ PSYMBOL_INFOW); 1382 1383 BOOL WINAPI SymGetSymNext64(_In_ HANDLE, _Inout_ PIMAGEHLP_SYMBOL64); 1384 BOOL WINAPI SymGetSymNextW64(_In_ HANDLE, _Inout_ PIMAGEHLP_SYMBOLW64); 1385 BOOL WINAPI SymGetSymPrev64(_In_ HANDLE, _Inout_ PIMAGEHLP_SYMBOL64); 1386 BOOL WINAPI SymGetSymPrevW64(_In_ HANDLE, _Inout_ PIMAGEHLP_SYMBOLW64); 1387 1388 BOOL 1389 WINAPI 1390 SymEnumSym( 1391 _In_ HANDLE, 1392 _In_ ULONG64, 1393 _In_ PSYM_ENUMERATESYMBOLS_CALLBACK, 1394 _In_opt_ PVOID); 1395 1396 BOOL 1397 WINAPI 1398 SymEnumSymbols( 1399 _In_ HANDLE, 1400 _In_ ULONG64, 1401 _In_opt_ PCSTR, 1402 _In_ PSYM_ENUMERATESYMBOLS_CALLBACK, 1403 _In_opt_ PVOID); 1404 1405 BOOL 1406 WINAPI 1407 SymEnumSymbolsW( 1408 _In_ HANDLE, 1409 _In_ ULONG64, 1410 _In_opt_ PCWSTR, 1411 _In_ PSYM_ENUMERATESYMBOLS_CALLBACKW, 1412 _In_opt_ PVOID); 1413 1414 typedef BOOL 1415 (CALLBACK *PSYM_ENUMSYMBOLS_CALLBACK64)( 1416 _In_ PCSTR, 1417 _In_ DWORD64, 1418 _In_ ULONG, 1419 _In_opt_ PVOID); 1420 1421 typedef BOOL 1422 (CALLBACK *PSYM_ENUMSYMBOLS_CALLBACK64W)( 1423 _In_ PCWSTR, 1424 _In_ DWORD64, 1425 _In_ ULONG, 1426 _In_opt_ PVOID); 1427 1428 BOOL 1429 WINAPI 1430 SymEnumerateSymbols64( 1431 _In_ HANDLE, 1432 _In_ ULONG64, 1433 _In_ PSYM_ENUMSYMBOLS_CALLBACK64, 1434 _In_opt_ PVOID); 1435 1436 BOOL 1437 WINAPI 1438 SymEnumerateSymbolsW64( 1439 _In_ HANDLE, 1440 _In_ ULONG64, 1441 _In_ PSYM_ENUMSYMBOLS_CALLBACK64W, 1442 _In_opt_ PVOID); 1443 1444 BOOL 1445 WINAPI 1446 SymEnumSymbolsForAddr( 1447 _In_ HANDLE, 1448 _In_ DWORD64, 1449 _In_ PSYM_ENUMERATESYMBOLS_CALLBACK, 1450 _In_opt_ PVOID); 1451 1452 BOOL 1453 WINAPI 1454 SymEnumSymbolsForAddrW( 1455 _In_ HANDLE, 1456 _In_ DWORD64, 1457 _In_ PSYM_ENUMERATESYMBOLS_CALLBACKW, 1458 _In_opt_ PVOID); 1459 1460 typedef BOOL 1461 (CALLBACK *PSYMBOL_REGISTERED_CALLBACK64)( 1462 _In_ HANDLE, 1463 _In_ ULONG, 1464 _In_opt_ ULONG64, 1465 _In_opt_ ULONG64); 1466 1467 BOOL 1468 WINAPI 1469 SymRegisterCallback64( 1470 _In_ HANDLE, 1471 _In_ PSYMBOL_REGISTERED_CALLBACK64, 1472 _In_ ULONG64); 1473 1474 BOOL 1475 WINAPI 1476 SymRegisterCallbackW64( 1477 _In_ HANDLE, 1478 _In_ PSYMBOL_REGISTERED_CALLBACK64, 1479 _In_ ULONG64); 1480 1481 BOOL 1482 WINAPI 1483 SymUnDName64( 1484 _In_ PIMAGEHLP_SYMBOL64, 1485 _Out_writes_(UnDecNameLength) PSTR, 1486 _In_ DWORD UnDecNameLength); 1487 1488 BOOL WINAPI SymMatchString(_In_ PCSTR, _In_ PCSTR, _In_ BOOL); 1489 BOOL WINAPI SymMatchStringA(_In_ PCSTR, _In_ PCSTR, _In_ BOOL); 1490 BOOL WINAPI SymMatchStringW(_In_ PCWSTR, _In_ PCWSTR, _In_ BOOL); 1491 1492 BOOL 1493 WINAPI 1494 SymSearch( 1495 _In_ HANDLE, 1496 _In_ ULONG64, 1497 _In_opt_ DWORD, 1498 _In_opt_ DWORD, 1499 _In_opt_ PCSTR, 1500 _In_opt_ DWORD64, 1501 _In_ PSYM_ENUMERATESYMBOLS_CALLBACK, 1502 _In_opt_ PVOID, 1503 _In_ DWORD); 1504 1505 BOOL 1506 WINAPI 1507 SymSearchW( 1508 _In_ HANDLE, 1509 _In_ ULONG64, 1510 _In_opt_ DWORD, 1511 _In_opt_ DWORD, 1512 _In_opt_ PCWSTR, 1513 _In_opt_ DWORD64, 1514 _In_ PSYM_ENUMERATESYMBOLS_CALLBACKW, 1515 _In_opt_ PVOID, 1516 _In_ DWORD); 1517 1518 DWORD 1519 WINAPI 1520 UnDecorateSymbolName( 1521 _In_ PCSTR, 1522 _Out_writes_(maxStringLength) PSTR, 1523 _In_ DWORD maxStringLength, 1524 _In_ DWORD); 1525 1526 DWORD 1527 WINAPI 1528 UnDecorateSymbolNameW( 1529 _In_ PCWSTR, 1530 _Out_writes_(maxStringLength) PWSTR, 1531 _In_ DWORD maxStringLength, 1532 _In_ DWORD); 1533 1534 BOOL 1535 WINAPI 1536 SymGetScope( 1537 _In_ HANDLE, 1538 _In_ ULONG64, 1539 _In_ DWORD, 1540 _Inout_ PSYMBOL_INFO); 1541 1542 BOOL 1543 WINAPI 1544 SymGetScopeW( 1545 _In_ HANDLE, 1546 _In_ ULONG64, 1547 _In_ DWORD, 1548 _Inout_ PSYMBOL_INFOW); 1549 1550 BOOL 1551 WINAPI 1552 SymFromIndex( 1553 _In_ HANDLE, 1554 _In_ ULONG64, 1555 _In_ DWORD, 1556 _Inout_ PSYMBOL_INFO); 1557 1558 BOOL 1559 WINAPI 1560 SymFromIndexW( 1561 _In_ HANDLE, 1562 _In_ ULONG64, 1563 _In_ DWORD, 1564 _Inout_ PSYMBOL_INFOW); 1565 1566 BOOL 1567 WINAPI 1568 SymAddSymbol( 1569 _In_ HANDLE, 1570 _In_ ULONG64, 1571 _In_ PCSTR, 1572 _In_ DWORD64, 1573 _In_ DWORD, 1574 _In_ DWORD); 1575 1576 BOOL 1577 WINAPI 1578 SymAddSymbolW( 1579 _In_ HANDLE, 1580 _In_ ULONG64, 1581 _In_ PCWSTR, 1582 _In_ DWORD64, 1583 _In_ DWORD, 1584 _In_ DWORD); 1585 1586 BOOL 1587 WINAPI 1588 SymDeleteSymbol( 1589 _In_ HANDLE, 1590 _In_ ULONG64, 1591 _In_opt_ PCSTR, 1592 _In_ DWORD64, 1593 _In_ DWORD); 1594 1595 BOOL 1596 WINAPI 1597 SymDeleteSymbolW( 1598 _In_ HANDLE, 1599 _In_ ULONG64, 1600 _In_opt_ PCWSTR, 1601 _In_ DWORD64, 1602 _In_ DWORD); 1603 1604 /************************* 1605 * Source Files * 1606 *************************/ 1607 1608 typedef BOOL 1609 (CALLBACK *PSYM_ENUMSOURCEFILES_CALLBACK)( 1610 _In_ PSOURCEFILE, 1611 _In_opt_ PVOID); 1612 1613 typedef BOOL 1614 (CALLBACK *PSYM_ENUMSOURCEFILES_CALLBACKW)( 1615 _In_ PSOURCEFILEW, 1616 _In_opt_ PVOID); 1617 1618 BOOL 1619 WINAPI 1620 SymEnumSourceFiles( 1621 _In_ HANDLE, 1622 _In_ ULONG64, 1623 _In_opt_ PCSTR, 1624 _In_ PSYM_ENUMSOURCEFILES_CALLBACK, 1625 _In_opt_ PVOID); 1626 1627 BOOL 1628 WINAPI 1629 SymEnumSourceFilesW( 1630 _In_ HANDLE, 1631 _In_ ULONG64, 1632 _In_opt_ PCWSTR, 1633 _In_ PSYM_ENUMSOURCEFILES_CALLBACKW, 1634 _In_opt_ PVOID); 1635 1636 BOOL 1637 WINAPI 1638 SymGetLineFromAddr64( 1639 _In_ HANDLE, 1640 _In_ DWORD64, 1641 _Out_ PDWORD, 1642 _Out_ PIMAGEHLP_LINE64); 1643 1644 BOOL 1645 WINAPI 1646 SymGetLineFromAddrW64( 1647 _In_ HANDLE, 1648 _In_ DWORD64, 1649 _Out_ PDWORD, 1650 _Out_ PIMAGEHLP_LINEW64); 1651 1652 BOOL WINAPI SymGetLinePrev64(_In_ HANDLE, _Inout_ PIMAGEHLP_LINE64); 1653 BOOL WINAPI SymGetLinePrevW64(_In_ HANDLE, _Inout_ PIMAGEHLP_LINEW64); 1654 BOOL WINAPI SymGetLineNext64(_In_ HANDLE, _Inout_ PIMAGEHLP_LINE64); 1655 BOOL WINAPI SymGetLineNextW64(_In_ HANDLE, _Inout_ PIMAGEHLP_LINEW64); 1656 1657 BOOL 1658 WINAPI 1659 SymGetLineFromName64( 1660 _In_ HANDLE, 1661 _In_opt_ PCSTR, 1662 _In_opt_ PCSTR, 1663 _In_ DWORD, 1664 _Out_ PLONG, 1665 _Inout_ PIMAGEHLP_LINE64); 1666 1667 BOOL 1668 WINAPI 1669 SymGetLineFromNameW64( 1670 _In_ HANDLE, 1671 _In_opt_ PCWSTR, 1672 _In_opt_ PCWSTR, 1673 _In_ DWORD, 1674 _Out_ PLONG, 1675 _Inout_ PIMAGEHLP_LINEW64); 1676 1677 ULONG 1678 WINAPI 1679 SymGetFileLineOffsets64( 1680 _In_ HANDLE, 1681 _In_opt_ PCSTR, 1682 _In_ PCSTR, 1683 _Out_writes_(BufferLines) PDWORD64, 1684 _In_ ULONG BufferLines); 1685 1686 BOOL 1687 WINAPI 1688 SymGetSourceFile( 1689 _In_ HANDLE, 1690 _In_ ULONG64, 1691 _In_opt_ PCSTR, 1692 _In_ PCSTR, 1693 _Out_writes_(Size) PSTR, 1694 _In_ DWORD Size); 1695 1696 BOOL 1697 WINAPI 1698 SymGetSourceFileW( 1699 _In_ HANDLE, 1700 _In_ ULONG64, 1701 _In_opt_ PCWSTR, 1702 _In_ PCWSTR, 1703 _Out_writes_(Size) PWSTR, 1704 _In_ DWORD Size); 1705 1706 BOOL 1707 WINAPI 1708 SymGetSourceFileToken( 1709 _In_ HANDLE, 1710 _In_ ULONG64, 1711 _In_ PCSTR, 1712 _Outptr_ PVOID*, 1713 _Out_ DWORD*); 1714 1715 BOOL 1716 WINAPI 1717 SymGetSourceFileTokenW( 1718 _In_ HANDLE, 1719 _In_ ULONG64, 1720 _In_ PCWSTR, 1721 _Outptr_ PVOID*, 1722 _Out_ DWORD*); 1723 1724 BOOL 1725 WINAPI 1726 SymGetSourceFileFromToken( 1727 _In_ HANDLE, 1728 _In_ PVOID, 1729 _In_opt_ PCSTR, 1730 _Out_writes_(Size) PSTR, 1731 _In_ DWORD Size); 1732 1733 BOOL 1734 WINAPI 1735 SymGetSourceFileFromTokenW( 1736 _In_ HANDLE, 1737 _In_ PVOID, 1738 _In_opt_ PCWSTR, 1739 _Out_writes_(Size) PWSTR, 1740 _In_ DWORD Size); 1741 1742 BOOL 1743 WINAPI 1744 SymGetSourceVarFromToken( 1745 _In_ HANDLE, 1746 _In_ PVOID, 1747 _In_opt_ PCSTR, 1748 _In_ PCSTR, 1749 _Out_writes_(Size) PSTR, 1750 _In_ DWORD Size); 1751 1752 BOOL 1753 WINAPI 1754 SymGetSourceVarFromTokenW( 1755 _In_ HANDLE, 1756 _In_ PVOID, 1757 _In_opt_ PCWSTR, 1758 _In_ PCWSTR, 1759 _Out_writes_(Size) PWSTR, 1760 _In_ DWORD Size); 1761 1762 typedef struct _SRCCODEINFO 1763 { 1764 DWORD SizeOfStruct; 1765 PVOID Key; 1766 DWORD64 ModBase; 1767 CHAR Obj[MAX_PATH+1]; 1768 CHAR FileName[MAX_PATH+1]; 1769 DWORD LineNumber; 1770 DWORD64 Address; 1771 } SRCCODEINFO, *PSRCCODEINFO; 1772 1773 typedef struct _SRCCODEINFOW 1774 { 1775 DWORD SizeOfStruct; 1776 PVOID Key; 1777 DWORD64 ModBase; 1778 WCHAR Obj[MAX_PATH+1]; 1779 WCHAR FileName[MAX_PATH+1]; 1780 DWORD LineNumber; 1781 DWORD64 Address; 1782 } SRCCODEINFOW, *PSRCCODEINFOW; 1783 1784 typedef BOOL 1785 (CALLBACK* PSYM_ENUMLINES_CALLBACK)( 1786 _In_ PSRCCODEINFO, 1787 _In_opt_ PVOID); 1788 1789 typedef BOOL 1790 (CALLBACK* PSYM_ENUMLINES_CALLBACKW)( 1791 _In_ PSRCCODEINFOW, 1792 _In_opt_ PVOID); 1793 1794 BOOL 1795 WINAPI 1796 SymEnumLines( 1797 _In_ HANDLE, 1798 _In_ ULONG64, 1799 _In_opt_ PCSTR, 1800 _In_opt_ PCSTR, 1801 _In_ PSYM_ENUMLINES_CALLBACK, 1802 _In_opt_ PVOID); 1803 1804 BOOL 1805 WINAPI 1806 SymEnumLinesW( 1807 _In_ HANDLE, 1808 _In_ ULONG64, 1809 _In_opt_ PCWSTR, 1810 _In_opt_ PCWSTR, 1811 _In_ PSYM_ENUMLINES_CALLBACKW, 1812 _In_opt_ PVOID); 1813 1814 BOOL 1815 WINAPI 1816 SymEnumSourceLines( 1817 _In_ HANDLE, 1818 _In_ ULONG64, 1819 _In_opt_ PCSTR, 1820 _In_opt_ PCSTR, 1821 _In_opt_ DWORD, 1822 _In_ DWORD, 1823 _In_ PSYM_ENUMLINES_CALLBACK, 1824 _In_opt_ PVOID); 1825 1826 BOOL 1827 WINAPI 1828 SymEnumSourceLinesW( 1829 _In_ HANDLE, 1830 _In_ ULONG64, 1831 _In_opt_ PCWSTR, 1832 _In_opt_ PCWSTR, 1833 _In_opt_ DWORD, 1834 _In_ DWORD, 1835 _In_ PSYM_ENUMLINES_CALLBACKW, 1836 _In_opt_ PVOID); 1837 1838 /************************* 1839 * File & image handling * 1840 *************************/ 1841 1842 BOOL WINAPI SymInitialize(_In_ HANDLE, _In_opt_ PCSTR, _In_ BOOL); 1843 BOOL WINAPI SymInitializeW(_In_ HANDLE, _In_opt_ PCWSTR, _In_ BOOL); 1844 BOOL WINAPI SymCleanup(_In_ HANDLE); 1845 1846 HANDLE 1847 WINAPI 1848 FindDebugInfoFile( 1849 _In_ PCSTR, 1850 _In_ PCSTR, 1851 _Out_writes_(MAX_PATH + 1) PSTR); 1852 1853 typedef BOOL 1854 (CALLBACK *PFIND_DEBUG_FILE_CALLBACK)( 1855 _In_ HANDLE, 1856 _In_ PCSTR, 1857 _In_ PVOID); 1858 1859 typedef BOOL 1860 (CALLBACK *PFIND_DEBUG_FILE_CALLBACKW)( 1861 _In_ HANDLE, 1862 _In_ PCWSTR, 1863 _In_ PVOID); 1864 1865 HANDLE 1866 WINAPI 1867 FindDebugInfoFileEx( 1868 _In_ PCSTR, 1869 _In_ PCSTR, 1870 _Out_writes_(MAX_PATH + 1) PSTR, 1871 _In_opt_ PFIND_DEBUG_FILE_CALLBACK, 1872 _In_opt_ PVOID); 1873 1874 HANDLE 1875 WINAPI 1876 FindDebugInfoFileExW( 1877 _In_ PCWSTR, 1878 _In_ PCWSTR, 1879 _Out_writes_(MAX_PATH + 1) PWSTR, 1880 _In_opt_ PFIND_DEBUG_FILE_CALLBACKW, 1881 _In_opt_ PVOID); 1882 1883 HANDLE 1884 WINAPI 1885 SymFindDebugInfoFile( 1886 _In_ HANDLE, 1887 _In_ PCSTR, 1888 _Out_writes_(MAX_PATH + 1) PSTR, 1889 _In_opt_ PFIND_DEBUG_FILE_CALLBACK, 1890 _In_opt_ PVOID); 1891 1892 HANDLE 1893 WINAPI 1894 SymFindDebugInfoFileW( 1895 _In_ HANDLE, 1896 _In_ PCWSTR, 1897 _Out_writes_(MAX_PATH + 1) PWSTR, 1898 _In_opt_ PFIND_DEBUG_FILE_CALLBACKW, 1899 _In_opt_ PVOID); 1900 1901 typedef BOOL 1902 (CALLBACK *PFINDFILEINPATHCALLBACK)( 1903 _In_ PCSTR, 1904 _In_ PVOID); 1905 1906 typedef BOOL 1907 (CALLBACK *PFINDFILEINPATHCALLBACKW)( 1908 _In_ PCWSTR, 1909 _In_ PVOID); 1910 1911 BOOL WINAPI FindFileInPath(HANDLE, PCSTR, PCSTR, PVOID, DWORD, DWORD, DWORD, 1912 PSTR, PFINDFILEINPATHCALLBACK, PVOID); 1913 1914 BOOL 1915 WINAPI 1916 SymFindFileInPath( 1917 _In_ HANDLE, 1918 _In_opt_ PCSTR, 1919 _In_ PCSTR, 1920 _In_opt_ PVOID, 1921 _In_ DWORD, 1922 _In_ DWORD, 1923 _In_ DWORD, 1924 _Out_writes_(MAX_PATH + 1) PSTR, 1925 _In_opt_ PFINDFILEINPATHCALLBACK, 1926 _In_opt_ PVOID); 1927 1928 BOOL 1929 WINAPI 1930 SymFindFileInPathW( 1931 _In_ HANDLE, 1932 _In_opt_ PCWSTR, 1933 _In_ PCWSTR, 1934 _In_opt_ PVOID, 1935 _In_ DWORD, 1936 _In_ DWORD, 1937 _In_ DWORD, 1938 _Out_writes_(MAX_PATH + 1) PWSTR, 1939 _In_opt_ PFINDFILEINPATHCALLBACKW, 1940 _In_opt_ PVOID); 1941 1942 HANDLE 1943 WINAPI 1944 FindExecutableImage( 1945 _In_ PCSTR, 1946 _In_ PCSTR, 1947 _Out_writes_(MAX_PATH + 1) PSTR); 1948 1949 typedef BOOL 1950 (CALLBACK *PFIND_EXE_FILE_CALLBACK)( 1951 _In_ HANDLE, 1952 _In_ PCSTR, 1953 _In_opt_ PVOID); 1954 1955 typedef BOOL 1956 (CALLBACK *PFIND_EXE_FILE_CALLBACKW)( 1957 _In_ HANDLE, 1958 _In_ PCWSTR, 1959 _In_opt_ PVOID); 1960 1961 HANDLE 1962 WINAPI 1963 FindExecutableImageEx( 1964 _In_ PCSTR, 1965 _In_ PCSTR, 1966 _Out_writes_(MAX_PATH + 1) PSTR, 1967 _In_opt_ PFIND_EXE_FILE_CALLBACK, 1968 _In_opt_ PVOID); 1969 1970 HANDLE 1971 WINAPI 1972 FindExecutableImageExW( 1973 _In_ PCWSTR, 1974 _In_ PCWSTR, 1975 _Out_writes_(MAX_PATH + 1) PWSTR, 1976 _In_opt_ PFIND_EXE_FILE_CALLBACKW, 1977 _In_opt_ PVOID); 1978 1979 HANDLE 1980 WINAPI 1981 SymFindExecutableImage( 1982 _In_ HANDLE, 1983 _In_ PCSTR, 1984 _Out_writes_(MAX_PATH + 1) PSTR, 1985 _In_ PFIND_EXE_FILE_CALLBACK, 1986 _In_ PVOID); 1987 1988 HANDLE 1989 WINAPI 1990 SymFindExecutableImageW( 1991 _In_ HANDLE, 1992 _In_ PCWSTR, 1993 _Out_writes_(MAX_PATH + 1) PWSTR, 1994 _In_ PFIND_EXE_FILE_CALLBACKW, 1995 _In_ PVOID); 1996 1997 PIMAGE_NT_HEADERS WINAPI ImageNtHeader(_In_ PVOID); 1998 1999 PVOID 2000 WINAPI 2001 ImageDirectoryEntryToDataEx( 2002 _In_ PVOID, 2003 _In_ BOOLEAN, 2004 _In_ USHORT, 2005 _Out_ PULONG, 2006 _Out_opt_ PIMAGE_SECTION_HEADER *); 2007 2008 PVOID 2009 WINAPI 2010 ImageDirectoryEntryToData( 2011 _In_ PVOID, 2012 _In_ BOOLEAN, 2013 _In_ USHORT, 2014 _Out_ PULONG); 2015 2016 PIMAGE_SECTION_HEADER 2017 WINAPI 2018 ImageRvaToSection( 2019 _In_ PIMAGE_NT_HEADERS, 2020 _In_ PVOID, 2021 _In_ ULONG); 2022 2023 PVOID 2024 WINAPI 2025 ImageRvaToVa( 2026 _In_ PIMAGE_NT_HEADERS, 2027 _In_ PVOID, 2028 _In_ ULONG, 2029 _In_opt_ PIMAGE_SECTION_HEADER*); 2030 2031 BOOL 2032 WINAPI 2033 SymGetSearchPath( 2034 _In_ HANDLE, 2035 _Out_writes_(SearchPathLength) PSTR, 2036 _In_ DWORD SearchPathLength); 2037 2038 BOOL 2039 WINAPI 2040 SymGetSearchPathW( 2041 _In_ HANDLE, 2042 _Out_writes_(SearchPathLength) PWSTR, 2043 _In_ DWORD SearchPathLength); 2044 2045 BOOL WINAPI SymSetSearchPath(_In_ HANDLE, _In_opt_ PCSTR); 2046 BOOL WINAPI SymSetSearchPathW(_In_ HANDLE, _In_opt_ PCWSTR); 2047 DWORD WINAPI GetTimestampForLoadedLibrary(_In_ HMODULE); 2048 BOOL WINAPI MakeSureDirectoryPathExists(_In_ PCSTR); 2049 2050 BOOL 2051 WINAPI 2052 SearchTreeForFile( 2053 _In_ PCSTR, 2054 _In_ PCSTR, 2055 _Out_writes_(MAX_PATH + 1) PSTR); 2056 2057 BOOL 2058 WINAPI 2059 SearchTreeForFileW( 2060 _In_ PCWSTR, 2061 _In_ PCWSTR, 2062 _Out_writes_(MAX_PATH + 1) PWSTR); 2063 2064 typedef BOOL 2065 (CALLBACK *PENUMDIRTREE_CALLBACK)( 2066 _In_ PCSTR, 2067 _In_opt_ PVOID); 2068 2069 typedef BOOL 2070 (CALLBACK *PENUMDIRTREE_CALLBACKW)( 2071 _In_ PCWSTR, 2072 _In_opt_ PVOID); 2073 2074 BOOL 2075 WINAPI 2076 EnumDirTree( 2077 _In_opt_ HANDLE, 2078 _In_ PCSTR, 2079 _In_ PCSTR, 2080 _Out_writes_opt_(MAX_PATH + 1) PSTR, 2081 _In_opt_ PENUMDIRTREE_CALLBACK, 2082 _In_opt_ PVOID); 2083 2084 BOOL 2085 WINAPI 2086 EnumDirTreeW( 2087 _In_opt_ HANDLE, 2088 _In_ PCWSTR, 2089 _In_ PCWSTR, 2090 _Out_writes_opt_(MAX_PATH + 1) PWSTR, 2091 _In_opt_ PENUMDIRTREE_CALLBACKW, 2092 _In_opt_ PVOID); 2093 2094 BOOL 2095 WINAPI 2096 SymMatchFileName( 2097 _In_ PCSTR, 2098 _In_ PCSTR, 2099 _Outptr_opt_ PSTR*, 2100 _Outptr_opt_ PSTR*); 2101 2102 BOOL 2103 WINAPI 2104 SymMatchFileNameW( 2105 _In_ PCWSTR, 2106 _In_ PCWSTR, 2107 _Outptr_opt_ PWSTR*, 2108 _Outptr_opt_ PWSTR*); 2109 2110 PCHAR WINAPI SymSetHomeDirectory(_In_opt_ HANDLE, _In_opt_ PCSTR); 2111 PWSTR WINAPI SymSetHomeDirectoryW(_In_opt_ HANDLE, _In_opt_ PCWSTR); 2112 2113 PCHAR 2114 WINAPI 2115 SymGetHomeDirectory( 2116 _In_ DWORD, 2117 _Out_writes_(size) PSTR, 2118 _In_ size_t size); 2119 2120 PWSTR 2121 WINAPI 2122 SymGetHomeDirectoryW( 2123 _In_ DWORD, 2124 _Out_writes_(size) PWSTR, 2125 _In_ size_t size); 2126 2127 #define hdBase 0 2128 #define hdSym 1 2129 #define hdSrc 2 2130 #define hdMax 3 2131 2132 /************************* 2133 * Context management * 2134 *************************/ 2135 2136 BOOL 2137 WINAPI 2138 SymSetContext( 2139 _In_ HANDLE, 2140 _In_ PIMAGEHLP_STACK_FRAME, 2141 _In_opt_ PIMAGEHLP_CONTEXT); 2142 2143 2144 /************************* 2145 * Stack management * 2146 *************************/ 2147 2148 #if !defined(_IMAGEHLP_SOURCE_) && defined(_IMAGEHLP64) 2149 #define KDHELP KDHELP64 2150 #define PKDHELP PKDHELP64 2151 #else 2152 typedef struct _KDHELP 2153 { 2154 DWORD Thread; 2155 DWORD ThCallbackStack; 2156 DWORD NextCallback; 2157 DWORD FramePointer; 2158 DWORD KiCallUserMode; 2159 DWORD KeUserCallbackDispatcher; 2160 DWORD SystemRangeStart; 2161 } KDHELP, *PKDHELP; 2162 #endif 2163 2164 typedef struct _KDHELP64 2165 { 2166 DWORD64 Thread; 2167 DWORD ThCallbackStack; 2168 DWORD ThCallbackBStore; 2169 DWORD NextCallback; 2170 DWORD FramePointer; 2171 DWORD64 KiCallUserMode; 2172 DWORD64 KeUserCallbackDispatcher; 2173 DWORD64 SystemRangeStart; 2174 DWORD64 Reserved[8]; 2175 } KDHELP64, *PKDHELP64; 2176 2177 #if !defined(_IMAGEHLP_SOURCE_) && defined(_IMAGEHLP64) 2178 #define STACKFRAME STACKFRAME64 2179 #define LPSTACKFRAME LPSTACKFRAME64 2180 #else 2181 typedef struct _STACKFRAME 2182 { 2183 ADDRESS AddrPC; 2184 ADDRESS AddrReturn; 2185 ADDRESS AddrFrame; 2186 ADDRESS AddrStack; 2187 PVOID FuncTableEntry; 2188 DWORD Params[4]; 2189 BOOL Far; 2190 BOOL Virtual; 2191 DWORD Reserved[3]; 2192 KDHELP KdHelp; 2193 ADDRESS AddrBStore; 2194 } STACKFRAME, *LPSTACKFRAME; 2195 #endif 2196 2197 typedef struct _STACKFRAME64 2198 { 2199 ADDRESS64 AddrPC; 2200 ADDRESS64 AddrReturn; 2201 ADDRESS64 AddrFrame; 2202 ADDRESS64 AddrStack; 2203 ADDRESS64 AddrBStore; 2204 PVOID FuncTableEntry; 2205 DWORD64 Params[4]; 2206 BOOL Far; 2207 BOOL Virtual; 2208 DWORD64 Reserved[3]; 2209 KDHELP64 KdHelp; 2210 } STACKFRAME64, *LPSTACKFRAME64; 2211 2212 typedef BOOL 2213 (CALLBACK *PREAD_PROCESS_MEMORY_ROUTINE64)( 2214 _In_ HANDLE, 2215 _In_ DWORD64, 2216 _Out_writes_bytes_(nSize) PVOID, 2217 _In_ DWORD nSize, 2218 _Out_ PDWORD); 2219 2220 typedef PVOID 2221 (CALLBACK *PFUNCTION_TABLE_ACCESS_ROUTINE64)( 2222 _In_ HANDLE, 2223 _In_ DWORD64); 2224 2225 typedef DWORD64 2226 (CALLBACK *PGET_MODULE_BASE_ROUTINE64)( 2227 _In_ HANDLE, 2228 _In_ DWORD64); 2229 2230 typedef DWORD64 2231 (CALLBACK *PTRANSLATE_ADDRESS_ROUTINE64)( 2232 _In_ HANDLE, 2233 _In_ HANDLE, 2234 _In_ LPADDRESS64); 2235 2236 BOOL 2237 WINAPI 2238 StackWalk64( 2239 _In_ DWORD, 2240 _In_ HANDLE, 2241 _In_ HANDLE, 2242 _Inout_ LPSTACKFRAME64, 2243 _Inout_ PVOID, 2244 _In_opt_ PREAD_PROCESS_MEMORY_ROUTINE64, 2245 _In_opt_ PFUNCTION_TABLE_ACCESS_ROUTINE64, 2246 _In_opt_ PGET_MODULE_BASE_ROUTINE64, 2247 _In_opt_ PTRANSLATE_ADDRESS_ROUTINE64); 2248 2249 PVOID WINAPI SymFunctionTableAccess64(_In_ HANDLE, _In_ DWORD64); 2250 2251 typedef PVOID 2252 (CALLBACK *PSYMBOL_FUNCENTRY_CALLBACK64)( 2253 _In_ HANDLE, 2254 _In_ ULONG64, 2255 _In_ ULONG64); 2256 2257 BOOL 2258 WINAPI 2259 SymRegisterFunctionEntryCallback64( 2260 _In_ HANDLE, 2261 _In_ PSYMBOL_FUNCENTRY_CALLBACK64, 2262 _In_ ULONG64); 2263 2264 /************************* 2265 * Version, global stuff * 2266 *************************/ 2267 2268 #define API_VERSION_NUMBER 9 2269 2270 typedef struct API_VERSION 2271 { 2272 USHORT MajorVersion; 2273 USHORT MinorVersion; 2274 USHORT Revision; 2275 USHORT Reserved; 2276 } API_VERSION, *LPAPI_VERSION; 2277 2278 LPAPI_VERSION WINAPI ImagehlpApiVersion(void); 2279 LPAPI_VERSION WINAPI ImagehlpApiVersionEx(_In_ LPAPI_VERSION); 2280 2281 typedef struct _IMAGE_DEBUG_INFORMATION 2282 { 2283 LIST_ENTRY List; 2284 DWORD ReservedSize; 2285 PVOID ReservedMappedBase; 2286 USHORT ReservedMachine; 2287 USHORT ReservedCharacteristics; 2288 DWORD ReservedCheckSum; 2289 DWORD ImageBase; 2290 DWORD SizeOfImage; 2291 DWORD ReservedNumberOfSections; 2292 PIMAGE_SECTION_HEADER ReservedSections; 2293 DWORD ReservedExportedNamesSize; 2294 PSTR ReservedExportedNames; 2295 DWORD ReservedNumberOfFunctionTableEntries; 2296 PIMAGE_FUNCTION_ENTRY ReservedFunctionTableEntries; 2297 DWORD ReservedLowestFunctionStartingAddress; 2298 DWORD ReservedHighestFunctionEndingAddress; 2299 DWORD ReservedNumberOfFpoTableEntries; 2300 PFPO_DATA ReservedFpoTableEntries; 2301 DWORD SizeOfCoffSymbols; 2302 PIMAGE_COFF_SYMBOLS_HEADER CoffSymbols; 2303 DWORD ReservedSizeOfCodeViewSymbols; 2304 PVOID ReservedCodeViewSymbols; 2305 PSTR ImageFilePath; 2306 PSTR ImageFileName; 2307 PSTR ReservedDebugFilePath; 2308 DWORD ReservedTimeDateStamp; 2309 BOOL ReservedRomImage; 2310 PIMAGE_DEBUG_DIRECTORY ReservedDebugDirectory; 2311 DWORD ReservedNumberOfDebugDirectories; 2312 DWORD ReservedOriginalFunctionTableBaseAddress; 2313 DWORD Reserved[ 2 ]; 2314 } IMAGE_DEBUG_INFORMATION, *PIMAGE_DEBUG_INFORMATION; 2315 2316 typedef enum 2317 { 2318 SYMOPT_EX_DISABLEACCESSTIMEUPDATE, 2319 SYMOPT_EX_MAX, 2320 2321 #ifdef __WINESRC__ 2322 SYMOPT_EX_WINE_NATIVE_MODULES = 1000, 2323 #endif 2324 } IMAGEHLP_EXTENDED_OPTIONS; 2325 2326 PIMAGE_DEBUG_INFORMATION 2327 WINAPI 2328 MapDebugInformation( 2329 _In_opt_ HANDLE, 2330 _In_ PCSTR, 2331 _In_opt_ PCSTR, 2332 _In_ ULONG); 2333 2334 BOOL WINAPI UnmapDebugInformation(_Out_ PIMAGE_DEBUG_INFORMATION); 2335 2336 DWORD WINAPI SymGetOptions(void); 2337 DWORD WINAPI SymSetOptions(_In_ DWORD); 2338 2339 BOOL WINAPI SymGetExtendedOption(_In_ IMAGEHLP_EXTENDED_OPTIONS option); 2340 BOOL WINAPI SymSetExtendedOption(_In_ IMAGEHLP_EXTENDED_OPTIONS option, _In_ BOOL value); 2341 2342 BOOL WINAPI SymSetParentWindow(_In_ HWND); 2343 2344 BOOL 2345 IMAGEAPI 2346 SymSrvIsStore( 2347 _In_opt_ HANDLE hProcess, 2348 _In_ PCSTR path); 2349 2350 BOOL 2351 IMAGEAPI 2352 SymSrvIsStoreW( 2353 _In_opt_ HANDLE hProcess, 2354 _In_ PCWSTR path); 2355 2356 /************************* 2357 * Version, global stuff * 2358 *************************/ 2359 2360 typedef BOOL (WINAPI* PSYMBOLSERVERPROC)(PCSTR, PCSTR, PVOID, DWORD, DWORD, PSTR); 2361 typedef BOOL (WINAPI* PSYMBOLSERVERPROCA)(PCSTR, PCSTR, PVOID, DWORD, DWORD, PSTR); 2362 typedef BOOL (WINAPI* PSYMBOLSERVERPROCW)(PCWSTR, PCWSTR, PVOID, DWORD, DWORD, PWSTR); 2363 typedef BOOL (WINAPI* PSYMBOLSERVEROPENPROC)(void); 2364 typedef BOOL (WINAPI* PSYMBOLSERVERCLOSEPROC)(void); 2365 typedef BOOL (WINAPI* PSYMBOLSERVERSETOPTIONSPROC)(UINT_PTR, ULONG64); 2366 typedef BOOL (CALLBACK* PSYMBOLSERVERCALLBACKPROC)(UINT_PTR, ULONG64, ULONG64); 2367 typedef UINT_PTR (WINAPI* PSYMBOLSERVERGETOPTIONSPROC)(void); 2368 typedef BOOL (WINAPI* PSYMBOLSERVERPINGPROC)(PCSTR); 2369 typedef BOOL (WINAPI* PSYMBOLSERVERPINGPROCA)(PCSTR); 2370 typedef BOOL (WINAPI* PSYMBOLSERVERPINGPROCW)(PCWSTR); 2371 2372 #define SSRVOPT_CALLBACK 0x0001 2373 #define SSRVOPT_DWORD 0x0002 2374 #define SSRVOPT_DWORDPTR 0x0004 2375 #define SSRVOPT_GUIDPTR 0x0008 2376 #define SSRVOPT_OLDGUIDPTR 0x0010 2377 #define SSRVOPT_UNATTENDED 0x0020 2378 #define SSRVOPT_NOCOPY 0x0040 2379 #define SSRVOPT_PARENTWIN 0x0080 2380 #define SSRVOPT_PARAMTYPE 0x0100 2381 #define SSRVOPT_SECURE 0x0200 2382 #define SSRVOPT_TRACE 0x0400 2383 #define SSRVOPT_SETCONTEXT 0x0800 2384 #define SSRVOPT_PROXY 0x1000 2385 #define SSRVOPT_DOWNSTREAM_STORE 0x2000 2386 #define SSRVOPT_RESET ((ULONG_PTR)-1) 2387 2388 #define SSRVACTION_TRACE 1 2389 #define SSRVACTION_QUERYCANCEL 2 2390 #define SSRVACTION_EVENT 3 2391 2392 /* 32-bit functions */ 2393 2394 #if !defined(_IMAGEHLP_SOURCE_) && defined(_IMAGEHLP64) 2395 2396 #define PENUMLOADED_MODULES_CALLBACK PENUMLOADED_MODULES_CALLBACK64 2397 #define PFUNCTION_TABLE_ACCESS_ROUTINE PFUNCTION_TABLE_ACCESS_ROUTINE64 2398 #define PGET_MODULE_BASE_ROUTINE PGET_MODULE_BASE_ROUTINE64 2399 #define PREAD_PROCESS_MEMORY_ROUTINE PREAD_PROCESS_MEMORY_ROUTINE64 2400 #define PSYMBOL_FUNCENTRY_CALLBACK PSYMBOL_FUNCENTRY_CALLBACK64 2401 #define PSYMBOL_REGISTERED_CALLBACK PSYMBOL_REGISTERED_CALLBACK64 2402 #define PSYM_ENUMMODULES_CALLBACK PSYM_ENUMMODULES_CALLBACK64 2403 #define PSYM_ENUMSYMBOLS_CALLBACK PSYM_ENUMSYMBOLS_CALLBACK64 2404 #define PSYM_ENUMSYMBOLS_CALLBACKW PSYM_ENUMSYMBOLS_CALLBACKW64 2405 #define PTRANSLATE_ADDRESS_ROUTINE PTRANSLATE_ADDRESS_ROUTINE64 2406 2407 #define EnumerateLoadedModules EnumerateLoadedModules64 2408 #define StackWalk StackWalk64 2409 #define SymEnumerateModules SymEnumerateModules64 2410 #define SymEnumerateSymbols SymEnumerateSymbols64 2411 #define SymEnumerateSymbolsW SymEnumerateSymbolsW64 2412 #define SymFunctionTableAccess SymFunctionTableAccess64 2413 #define SymGetLineFromAddr SymGetLineFromAddr64 2414 #define SymGetLineFromAddrW SymGetLineFromAddrW64 2415 #define SymGetLineFromName SymGetLineFromName64 2416 #define SymGetLineNext SymGetLineNext64 2417 #define SymGetLineNextW SymGetLineNextW64 2418 #define SymGetLinePrev SymGetLinePrev64 2419 #define SymGetLinePrevW SymGetLinePrevW64 2420 #define SymGetModuleBase SymGetModuleBase64 2421 #define SymGetModuleInfo SymGetModuleInfo64 2422 #define SymGetModuleInfoW SymGetModuleInfoW64 2423 #define SymGetSymFromAddr SymGetSymFromAddr64 2424 #define SymGetSymFromName SymGetSymFromName64 2425 #define SymGetSymNext SymGetSymNext64 2426 #define SymGetSymNextW SymGetSymNextW64 2427 #define SymGetSymPrev SymGetSymPrev64 2428 #define SymGetSymPrevW SymGetSymPrevW64 2429 #define SymLoadModule SymLoadModule64 2430 #define SymRegisterCallback SymRegisterCallback64 2431 #define SymRegisterFunctionEntryCallback SymRegisterFunctionEntryCallback64 2432 #define SymUnDName SymUnDName64 2433 #define SymUnloadModule SymUnloadModule64 2434 2435 #else 2436 2437 typedef BOOL 2438 (CALLBACK *PENUMLOADED_MODULES_CALLBACK)( 2439 _In_ PCSTR, 2440 _In_ ULONG, 2441 _In_ ULONG, 2442 _In_opt_ PVOID); 2443 2444 typedef PVOID 2445 (CALLBACK *PFUNCTION_TABLE_ACCESS_ROUTINE)( 2446 _In_ HANDLE, 2447 _In_ DWORD); 2448 2449 typedef DWORD 2450 (CALLBACK *PGET_MODULE_BASE_ROUTINE)( 2451 _In_ HANDLE, 2452 _In_ DWORD); 2453 2454 typedef BOOL 2455 (CALLBACK *PREAD_PROCESS_MEMORY_ROUTINE)( 2456 _In_ HANDLE, 2457 _In_ DWORD, 2458 _Out_writes_bytes_(nSize) PVOID, 2459 _In_ DWORD nSize, 2460 _Out_ PDWORD); 2461 2462 typedef BOOL 2463 (CALLBACK *PSYM_ENUMMODULES_CALLBACK)( 2464 _In_ PCSTR, 2465 _In_ ULONG, 2466 _In_opt_ PVOID); 2467 2468 typedef BOOL 2469 (CALLBACK *PSYM_ENUMSYMBOLS_CALLBACK)( 2470 _In_ PCSTR, 2471 _In_ ULONG, 2472 _In_ ULONG, 2473 _In_opt_ PVOID); 2474 2475 typedef BOOL 2476 (CALLBACK *PSYM_ENUMSYMBOLS_CALLBACKW)( 2477 _In_ PCWSTR, 2478 _In_ ULONG, 2479 _In_ ULONG, 2480 _In_opt_ PVOID); 2481 2482 typedef BOOL 2483 (CALLBACK *PSYMBOL_REGISTERED_CALLBACK)( 2484 _In_ HANDLE, 2485 _In_ ULONG, 2486 _In_opt_ PVOID, 2487 _In_opt_ PVOID); 2488 2489 typedef PVOID 2490 (CALLBACK *PSYMBOL_FUNCENTRY_CALLBACK)( 2491 _In_ HANDLE, 2492 _In_ DWORD, 2493 _In_opt_ PVOID); 2494 2495 typedef DWORD 2496 (CALLBACK *PTRANSLATE_ADDRESS_ROUTINE)( 2497 _In_ HANDLE, 2498 _In_ HANDLE, 2499 _Out_ LPADDRESS); 2500 2501 BOOL 2502 WINAPI 2503 EnumerateLoadedModules( 2504 _In_ HANDLE, 2505 _In_ PENUMLOADED_MODULES_CALLBACK, 2506 _In_opt_ PVOID); 2507 2508 BOOL 2509 WINAPI 2510 StackWalk( 2511 _In_ DWORD, 2512 _In_ HANDLE, 2513 _In_ HANDLE, 2514 _Inout_ LPSTACKFRAME, 2515 _Inout_ PVOID, 2516 _In_opt_ PREAD_PROCESS_MEMORY_ROUTINE, 2517 _In_opt_ PFUNCTION_TABLE_ACCESS_ROUTINE, 2518 _In_opt_ PGET_MODULE_BASE_ROUTINE, 2519 _In_opt_ PTRANSLATE_ADDRESS_ROUTINE); 2520 2521 BOOL 2522 WINAPI 2523 SymEnumerateModules( 2524 _In_ HANDLE, 2525 _In_ PSYM_ENUMMODULES_CALLBACK, 2526 _In_opt_ PVOID); 2527 2528 BOOL 2529 WINAPI 2530 SymEnumerateSymbols( 2531 _In_ HANDLE, 2532 _In_ ULONG, 2533 _In_ PSYM_ENUMSYMBOLS_CALLBACK, 2534 _In_opt_ PVOID); 2535 2536 BOOL 2537 WINAPI 2538 SymEnumerateSymbolsW( 2539 _In_ HANDLE, 2540 _In_ ULONG, 2541 _In_ PSYM_ENUMSYMBOLS_CALLBACKW, 2542 _In_opt_ PVOID); 2543 2544 PVOID WINAPI SymFunctionTableAccess(_In_ HANDLE, _In_ DWORD); 2545 2546 BOOL 2547 WINAPI 2548 SymGetLineFromAddr( 2549 _In_ HANDLE, 2550 _In_ DWORD, 2551 _Out_ PDWORD, 2552 _Out_ PIMAGEHLP_LINE); 2553 2554 BOOL 2555 WINAPI 2556 SymGetLineFromAddrW( 2557 _In_ HANDLE, 2558 _In_ DWORD, 2559 _Out_ PDWORD, 2560 _Out_ PIMAGEHLP_LINEW); 2561 2562 BOOL 2563 WINAPI 2564 SymGetLineFromName( 2565 _In_ HANDLE, 2566 _In_opt_ PCSTR, 2567 _In_opt_ PCSTR, 2568 _In_ DWORD, 2569 _Out_ PLONG, 2570 _Inout_ PIMAGEHLP_LINE); 2571 2572 BOOL WINAPI SymGetLineNext(_In_ HANDLE, _Inout_ PIMAGEHLP_LINE); 2573 BOOL WINAPI SymGetLineNextW(_In_ HANDLE, _Inout_ PIMAGEHLP_LINEW); 2574 BOOL WINAPI SymGetLinePrev(_In_ HANDLE, _Inout_ PIMAGEHLP_LINE); 2575 BOOL WINAPI SymGetLinePrevW(_In_ HANDLE, _Inout_ PIMAGEHLP_LINEW); 2576 DWORD WINAPI SymGetModuleBase(_In_ HANDLE, _In_ DWORD); 2577 2578 BOOL 2579 WINAPI 2580 SymGetModuleInfo( 2581 _In_ HANDLE, 2582 _In_ DWORD, 2583 _Out_ PIMAGEHLP_MODULE); 2584 2585 BOOL 2586 WINAPI 2587 SymGetModuleInfoW( 2588 _In_ HANDLE, 2589 _In_ DWORD, 2590 _Out_ PIMAGEHLP_MODULEW); 2591 2592 BOOL 2593 WINAPI 2594 SymGetSymFromAddr( 2595 _In_ HANDLE, 2596 _In_ DWORD, 2597 _Out_opt_ PDWORD, 2598 _Inout_ PIMAGEHLP_SYMBOL); 2599 2600 BOOL 2601 WINAPI 2602 SymGetSymFromName( 2603 _In_ HANDLE, 2604 _In_ PCSTR, 2605 _Inout_ PIMAGEHLP_SYMBOL); 2606 2607 BOOL WINAPI SymGetSymNext(_In_ HANDLE, _Inout_ PIMAGEHLP_SYMBOL); 2608 BOOL WINAPI SymGetSymNextW(_In_ HANDLE, _Inout_ PIMAGEHLP_SYMBOLW); 2609 BOOL WINAPI SymGetSymPrev(_In_ HANDLE, _Inout_ PIMAGEHLP_SYMBOL); 2610 BOOL WINAPI SymGetSymPrevW(_In_ HANDLE, _Inout_ PIMAGEHLP_SYMBOLW); 2611 2612 DWORD 2613 WINAPI 2614 SymLoadModule( 2615 _In_ HANDLE, 2616 _In_opt_ HANDLE, 2617 _In_opt_ PCSTR, 2618 _In_opt_ PCSTR, 2619 _In_ DWORD, 2620 _In_ DWORD); 2621 2622 BOOL 2623 WINAPI 2624 SymRegisterCallback( 2625 _In_ HANDLE, 2626 _In_ PSYMBOL_REGISTERED_CALLBACK, 2627 _In_opt_ PVOID); 2628 2629 BOOL 2630 WINAPI 2631 SymRegisterFunctionEntryCallback( 2632 _In_ HANDLE, 2633 _In_ PSYMBOL_FUNCENTRY_CALLBACK, 2634 _In_opt_ PVOID); 2635 2636 BOOL WINAPI SymRefreshModuleList(_In_ HANDLE); 2637 2638 BOOL 2639 WINAPI 2640 SymUnDName( 2641 _In_ PIMAGEHLP_SYMBOL, 2642 _Out_writes_(UnDecNameLength) PSTR, 2643 _In_ DWORD UnDecNameLength); 2644 2645 BOOL WINAPI SymUnloadModule(_In_ HANDLE, _In_ DWORD); 2646 2647 #endif 2648 2649 #ifdef __cplusplus 2650 } /* extern "C" */ 2651 #endif /* defined(__cplusplus) */ 2652 2653 #endif /* __WINE_DBGHELP_H */ 2654