user32/tests: Account for some messages from dual-monitor setups.
[wine.git] / include / dbghelp.h
blob15e9f9d2d775016c6076f9e805b2475f12b565f7
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
324 #define CBA_SRCSRV_INFO 0x20000000
325 #define CBA_SRCSRV_EVENT 0x40000000
327 typedef struct _IMAGEHLP_CBA_READ_MEMORY
329 DWORD64 addr;
330 PVOID buf;
331 DWORD bytes;
332 DWORD *bytesread;
333 } IMAGEHLP_CBA_READ_MEMORY, *PIMAGEHLP_CBA_READ_MEMORY;
335 enum
337 sevInfo = 0,
338 sevProblem,
339 sevAttn,
340 sevFatal,
341 sevMax
344 #define EVENT_SRCSPEW_START 100
345 #define EVENT_SRCSPEW 100
346 #define EVENT_SRCSPEW_END 199
348 typedef struct _IMAGEHLP_CBA_EVENT
350 DWORD severity;
351 DWORD code;
352 PCHAR desc;
353 PVOID object;
354 } IMAGEHLP_CBA_EVENT, *PIMAGEHLP_CBA_EVENT;
356 typedef struct _IMAGEHLP_CBA_EVENTW
358 DWORD severity;
359 DWORD code;
360 PCWSTR desc;
361 PVOID object;
362 } IMAGEHLP_CBA_EVENTW, *PIMAGEHLP_CBA_EVENTW;
364 #if !defined(_IMAGEHLP_SOURCE_) && defined(_IMAGEHLP64)
365 #define IMAGEHLP_DEFERRED_SYMBOL_LOAD IMAGEHLP_DEFERRED_SYMBOL_LOAD64
366 #define PIMAGEHLP_DEFERRED_SYMBOL_LOAD PIMAGEHLP_DEFERRED_SYMBOL_LOAD64
367 #else
368 typedef struct _IMAGEHLP_DEFERRED_SYMBOL_LOAD
370 DWORD SizeOfStruct;
371 DWORD BaseOfImage;
372 DWORD CheckSum;
373 DWORD TimeDateStamp;
374 CHAR FileName[MAX_PATH];
375 BOOLEAN Reparse;
376 HANDLE hFile;
377 } IMAGEHLP_DEFERRED_SYMBOL_LOAD, *PIMAGEHLP_DEFERRED_SYMBOL_LOAD;
378 #endif
380 typedef struct _IMAGEHLP_DEFERRED_SYMBOL_LOAD64
382 DWORD SizeOfStruct;
383 DWORD64 BaseOfImage;
384 DWORD CheckSum;
385 DWORD TimeDateStamp;
386 CHAR FileName[MAX_PATH];
387 BOOLEAN Reparse;
388 HANDLE hFile;
389 DWORD Flags;
390 } IMAGEHLP_DEFERRED_SYMBOL_LOAD64, *PIMAGEHLP_DEFERRED_SYMBOL_LOAD64;
392 typedef struct _IMAGEHLP_DEFERRED_SYMBOL_LOADW64
394 DWORD SizeOfStruct;
395 DWORD64 BaseOfImage;
396 DWORD CheckSum;
397 DWORD TimeDateStamp;
398 WCHAR FileName[MAX_PATH + 1];
399 BOOLEAN Reparse;
400 HANDLE hFile;
401 DWORD Flags;
402 } IMAGEHLP_DEFERRED_SYMBOL_LOADW64, *PIMAGEHLP_DEFERRED_SYMBOL_LOADW64;
404 #if !defined(_IMAGEHLP_SOURCE_) && defined(_IMAGEHLP64)
405 #define IMAGEHLP_DUPLICATE_SYMBOL IMAGEHLP_DUPLICATE_SYMBOL64
406 #define PIMAGEHLP_DUPLICATE_SYMBOL PIMAGEHLP_DUPLICATE_SYMBOL64
407 #else
408 typedef struct _IMAGEHLP_DUPLICATE_SYMBOL
410 DWORD SizeOfStruct;
411 DWORD NumberOfDups;
412 PIMAGEHLP_SYMBOL Symbol;
413 DWORD SelectedSymbol;
414 } IMAGEHLP_DUPLICATE_SYMBOL, *PIMAGEHLP_DUPLICATE_SYMBOL;
415 #endif
417 typedef struct _IMAGEHLP_DUPLICATE_SYMBOL64
419 DWORD SizeOfStruct;
420 DWORD NumberOfDups;
421 PIMAGEHLP_SYMBOL64 Symbol;
422 DWORD SelectedSymbol;
423 } IMAGEHLP_DUPLICATE_SYMBOL64, *PIMAGEHLP_DUPLICATE_SYMBOL64;
425 #define SYMOPT_CASE_INSENSITIVE 0x00000001
426 #define SYMOPT_UNDNAME 0x00000002
427 #define SYMOPT_DEFERRED_LOADS 0x00000004
428 #define SYMOPT_NO_CPP 0x00000008
429 #define SYMOPT_LOAD_LINES 0x00000010
430 #define SYMOPT_OMAP_FIND_NEAREST 0x00000020
431 #define SYMOPT_LOAD_ANYTHING 0x00000040
432 #define SYMOPT_IGNORE_CVREC 0x00000080
433 #define SYMOPT_NO_UNQUALIFIED_LOADS 0x00000100
434 #define SYMOPT_FAIL_CRITICAL_ERRORS 0x00000200
435 #define SYMOPT_EXACT_SYMBOLS 0x00000400
436 #define SYMOPT_WILD_UNDERSCORE 0x00000800
437 #define SYMOPT_USE_DEFAULTS 0x00001000
438 /* latest SDK defines:
439 #define SYMOPT_ALLOW_ABSOLUTE_SYMBOLS 0x00000800
440 #define SYMOPT_IGNORE_NT_SYMPATH 0x00001000
442 #define SYMOPT_INCLUDE_32BIT_MODULES 0x00002000
443 #define SYMOPT_PUBLICS_ONLY 0x00004000
444 #define SYMOPT_NO_PUBLICS 0x00008000
445 #define SYMOPT_AUTO_PUBLICS 0x00010000
446 #define SYMOPT_NO_IMAGE_SEARCH 0x00020000
447 #define SYMOPT_SECURE 0x00040000
448 #define SYMOPT_NO_PROMPTS 0x00080000
449 #define SYMOPT_OVERWRITE 0x00100000
450 #define SYMOPT_IGNORE_IMAGEDIR 0x00200000
451 #define SYMOPT_FLAT_DIRECTORY 0x00400000
452 #define SYMOPT_FAVOR_COMPRESSED 0x00800000
453 #define SYMOPT_ALLOW_ZERO_ADDRESS 0x01000000
454 #define SYMOPT_DISABLE_SYMSRV_AUTODETECT 0x02000000
455 #define SYMOPT_READONLY_CACHE 0x04000000
456 #define SYMOPT_SYMPATH_LAST 0x08000000
457 #define SYMOPT_DISABLE_FAST_SYMBOLS 0x10000000
458 #define SYMOPT_DISABLE_SYMSRV_TIMEOUT 0x20000000
459 #define SYMOPT_DISABLE_SRVSTAR_ON_STARTUP 0x40000000
460 #define SYMOPT_DEBUG 0x80000000
462 typedef struct _IMAGEHLP_STACK_FRAME
464 ULONG64 InstructionOffset;
465 ULONG64 ReturnOffset;
466 ULONG64 FrameOffset;
467 ULONG64 StackOffset;
468 ULONG64 BackingStoreOffset;
469 ULONG64 FuncTableEntry;
470 ULONG64 Params[4];
471 ULONG64 Reserved[5];
472 BOOL Virtual;
473 ULONG Reserved2;
474 } IMAGEHLP_STACK_FRAME, *PIMAGEHLP_STACK_FRAME;
476 typedef VOID IMAGEHLP_CONTEXT, *PIMAGEHLP_CONTEXT;
478 #define DBHHEADER_DEBUGDIRS 0x1
479 typedef struct _DBGHELP_MODLOAD_DATA
481 DWORD ssize;
482 DWORD ssig;
483 PVOID data;
484 DWORD size;
485 DWORD flags;
486 } MODLOAD_DATA, *PMODLOAD_DATA;
488 /*************************
489 * MODULE handling *
490 *************************/
492 /* flags for SymLoadModuleEx */
493 #define SLMFLAG_VIRTUAL 0x1
494 #define SLMFLAG_NO_SYMBOLS 0x4
496 typedef BOOL (CALLBACK *PENUMLOADED_MODULES_CALLBACK64)(PCSTR, DWORD64, ULONG, PVOID);
497 BOOL WINAPI EnumerateLoadedModules64(HANDLE, PENUMLOADED_MODULES_CALLBACK64, PVOID);
498 typedef BOOL (CALLBACK *PENUMLOADED_MODULES_CALLBACKW64)(PCWSTR, DWORD64, ULONG, PVOID);
499 BOOL WINAPI EnumerateLoadedModulesW64(HANDLE, PENUMLOADED_MODULES_CALLBACKW64, PVOID);
500 BOOL WINAPI EnumerateLoadedModulesEx(HANDLE, PENUMLOADED_MODULES_CALLBACK64, PVOID);
501 BOOL WINAPI EnumerateLoadedModulesExW(HANDLE, PENUMLOADED_MODULES_CALLBACKW64, PVOID);
502 typedef BOOL (CALLBACK *PSYM_ENUMMODULES_CALLBACK64)(PCSTR, DWORD64, PVOID);
503 BOOL WINAPI SymEnumerateModules64(HANDLE, PSYM_ENUMMODULES_CALLBACK64, PVOID);
504 typedef BOOL (CALLBACK *PSYM_ENUMMODULES_CALLBACKW64)(PCWSTR, DWORD64, PVOID);
505 BOOL WINAPI SymEnumerateModulesW64(HANDLE, PSYM_ENUMMODULES_CALLBACKW64, PVOID);
506 BOOL WINAPI SymGetModuleInfo64(HANDLE, DWORD64, PIMAGEHLP_MODULE64);
507 BOOL WINAPI SymGetModuleInfoW64(HANDLE, DWORD64, PIMAGEHLP_MODULEW64);
508 DWORD64 WINAPI SymGetModuleBase64(HANDLE, DWORD64);
509 DWORD64 WINAPI SymLoadModule64(HANDLE, HANDLE, PCSTR, PCSTR, DWORD64, DWORD);
510 DWORD64 WINAPI SymLoadModuleEx(HANDLE, HANDLE, PCSTR, PCSTR, DWORD64, DWORD,
511 PMODLOAD_DATA, DWORD);
512 DWORD64 WINAPI SymLoadModuleExW(HANDLE, HANDLE, PCWSTR, PCWSTR, DWORD64, DWORD,
513 PMODLOAD_DATA, DWORD);
514 BOOL WINAPI SymUnloadModule64(HANDLE, DWORD64);
515 BOOL WINAPI SymRefreshModuleList(HANDLE);
517 /*************************
518 * Symbol Handling *
519 *************************/
521 #define IMAGEHLP_SYMBOL_INFO_VALUEPRESENT 1
522 #define IMAGEHLP_SYMBOL_INFO_REGISTER SYMF_REGISTER /* 0x08 */
523 #define IMAGEHLP_SYMBOL_INFO_REGRELATIVE SYMF_REGREL /* 0x10 */
524 #define IMAGEHLP_SYMBOL_INFO_FRAMERELATIVE SYMF_FRAMEREL /* 0x20 */
525 #define IMAGEHLP_SYMBOL_INFO_PARAMETER SYMF_PARAMETER /* 0x40 */
526 #define IMAGEHLP_SYMBOL_INFO_LOCAL SYMF_LOCAL /* 0x80 */
527 #define IMAGEHLP_SYMBOL_INFO_CONSTANT SYMF_CONSTANT /* 0x100 */
528 #define IMAGEHLP_SYMBOL_FUNCTION SYMF_FUNCTION /* 0x800 */
530 #define SYMFLAG_VALUEPRESENT 0x00000001
531 #define SYMFLAG_REGISTER 0x00000008
532 #define SYMFLAG_REGREL 0x00000010
533 #define SYMFLAG_FRAMEREL 0x00000020
534 #define SYMFLAG_PARAMETER 0x00000040
535 #define SYMFLAG_LOCAL 0x00000080
536 #define SYMFLAG_CONSTANT 0x00000100
537 #define SYMFLAG_EXPORT 0x00000200
538 #define SYMFLAG_FORWARDER 0x00000400
539 #define SYMFLAG_FUNCTION 0x00000800
540 #define SYMFLAG_VIRTUAL 0x00001000
541 #define SYMFLAG_THUNK 0x00002000
542 #define SYMFLAG_TLSREL 0x00004000
543 #define SYMFLAG_SLOT 0x00008000
544 #define SYMFLAG_ILREL 0x00010000
545 #define SYMFLAG_METADATA 0x00020000
546 #define SYMFLAG_CLR_TOKEN 0x00040000
547 #define SYMFLAG_NULL 0x00080000
548 #define SYMFLAG_FUNC_NO_RETURN 0x00100000
549 #define SYMFLAG_SYNTHETIC_ZEROBASE 0x00200000
550 #define SYMFLAG_PUBLIC_CODE 0x00400000
552 #define MAX_SYM_NAME 2000
554 typedef struct _SYMBOL_INFO
556 ULONG SizeOfStruct;
557 ULONG TypeIndex;
558 ULONG64 Reserved[2];
559 ULONG Index;
560 ULONG Size;
561 ULONG64 ModBase;
562 ULONG Flags;
563 ULONG64 Value;
564 ULONG64 Address;
565 ULONG Register;
566 ULONG Scope;
567 ULONG Tag;
568 ULONG NameLen;
569 ULONG MaxNameLen;
570 CHAR Name[1];
571 } SYMBOL_INFO, *PSYMBOL_INFO;
573 typedef struct _SYMBOL_INFOW
575 ULONG SizeOfStruct;
576 ULONG TypeIndex;
577 ULONG64 Reserved[2];
578 ULONG Index;
579 ULONG Size;
580 ULONG64 ModBase;
581 ULONG Flags;
582 ULONG64 Value;
583 ULONG64 Address;
584 ULONG Register;
585 ULONG Scope;
586 ULONG Tag;
587 ULONG NameLen;
588 ULONG MaxNameLen;
589 WCHAR Name[1];
590 } SYMBOL_INFOW, *PSYMBOL_INFOW;
592 typedef struct _SYMBOL_INFO_PACKAGE
594 SYMBOL_INFO si;
595 CHAR name[MAX_SYM_NAME+1];
596 } SYMBOL_INFO_PACKAGE, *PSYMBOL_INFO_PACKAGE;
598 typedef struct _SYMBOL_INFO_PACKAGEW
600 SYMBOL_INFOW si;
601 WCHAR name[MAX_SYM_NAME+1];
602 } SYMBOL_INFO_PACKAGEW, *PSYMBOL_INFO_PACKAGEW;
604 typedef struct _SYMSRV_INDEX_INFO
606 DWORD sizeofstruct;
607 CHAR file[MAX_PATH + 1];
608 BOOL stripped;
609 DWORD timestamp;
610 DWORD size;
611 CHAR dbgfile[MAX_PATH + 1];
612 CHAR pdbfile[MAX_PATH + 1];
613 GUID guid;
614 DWORD sig;
615 DWORD age;
616 } SYMSRV_INDEX_INFO, *PSYMSRV_INDEX_INFO;
618 typedef struct
620 DWORD sizeofstruct;
621 WCHAR file[MAX_PATH + 1];
622 BOOL stripped;
623 DWORD timestamp;
624 DWORD size;
625 WCHAR dbgfile[MAX_PATH + 1];
626 WCHAR pdbfile[MAX_PATH + 1];
627 GUID guid;
628 DWORD sig;
629 DWORD age;
630 } SYMSRV_INDEX_INFOW, *PSYMSRV_INDEX_INFOW;
632 typedef enum _IMAGEHLP_SYMBOL_TYPE_INFO
634 TI_GET_SYMTAG,
635 TI_GET_SYMNAME,
636 TI_GET_LENGTH,
637 TI_GET_TYPE,
638 TI_GET_TYPEID,
639 TI_GET_BASETYPE,
640 TI_GET_ARRAYINDEXTYPEID,
641 TI_FINDCHILDREN,
642 TI_GET_DATAKIND,
643 TI_GET_ADDRESSOFFSET,
644 TI_GET_OFFSET,
645 TI_GET_VALUE,
646 TI_GET_COUNT,
647 TI_GET_CHILDRENCOUNT,
648 TI_GET_BITPOSITION,
649 TI_GET_VIRTUALBASECLASS,
650 TI_GET_VIRTUALTABLESHAPEID,
651 TI_GET_VIRTUALBASEPOINTEROFFSET,
652 TI_GET_CLASSPARENTID,
653 TI_GET_NESTED,
654 TI_GET_SYMINDEX,
655 TI_GET_LEXICALPARENT,
656 TI_GET_ADDRESS,
657 TI_GET_THISADJUST,
658 TI_GET_UDTKIND,
659 TI_IS_EQUIV_TO,
660 TI_GET_CALLING_CONVENTION,
661 TI_IS_CLOSE_EQUIV_TO,
662 TI_GTIEX_REQS_VALID,
663 TI_GET_VIRTUALBASEOFFSET,
664 TI_GET_VIRTUALBASEDISPINDEX,
665 TI_GET_IS_REFERENCE,
666 TI_GET_INDIRECTVIRTUALBASECLASS,
667 TI_GET_VIRTUALBASETABLETYPE,
668 TI_GET_OBJECTPOINTERTYPE,
669 IMAGEHLP_SYMBOL_TYPE_INFO_MAX
670 } IMAGEHLP_SYMBOL_TYPE_INFO;
672 #define IMAGEHLP_GET_TYPE_INFO_UNCACHED 0x00000001
673 #define IMAGEHLP_GET_TYPE_INFO_CHILDREN 0x00000002
674 typedef struct _IMAGEHLP_GET_TYPE_INFO_PARAMS
676 ULONG SizeOfStruct;
677 ULONG Flags;
678 ULONG NumIds;
679 PULONG TypeIds;
680 ULONG64 TagFilter;
681 ULONG NumReqs;
682 IMAGEHLP_SYMBOL_TYPE_INFO* ReqKinds;
683 PULONG_PTR ReqOffsets;
684 PULONG ReqSizes;
685 ULONG_PTR ReqStride;
686 ULONG_PTR BufferSize;
687 PVOID Buffer;
688 ULONG EntriesMatched;
689 ULONG EntriesFilled;
690 ULONG64 TagsFound;
691 ULONG64 AllReqsValid;
692 ULONG NumReqsValid;
693 PULONG64 ReqsValid;
694 } IMAGEHLP_GET_TYPE_INFO_PARAMS, *PIMAGEHLP_GET_TYPE_INFO_PARAMS;
696 typedef struct _TI_FINDCHILDREN_PARAMS
698 ULONG Count;
699 ULONG Start;
700 ULONG ChildId[1];
701 } TI_FINDCHILDREN_PARAMS;
703 #define UNDNAME_COMPLETE (0x0000)
704 #define UNDNAME_NO_LEADING_UNDERSCORES (0x0001)
705 #define UNDNAME_NO_MS_KEYWORDS (0x0002)
706 #define UNDNAME_NO_FUNCTION_RETURNS (0x0004)
707 #define UNDNAME_NO_ALLOCATION_MODEL (0x0008)
708 #define UNDNAME_NO_ALLOCATION_LANGUAGE (0x0010)
709 #define UNDNAME_NO_MS_THISTYPE (0x0020)
710 #define UNDNAME_NO_CV_THISTYPE (0x0040)
711 #define UNDNAME_NO_THISTYPE (0x0060)
712 #define UNDNAME_NO_ACCESS_SPECIFIERS (0x0080)
713 #define UNDNAME_NO_THROW_SIGNATURES (0x0100)
714 #define UNDNAME_NO_MEMBER_TYPE (0x0200)
715 #define UNDNAME_NO_RETURN_UDT_MODEL (0x0400)
716 #define UNDNAME_32_BIT_DECODE (0x0800)
717 #define UNDNAME_NAME_ONLY (0x1000)
718 #define UNDNAME_NO_ARGUMENTS (0x2000)
719 #define UNDNAME_NO_SPECIAL_SYMS (0x4000)
721 #define SYMSEARCH_MASKOBJS 0x01
722 #define SYMSEARCH_RECURSE 0x02
723 #define SYMSEARCH_GLOBALSONLY 0x04
725 BOOL WINAPI SymGetTypeInfo(HANDLE, DWORD64, ULONG, IMAGEHLP_SYMBOL_TYPE_INFO, PVOID);
726 BOOL WINAPI SymGetTypeInfoEx(HANDLE, DWORD64, PIMAGEHLP_GET_TYPE_INFO_PARAMS);
727 typedef BOOL (CALLBACK *PSYM_ENUMERATESYMBOLS_CALLBACK)(PSYMBOL_INFO, ULONG, PVOID);
728 typedef BOOL (CALLBACK *PSYM_ENUMERATESYMBOLS_CALLBACKW)(PSYMBOL_INFOW, ULONG, PVOID);
729 BOOL WINAPI SymEnumTypes(HANDLE, ULONG64, PSYM_ENUMERATESYMBOLS_CALLBACK, PVOID);
730 BOOL WINAPI SymEnumTypesW(HANDLE, ULONG64, PSYM_ENUMERATESYMBOLS_CALLBACKW, PVOID);
731 BOOL WINAPI SymEnumTypesByName(HANDLE, ULONG64, PCSTR, PSYM_ENUMERATESYMBOLS_CALLBACK, PVOID);
732 BOOL WINAPI SymEnumTypesByNameW(HANDLE, ULONG64, PCWSTR, PSYM_ENUMERATESYMBOLS_CALLBACKW, PVOID);
733 BOOL WINAPI SymFromAddr(HANDLE, DWORD64, DWORD64*, SYMBOL_INFO*);
734 BOOL WINAPI SymFromAddrW(HANDLE, DWORD64, DWORD64*, SYMBOL_INFOW*);
735 BOOL WINAPI SymFromInlineContext(HANDLE, DWORD64, ULONG, PDWORD64, PSYMBOL_INFO);
736 BOOL WINAPI SymFromInlineContextW(HANDLE, DWORD64, ULONG, PDWORD64, PSYMBOL_INFOW);
737 BOOL WINAPI SymFromToken(HANDLE, DWORD64, DWORD, PSYMBOL_INFO);
738 BOOL WINAPI SymFromTokenW(HANDLE, DWORD64, DWORD, PSYMBOL_INFOW);
739 BOOL WINAPI SymFromName(HANDLE, PCSTR, PSYMBOL_INFO);
740 BOOL WINAPI SymFromNameW(HANDLE, PCWSTR, PSYMBOL_INFOW);
741 BOOL WINAPI SymGetSymFromAddr64(HANDLE, DWORD64, PDWORD64, PIMAGEHLP_SYMBOL64);
742 BOOL WINAPI SymGetSymFromName64(HANDLE, PCSTR, PIMAGEHLP_SYMBOL64);
743 BOOL WINAPI SymGetTypeFromName(HANDLE, ULONG64, PCSTR, PSYMBOL_INFO);
744 BOOL WINAPI SymGetTypeFromNameW(HANDLE, ULONG64, PCWSTR, PSYMBOL_INFOW);
745 BOOL WINAPI SymGetSymNext64(HANDLE, PIMAGEHLP_SYMBOL64);
746 BOOL WINAPI SymGetSymNextW64(HANDLE, PIMAGEHLP_SYMBOLW64);
747 BOOL WINAPI SymGetSymPrev64(HANDLE, PIMAGEHLP_SYMBOL64);
748 BOOL WINAPI SymGetSymPrevW64(HANDLE, PIMAGEHLP_SYMBOLW64);
749 BOOL WINAPI SymEnumSym(HANDLE,ULONG64,PSYM_ENUMERATESYMBOLS_CALLBACK,PVOID);
750 BOOL WINAPI SymEnumSymbols(HANDLE, ULONG64, PCSTR, PSYM_ENUMERATESYMBOLS_CALLBACK,
751 PVOID);
752 BOOL WINAPI SymEnumSymbolsW(HANDLE, ULONG64, PCWSTR, PSYM_ENUMERATESYMBOLS_CALLBACKW,
753 PVOID);
754 typedef BOOL (CALLBACK *PSYM_ENUMSYMBOLS_CALLBACK64)(PCSTR, DWORD64, ULONG, PVOID);
755 typedef BOOL (CALLBACK *PSYM_ENUMSYMBOLS_CALLBACK64W)(PCWSTR, DWORD64, ULONG, PVOID);
756 BOOL WINAPI SymEnumerateSymbols64(HANDLE, ULONG64, PSYM_ENUMSYMBOLS_CALLBACK64, PVOID);
757 BOOL WINAPI SymEnumerateSymbolsW64(HANDLE, ULONG64, PSYM_ENUMSYMBOLS_CALLBACK64W, PVOID);
758 BOOL WINAPI SymEnumSymbolsForAddr(HANDLE, DWORD64, PSYM_ENUMERATESYMBOLS_CALLBACK, PVOID);
759 BOOL WINAPI SymEnumSymbolsForAddrW(HANDLE, DWORD64, PSYM_ENUMERATESYMBOLS_CALLBACKW, PVOID);
760 typedef BOOL (CALLBACK *PSYMBOL_REGISTERED_CALLBACK64)(HANDLE, ULONG, ULONG64, ULONG64);
761 BOOL WINAPI SymRegisterCallback64(HANDLE, PSYMBOL_REGISTERED_CALLBACK64, ULONG64);
762 BOOL WINAPI SymRegisterCallbackW64(HANDLE, PSYMBOL_REGISTERED_CALLBACK64, ULONG64);
763 BOOL WINAPI SymUnDName64(PIMAGEHLP_SYMBOL64, PSTR, DWORD);
764 BOOL WINAPI SymMatchString(PCSTR, PCSTR, BOOL);
765 BOOL WINAPI SymMatchStringA(PCSTR, PCSTR, BOOL);
766 BOOL WINAPI SymMatchStringW(PCWSTR, PCWSTR, BOOL);
767 BOOL WINAPI SymSearch(HANDLE, ULONG64, DWORD, DWORD, PCSTR, DWORD64, PSYM_ENUMERATESYMBOLS_CALLBACK, PVOID, DWORD);
768 BOOL WINAPI SymSearchW(HANDLE, ULONG64, DWORD, DWORD, PCWSTR, DWORD64, PSYM_ENUMERATESYMBOLS_CALLBACKW, PVOID, DWORD);
769 DWORD WINAPI UnDecorateSymbolName(PCSTR, PSTR, DWORD, DWORD);
770 DWORD WINAPI UnDecorateSymbolNameW(PCWSTR, PWSTR, DWORD, DWORD);
771 BOOL WINAPI SymGetScope(HANDLE, ULONG64, DWORD, PSYMBOL_INFO);
772 BOOL WINAPI SymGetScopeW(HANDLE, ULONG64, DWORD, PSYMBOL_INFOW);
773 BOOL WINAPI SymFromIndex(HANDLE, ULONG64, DWORD, PSYMBOL_INFO);
774 BOOL WINAPI SymFromIndexW(HANDLE, ULONG64, DWORD, PSYMBOL_INFOW);
775 BOOL WINAPI SymAddSymbol(HANDLE, ULONG64, PCSTR, DWORD64, DWORD, DWORD);
776 BOOL WINAPI SymAddSymbolW(HANDLE, ULONG64, PCWSTR, DWORD64, DWORD, DWORD);
777 BOOL WINAPI SymDeleteSymbol(HANDLE, ULONG64, PCSTR, DWORD64, DWORD);
778 BOOL WINAPI SymDeleteSymbolW(HANDLE, ULONG64, PCWSTR, DWORD64, DWORD);
780 typedef struct _OMAP
782 ULONG rva;
783 ULONG rvaTo;
784 } OMAP, *POMAP;
786 BOOL WINAPI SymGetOmaps(HANDLE, DWORD64, POMAP*, PDWORD64, POMAP*, PDWORD64);
788 /*************************
789 * Source Files *
790 *************************/
791 typedef BOOL (CALLBACK *PSYM_ENUMSOURCEFILES_CALLBACK)(PSOURCEFILE, PVOID);
792 typedef BOOL (CALLBACK *PSYM_ENUMSOURCEFILES_CALLBACKW)(PSOURCEFILEW, PVOID);
794 BOOL WINAPI SymEnumSourceFiles(HANDLE, ULONG64, PCSTR, PSYM_ENUMSOURCEFILES_CALLBACK,
795 PVOID);
796 BOOL WINAPI SymEnumSourceFilesW(HANDLE, ULONG64, PCWSTR, PSYM_ENUMSOURCEFILES_CALLBACKW, PVOID);
797 BOOL WINAPI SymGetLineFromAddr64(HANDLE, DWORD64, PDWORD, PIMAGEHLP_LINE64);
798 BOOL WINAPI SymGetLineFromAddrW64(HANDLE, DWORD64, PDWORD, PIMAGEHLP_LINEW64);
799 BOOL WINAPI SymGetLineFromInlineContext(HANDLE, DWORD64, ULONG, DWORD64, PDWORD, PIMAGEHLP_LINE64);
800 BOOL WINAPI SymGetLineFromInlineContextW(HANDLE, DWORD64, ULONG, DWORD64, PDWORD, PIMAGEHLP_LINEW64);
801 BOOL WINAPI SymGetLinePrev64(HANDLE, PIMAGEHLP_LINE64);
802 BOOL WINAPI SymGetLinePrevW64(HANDLE, PIMAGEHLP_LINEW64);
803 BOOL WINAPI SymGetLineNext64(HANDLE, PIMAGEHLP_LINE64);
804 BOOL WINAPI SymGetLineNextW64(HANDLE, PIMAGEHLP_LINEW64);
805 BOOL WINAPI SymGetLineFromName64(HANDLE, PCSTR, PCSTR, DWORD, PLONG, PIMAGEHLP_LINE64);
806 BOOL WINAPI SymGetLineFromNameW64(HANDLE, PCWSTR, PCWSTR, DWORD, PLONG, PIMAGEHLP_LINEW64);
807 ULONG WINAPI SymGetFileLineOffsets64(HANDLE, PCSTR, PCSTR, PDWORD64, ULONG);
808 BOOL WINAPI SymGetSourceFile(HANDLE, ULONG64, PCSTR, PCSTR, PSTR, DWORD);
809 BOOL WINAPI SymGetSourceFileW(HANDLE, ULONG64, PCWSTR, PCWSTR, PWSTR, DWORD);
810 BOOL WINAPI SymGetSourceFileToken(HANDLE, ULONG64, PCSTR, PVOID*, DWORD*);
811 BOOL WINAPI SymGetSourceFileTokenW(HANDLE, ULONG64, PCWSTR, PVOID*, DWORD*);
812 BOOL WINAPI SymGetSourceFileFromToken(HANDLE, PVOID, PCSTR, PSTR, DWORD);
813 BOOL WINAPI SymGetSourceFileFromTokenW(HANDLE, PVOID, PCWSTR, PWSTR, DWORD);
814 BOOL WINAPI SymGetSourceVarFromToken(HANDLE, PVOID, PCSTR, PCSTR, PSTR, DWORD);
815 BOOL WINAPI SymGetSourceVarFromTokenW(HANDLE, PVOID, PCWSTR, PCWSTR, PWSTR, DWORD);
817 typedef struct _SRCCODEINFO
819 DWORD SizeOfStruct;
820 PVOID Key;
821 DWORD64 ModBase;
822 CHAR Obj[MAX_PATH+1];
823 CHAR FileName[MAX_PATH+1];
824 DWORD LineNumber;
825 DWORD64 Address;
826 } SRCCODEINFO, *PSRCCODEINFO;
828 typedef struct _SRCCODEINFOW
830 DWORD SizeOfStruct;
831 PVOID Key;
832 DWORD64 ModBase;
833 WCHAR Obj[MAX_PATH+1];
834 WCHAR FileName[MAX_PATH+1];
835 DWORD LineNumber;
836 DWORD64 Address;
837 } SRCCODEINFOW, *PSRCCODEINFOW;
839 typedef BOOL (CALLBACK* PSYM_ENUMLINES_CALLBACK)(PSRCCODEINFO, PVOID);
840 typedef BOOL (CALLBACK* PSYM_ENUMLINES_CALLBACKW)(PSRCCODEINFOW, PVOID);
841 BOOL WINAPI SymEnumLines(HANDLE, ULONG64, PCSTR, PCSTR, PSYM_ENUMLINES_CALLBACK, PVOID);
842 BOOL WINAPI SymEnumLinesW(HANDLE, ULONG64, PCWSTR, PCWSTR, PSYM_ENUMLINES_CALLBACKW, PVOID);
843 BOOL WINAPI SymEnumSourceLines(HANDLE, ULONG64, PCSTR, PCSTR, DWORD, DWORD, PSYM_ENUMLINES_CALLBACK, PVOID);
844 BOOL WINAPI SymEnumSourceLinesW(HANDLE, ULONG64, PCWSTR, PCWSTR, DWORD, DWORD, PSYM_ENUMLINES_CALLBACKW, PVOID);
846 /*************************
847 * File & image handling *
848 *************************/
849 BOOL WINAPI SymInitialize(HANDLE, PCSTR, BOOL);
850 BOOL WINAPI SymInitializeW(HANDLE, PCWSTR, BOOL);
851 BOOL WINAPI SymCleanup(HANDLE);
853 HANDLE WINAPI FindDebugInfoFile(PCSTR, PCSTR, PSTR);
854 typedef BOOL (CALLBACK *PFIND_DEBUG_FILE_CALLBACK)(HANDLE, PCSTR, PVOID);
855 typedef BOOL (CALLBACK *PFIND_DEBUG_FILE_CALLBACKW)(HANDLE, PCWSTR, PVOID);
856 HANDLE WINAPI FindDebugInfoFileEx(PCSTR, PCSTR, PSTR, PFIND_DEBUG_FILE_CALLBACK, PVOID);
857 HANDLE WINAPI FindDebugInfoFileExW(PCWSTR, PCWSTR, PWSTR, PFIND_DEBUG_FILE_CALLBACKW, PVOID);
858 HANDLE WINAPI SymFindDebugInfoFile(HANDLE, PCSTR, PSTR, PFIND_DEBUG_FILE_CALLBACK, PVOID);
859 HANDLE WINAPI SymFindDebugInfoFileW(HANDLE, PCWSTR, PWSTR, PFIND_DEBUG_FILE_CALLBACKW, PVOID);
860 typedef BOOL (CALLBACK *PFINDFILEINPATHCALLBACK)(PCSTR, PVOID);
861 typedef BOOL (CALLBACK *PFINDFILEINPATHCALLBACKW)(PCWSTR, PVOID);
862 BOOL WINAPI FindFileInPath(HANDLE, PCSTR, PCSTR, PVOID, DWORD, DWORD, DWORD,
863 PSTR, PFINDFILEINPATHCALLBACK, PVOID);
864 BOOL WINAPI SymFindFileInPath(HANDLE, PCSTR, PCSTR, PVOID, DWORD, DWORD, DWORD,
865 PSTR, PFINDFILEINPATHCALLBACK, PVOID);
866 BOOL WINAPI SymFindFileInPathW(HANDLE, PCWSTR, PCWSTR, PVOID, DWORD, DWORD, DWORD,
867 PWSTR, PFINDFILEINPATHCALLBACKW, PVOID);
868 HANDLE WINAPI FindExecutableImage(PCSTR, PCSTR, PSTR);
869 typedef BOOL (CALLBACK *PFIND_EXE_FILE_CALLBACK)(HANDLE, PCSTR, PVOID);
870 typedef BOOL (CALLBACK *PFIND_EXE_FILE_CALLBACKW)(HANDLE, PCWSTR, PVOID);
871 HANDLE WINAPI FindExecutableImageEx(PCSTR, PCSTR, PSTR, PFIND_EXE_FILE_CALLBACK, PVOID);
872 HANDLE WINAPI FindExecutableImageExW(PCWSTR, PCWSTR, PWSTR, PFIND_EXE_FILE_CALLBACKW, PVOID);
873 HANDLE WINAPI SymFindExecutableImage(HANDLE, PCSTR, PSTR, PFIND_EXE_FILE_CALLBACK, PVOID);
874 HANDLE WINAPI SymFindExecutableImageW(HANDLE, PCWSTR, PWSTR, PFIND_EXE_FILE_CALLBACKW, PVOID);
875 PIMAGE_NT_HEADERS WINAPI ImageNtHeader(PVOID);
876 PVOID WINAPI ImageDirectoryEntryToDataEx(PVOID, BOOLEAN, USHORT, PULONG,
877 PIMAGE_SECTION_HEADER *);
878 PVOID WINAPI ImageDirectoryEntryToData(PVOID, BOOLEAN, USHORT, PULONG);
879 PIMAGE_SECTION_HEADER WINAPI ImageRvaToSection(PIMAGE_NT_HEADERS, PVOID, ULONG);
880 PVOID WINAPI ImageRvaToVa(PIMAGE_NT_HEADERS, PVOID, ULONG, PIMAGE_SECTION_HEADER*);
881 BOOL WINAPI SymGetSearchPath(HANDLE, PSTR, DWORD);
882 BOOL WINAPI SymGetSearchPathW(HANDLE, PWSTR, DWORD);
883 BOOL WINAPI SymSetSearchPath(HANDLE, PCSTR);
884 BOOL WINAPI SymSetSearchPathW(HANDLE, PCWSTR);
885 DWORD WINAPI GetTimestampForLoadedLibrary(HMODULE);
886 BOOL WINAPI MakeSureDirectoryPathExists(PCSTR);
887 BOOL WINAPI SearchTreeForFile(PCSTR, PCSTR, PSTR);
888 BOOL WINAPI SearchTreeForFileW(PCWSTR, PCWSTR, PWSTR);
889 typedef BOOL (CALLBACK *PENUMDIRTREE_CALLBACK)(PCSTR, PVOID);
890 typedef BOOL (CALLBACK *PENUMDIRTREE_CALLBACKW)(PCWSTR, PVOID);
891 BOOL WINAPI EnumDirTree(HANDLE, PCSTR, PCSTR, PSTR, PENUMDIRTREE_CALLBACK, PVOID);
892 BOOL WINAPI EnumDirTreeW(HANDLE, PCWSTR, PCWSTR, PWSTR, PENUMDIRTREE_CALLBACKW, PVOID);
893 BOOL WINAPI SymMatchFileName(PCSTR, PCSTR, PSTR*, PSTR*);
894 BOOL WINAPI SymMatchFileNameW(PCWSTR, PCWSTR, PWSTR*, PWSTR*);
895 PCHAR WINAPI SymSetHomeDirectory(HANDLE, PCSTR);
896 PWSTR WINAPI SymSetHomeDirectoryW(HANDLE, PCWSTR);
897 PCHAR WINAPI SymGetHomeDirectory(DWORD, PSTR, size_t);
898 PWSTR WINAPI SymGetHomeDirectoryW(DWORD, PWSTR, size_t);
899 #define hdBase 0
900 #define hdSym 1
901 #define hdSrc 2
902 #define hdMax 3
904 /*************************
905 * Context management *
906 *************************/
907 BOOL WINAPI SymSetContext(HANDLE, PIMAGEHLP_STACK_FRAME, PIMAGEHLP_CONTEXT);
908 BOOL WINAPI SymSetScopeFromIndex(HANDLE, ULONG64, ULONG);
909 BOOL WINAPI SymSetScopeFromAddr(HANDLE, ULONG64);
910 BOOL WINAPI SymSetScopeFromInlineContext(HANDLE, ULONG64, ULONG);
912 /*************************
913 * Stack management *
914 *************************/
916 #if !defined(_IMAGEHLP_SOURCE_) && defined(_IMAGEHLP64)
917 #define KDHELP KDHELP64
918 #define PKDHELP PKDHELP64
919 #else
920 typedef struct _KDHELP
922 DWORD Thread;
923 DWORD ThCallbackStack;
924 DWORD NextCallback;
925 DWORD FramePointer;
926 DWORD KiCallUserMode;
927 DWORD KeUserCallbackDispatcher;
928 DWORD SystemRangeStart;
929 } KDHELP, *PKDHELP;
930 #endif
932 typedef struct _KDHELP64
934 DWORD64 Thread;
935 DWORD ThCallbackStack;
936 DWORD ThCallbackBStore;
937 DWORD NextCallback;
938 DWORD FramePointer;
939 DWORD64 KiCallUserMode;
940 DWORD64 KeUserCallbackDispatcher;
941 DWORD64 SystemRangeStart;
942 DWORD64 Reserved[8];
943 } KDHELP64, *PKDHELP64;
945 #if !defined(_IMAGEHLP_SOURCE_) && defined(_IMAGEHLP64)
946 #define STACKFRAME STACKFRAME64
947 #define LPSTACKFRAME LPSTACKFRAME64
948 #else
949 typedef struct _STACKFRAME
951 ADDRESS AddrPC;
952 ADDRESS AddrReturn;
953 ADDRESS AddrFrame;
954 ADDRESS AddrStack;
955 PVOID FuncTableEntry;
956 DWORD Params[4];
957 BOOL Far;
958 BOOL Virtual;
959 DWORD Reserved[3];
960 KDHELP KdHelp;
961 ADDRESS AddrBStore;
962 } STACKFRAME, *LPSTACKFRAME;
963 #endif
965 typedef struct _STACKFRAME64
967 ADDRESS64 AddrPC;
968 ADDRESS64 AddrReturn;
969 ADDRESS64 AddrFrame;
970 ADDRESS64 AddrStack;
971 ADDRESS64 AddrBStore;
972 PVOID FuncTableEntry;
973 DWORD64 Params[4];
974 BOOL Far;
975 BOOL Virtual;
976 DWORD64 Reserved[3];
977 KDHELP64 KdHelp;
978 } STACKFRAME64, *LPSTACKFRAME64;
980 #define INLINE_FRAME_CONTEXT_INIT 0
981 #define INLINE_FRAME_CONTEXT_IGNORE 0xFFFFFFFF
983 typedef struct _tagSTACKFRAME_EX
985 ADDRESS64 AddrPC;
986 ADDRESS64 AddrReturn;
987 ADDRESS64 AddrFrame;
988 ADDRESS64 AddrStack;
989 ADDRESS64 AddrBStore;
990 PVOID FuncTableEntry;
991 DWORD64 Params[4];
992 BOOL Far;
993 BOOL Virtual;
994 DWORD64 Reserved[3];
995 KDHELP64 KdHelp;
997 DWORD StackFrameSize;
998 DWORD InlineFrameContext;
999 } STACKFRAME_EX, *LPSTACKFRAME_EX;
1002 typedef BOOL (CALLBACK *PREAD_PROCESS_MEMORY_ROUTINE64)
1003 (HANDLE, DWORD64, PVOID, DWORD, PDWORD);
1004 typedef PVOID (CALLBACK *PFUNCTION_TABLE_ACCESS_ROUTINE64)(HANDLE, DWORD64);
1005 typedef DWORD64 (CALLBACK *PGET_MODULE_BASE_ROUTINE64)(HANDLE, DWORD64);
1006 typedef DWORD64 (CALLBACK *PTRANSLATE_ADDRESS_ROUTINE64)(HANDLE, HANDLE, LPADDRESS64);
1007 BOOL WINAPI StackWalk64(DWORD, HANDLE, HANDLE, LPSTACKFRAME64, PVOID,
1008 PREAD_PROCESS_MEMORY_ROUTINE64,
1009 PFUNCTION_TABLE_ACCESS_ROUTINE64,
1010 PGET_MODULE_BASE_ROUTINE64,
1011 PTRANSLATE_ADDRESS_ROUTINE64);
1012 #define SYM_STKWALK_DEFAULT 0x00000000
1013 #define SYM_STKWALK_FORCE_FRAMEPTR 0x00000001
1014 BOOL WINAPI StackWalkEx(DWORD, HANDLE, HANDLE, LPSTACKFRAME_EX, PVOID,
1015 PREAD_PROCESS_MEMORY_ROUTINE64,
1016 PFUNCTION_TABLE_ACCESS_ROUTINE64,
1017 PGET_MODULE_BASE_ROUTINE64,
1018 PTRANSLATE_ADDRESS_ROUTINE64,
1019 DWORD);
1020 PVOID WINAPI SymFunctionTableAccess64(HANDLE, DWORD64);
1022 typedef PVOID (CALLBACK *PSYMBOL_FUNCENTRY_CALLBACK64)(HANDLE, ULONG64, ULONG64);
1024 BOOL WINAPI SymRegisterFunctionEntryCallback64(HANDLE, PSYMBOL_FUNCENTRY_CALLBACK64, ULONG64);
1025 BOOL WINAPI SymGetUnwindInfo(HANDLE, DWORD64, PVOID, PULONG);
1027 /* Inline context related APIs */
1028 DWORD WINAPI SymAddrIncludeInlineTrace(HANDLE, DWORD64);
1030 #define SYM_INLINE_COMP_ERROR 0
1031 #define SYM_INLINE_COMP_IDENTICAL 1
1032 #define SYM_INLINE_COMP_STEPIN 2
1033 #define SYM_INLINE_COMP_STEPOUT 3
1034 #define SYM_INLINE_COMP_STEPOVER 4
1035 #define SYM_INLINE_COMP_DIFFERENT 5
1037 DWORD WINAPI SymCompareInlineTrace(HANDLE, DWORD64, DWORD, DWORD64, DWORD64, DWORD64);
1038 BOOL WINAPI SymQueryInlineTrace(HANDLE, DWORD64, DWORD, DWORD64, DWORD64, LPDWORD, LPDWORD);
1040 /*************************
1041 * Version, global stuff *
1042 *************************/
1044 #define API_VERSION_NUMBER 9
1046 typedef struct API_VERSION
1048 USHORT MajorVersion;
1049 USHORT MinorVersion;
1050 USHORT Revision;
1051 USHORT Reserved;
1052 } API_VERSION, *LPAPI_VERSION;
1054 LPAPI_VERSION WINAPI ImagehlpApiVersion(void);
1055 LPAPI_VERSION WINAPI ImagehlpApiVersionEx(LPAPI_VERSION);
1057 #ifndef _WIN64
1058 typedef struct _IMAGE_DEBUG_INFORMATION
1060 LIST_ENTRY List;
1061 DWORD ReservedSize;
1062 PVOID ReservedMappedBase;
1063 USHORT ReservedMachine;
1064 USHORT ReservedCharacteristics;
1065 DWORD ReservedCheckSum;
1066 DWORD ImageBase;
1067 DWORD SizeOfImage;
1068 DWORD ReservedNumberOfSections;
1069 PIMAGE_SECTION_HEADER ReservedSections;
1070 DWORD ReservedExportedNamesSize;
1071 PSTR ReservedExportedNames;
1072 DWORD ReservedNumberOfFunctionTableEntries;
1073 PIMAGE_FUNCTION_ENTRY ReservedFunctionTableEntries;
1074 DWORD ReservedLowestFunctionStartingAddress;
1075 DWORD ReservedHighestFunctionEndingAddress;
1076 DWORD ReservedNumberOfFpoTableEntries;
1077 PFPO_DATA ReservedFpoTableEntries;
1078 DWORD SizeOfCoffSymbols;
1079 PIMAGE_COFF_SYMBOLS_HEADER CoffSymbols;
1080 DWORD ReservedSizeOfCodeViewSymbols;
1081 PVOID ReservedCodeViewSymbols;
1082 PSTR ImageFilePath;
1083 PSTR ImageFileName;
1084 PSTR ReservedDebugFilePath;
1085 DWORD ReservedTimeDateStamp;
1086 BOOL ReservedRomImage;
1087 PIMAGE_DEBUG_DIRECTORY ReservedDebugDirectory;
1088 DWORD ReservedNumberOfDebugDirectories;
1089 DWORD ReservedOriginalFunctionTableBaseAddress;
1090 DWORD Reserved[ 2 ];
1091 } IMAGE_DEBUG_INFORMATION, *PIMAGE_DEBUG_INFORMATION;
1093 PIMAGE_DEBUG_INFORMATION WINAPI MapDebugInformation(HANDLE, PCSTR, PCSTR, ULONG);
1094 BOOL WINAPI UnmapDebugInformation(PIMAGE_DEBUG_INFORMATION);
1095 #endif
1097 typedef enum
1099 SYMOPT_EX_DISABLEACCESSTIMEUPDATE,
1100 SYMOPT_EX_MAX,
1102 #ifdef __WINESRC__
1103 /* Include ELF/Mach-O modules in module operations */
1104 SYMOPT_EX_WINE_NATIVE_MODULES = 1000,
1105 /* Return the Unix actual path of loaded module */
1106 SYMOPT_EX_WINE_MODULE_REAL_PATH,
1107 /* Return the raw source file path from debug info (not always mapped to DOS) */
1108 SYMOPT_EX_WINE_SOURCE_ACTUAL_PATH,
1109 #endif
1110 } IMAGEHLP_EXTENDED_OPTIONS;
1112 DWORD WINAPI SymGetOptions(void);
1113 DWORD WINAPI SymSetOptions(DWORD);
1115 BOOL WINAPI SymGetExtendedOption(IMAGEHLP_EXTENDED_OPTIONS option);
1116 BOOL WINAPI SymSetExtendedOption(IMAGEHLP_EXTENDED_OPTIONS option, BOOL value);
1118 BOOL WINAPI SymSetParentWindow(HWND);
1120 /***************************
1121 * Symbol servers & stores *
1122 ***************************/
1123 BOOL WINAPI SymSrvGetFileIndexes(PCSTR, GUID *, PDWORD, PDWORD, DWORD);
1124 BOOL WINAPI SymSrvGetFileIndexesW(PCWSTR, GUID *, PDWORD, PDWORD, DWORD);
1125 BOOL WINAPI SymSrvGetFileIndexInfo(PCSTR, PSYMSRV_INDEX_INFO, DWORD);
1126 BOOL WINAPI SymSrvGetFileIndexInfoW(PCWSTR, PSYMSRV_INDEX_INFOW, DWORD);
1128 typedef BOOL (WINAPI* PSYMBOLSERVERPROC)(PCSTR, PCSTR, PVOID, DWORD, DWORD, PSTR);
1129 typedef BOOL (WINAPI* PSYMBOLSERVERPROCA)(PCSTR, PCSTR, PVOID, DWORD, DWORD, PSTR);
1130 typedef BOOL (WINAPI* PSYMBOLSERVERPROCW)(PCWSTR, PCWSTR, PVOID, DWORD, DWORD, PWSTR);
1131 typedef BOOL (WINAPI* PSYMBOLSERVEROPENPROC)(void);
1132 typedef BOOL (WINAPI* PSYMBOLSERVERCLOSEPROC)(void);
1133 typedef BOOL (WINAPI* PSYMBOLSERVERSETOPTIONSPROC)(UINT_PTR, ULONG64);
1134 typedef BOOL (CALLBACK* PSYMBOLSERVERCALLBACKPROC)(UINT_PTR, ULONG64, ULONG64);
1135 typedef UINT_PTR (WINAPI* PSYMBOLSERVERGETOPTIONSPROC)(void);
1136 typedef BOOL (WINAPI* PSYMBOLSERVERPINGPROC)(PCSTR);
1137 typedef BOOL (WINAPI* PSYMBOLSERVERPINGPROCA)(PCSTR);
1138 typedef BOOL (WINAPI* PSYMBOLSERVERPINGPROCW)(PCWSTR);
1140 #define SSRVOPT_CALLBACK 0x0001
1141 #define SSRVOPT_DWORD 0x0002
1142 #define SSRVOPT_DWORDPTR 0x0004
1143 #define SSRVOPT_GUIDPTR 0x0008
1144 #define SSRVOPT_OLDGUIDPTR 0x0010
1145 #define SSRVOPT_UNATTENDED 0x0020
1146 #define SSRVOPT_NOCOPY 0x0040
1147 #define SSRVOPT_PARENTWIN 0x0080
1148 #define SSRVOPT_PARAMTYPE 0x0100
1149 #define SSRVOPT_SECURE 0x0200
1150 #define SSRVOPT_TRACE 0x0400
1151 #define SSRVOPT_SETCONTEXT 0x0800
1152 #define SSRVOPT_PROXY 0x1000
1153 #define SSRVOPT_DOWNSTREAM_STORE 0x2000
1154 #define SSRVOPT_RESET ((ULONG_PTR)-1)
1156 #define SSRVACTION_TRACE 1
1157 #define SSRVACTION_QUERYCANCEL 2
1158 #define SSRVACTION_EVENT 3
1159 #define SSRVACTION_EVENTW 4
1160 #define SSRVACTION_SIZE 5
1161 #define SSRVACTION_HTTPSTATUS 6
1163 /* 32-bit functions */
1165 #if !defined(_IMAGEHLP_SOURCE_) && defined(_IMAGEHLP64)
1167 #define PENUMLOADED_MODULES_CALLBACK PENUMLOADED_MODULES_CALLBACK64
1168 #define PFUNCTION_TABLE_ACCESS_ROUTINE PFUNCTION_TABLE_ACCESS_ROUTINE64
1169 #define PGET_MODULE_BASE_ROUTINE PGET_MODULE_BASE_ROUTINE64
1170 #define PREAD_PROCESS_MEMORY_ROUTINE PREAD_PROCESS_MEMORY_ROUTINE64
1171 #define PSYMBOL_FUNCENTRY_CALLBACK PSYMBOL_FUNCENTRY_CALLBACK64
1172 #define PSYMBOL_REGISTERED_CALLBACK PSYMBOL_REGISTERED_CALLBACK64
1173 #define PSYM_ENUMMODULES_CALLBACK PSYM_ENUMMODULES_CALLBACK64
1174 #define PSYM_ENUMSYMBOLS_CALLBACK PSYM_ENUMSYMBOLS_CALLBACK64
1175 #define PSYM_ENUMSYMBOLS_CALLBACKW PSYM_ENUMSYMBOLS_CALLBACKW64
1176 #define PTRANSLATE_ADDRESS_ROUTINE PTRANSLATE_ADDRESS_ROUTINE64
1178 #define EnumerateLoadedModules EnumerateLoadedModules64
1179 #define StackWalk StackWalk64
1180 #define SymEnumerateModules SymEnumerateModules64
1181 #define SymEnumerateSymbols SymEnumerateSymbols64
1182 #define SymEnumerateSymbolsW SymEnumerateSymbolsW64
1183 #define SymFunctionTableAccess SymFunctionTableAccess64
1184 #define SymGetLineFromAddr SymGetLineFromAddr64
1185 #define SymGetLineFromAddrW SymGetLineFromAddrW64
1186 #define SymGetLineFromName SymGetLineFromName64
1187 #define SymGetLineNext SymGetLineNext64
1188 #define SymGetLineNextW SymGetLineNextW64
1189 #define SymGetLinePrev SymGetLinePrev64
1190 #define SymGetLinePrevW SymGetLinePrevW64
1191 #define SymGetModuleBase SymGetModuleBase64
1192 #define SymGetModuleInfo SymGetModuleInfo64
1193 #define SymGetModuleInfoW SymGetModuleInfoW64
1194 #define SymGetSymFromAddr SymGetSymFromAddr64
1195 #define SymGetSymFromName SymGetSymFromName64
1196 #define SymGetSymNext SymGetSymNext64
1197 #define SymGetSymNextW SymGetSymNextW64
1198 #define SymGetSymPrev SymGetSymPrev64
1199 #define SymGetSymPrevW SymGetSymPrevW64
1200 #define SymLoadModule SymLoadModule64
1201 #define SymRegisterCallback SymRegisterCallback64
1202 #define SymRegisterFunctionEntryCallback SymRegisterFunctionEntryCallback64
1203 #define SymUnDName SymUnDName64
1204 #define SymUnloadModule SymUnloadModule64
1206 #else
1208 typedef BOOL (CALLBACK *PENUMLOADED_MODULES_CALLBACK)(PCSTR, ULONG, ULONG, PVOID);
1209 typedef PVOID (CALLBACK *PFUNCTION_TABLE_ACCESS_ROUTINE)(HANDLE, DWORD);
1210 typedef DWORD (CALLBACK *PGET_MODULE_BASE_ROUTINE)(HANDLE, DWORD);
1211 typedef BOOL (CALLBACK *PREAD_PROCESS_MEMORY_ROUTINE)(HANDLE, DWORD, PVOID, DWORD, PDWORD);
1212 typedef BOOL (CALLBACK *PSYM_ENUMMODULES_CALLBACK)(PCSTR, ULONG, PVOID);
1213 typedef BOOL (CALLBACK *PSYM_ENUMSYMBOLS_CALLBACK)(PCSTR, ULONG, ULONG, PVOID);
1214 typedef BOOL (CALLBACK *PSYM_ENUMSYMBOLS_CALLBACKW)(PCWSTR, ULONG, ULONG, PVOID);
1215 typedef BOOL (CALLBACK *PSYMBOL_REGISTERED_CALLBACK)(HANDLE, ULONG, PVOID, PVOID);
1216 typedef PVOID (CALLBACK *PSYMBOL_FUNCENTRY_CALLBACK)(HANDLE, DWORD, PVOID);
1217 typedef DWORD (CALLBACK *PTRANSLATE_ADDRESS_ROUTINE)(HANDLE, HANDLE, LPADDRESS);
1219 BOOL WINAPI EnumerateLoadedModules(HANDLE, PENUMLOADED_MODULES_CALLBACK, PVOID);
1220 BOOL WINAPI StackWalk(DWORD, HANDLE, HANDLE, LPSTACKFRAME, PVOID, PREAD_PROCESS_MEMORY_ROUTINE, PFUNCTION_TABLE_ACCESS_ROUTINE, PGET_MODULE_BASE_ROUTINE, PTRANSLATE_ADDRESS_ROUTINE);
1221 BOOL WINAPI SymEnumerateModules(HANDLE, PSYM_ENUMMODULES_CALLBACK, PVOID);
1222 BOOL WINAPI SymEnumerateSymbols(HANDLE, ULONG, PSYM_ENUMSYMBOLS_CALLBACK, PVOID);
1223 BOOL WINAPI SymEnumerateSymbolsW(HANDLE, ULONG, PSYM_ENUMSYMBOLS_CALLBACKW, PVOID);
1224 PVOID WINAPI SymFunctionTableAccess(HANDLE, DWORD);
1225 BOOL WINAPI SymGetLineFromAddr(HANDLE, DWORD, PDWORD, PIMAGEHLP_LINE);
1226 BOOL WINAPI SymGetLineFromAddrW(HANDLE, DWORD, PDWORD, PIMAGEHLP_LINEW);
1227 BOOL WINAPI SymGetLineFromName(HANDLE, PCSTR, PCSTR, DWORD, PLONG, PIMAGEHLP_LINE);
1228 BOOL WINAPI SymGetLineNext(HANDLE, PIMAGEHLP_LINE);
1229 BOOL WINAPI SymGetLineNextW(HANDLE, PIMAGEHLP_LINEW);
1230 BOOL WINAPI SymGetLinePrev(HANDLE, PIMAGEHLP_LINE);
1231 BOOL WINAPI SymGetLinePrevW(HANDLE, PIMAGEHLP_LINEW);
1232 DWORD WINAPI SymGetModuleBase(HANDLE, DWORD);
1233 BOOL WINAPI SymGetModuleInfo(HANDLE, DWORD, PIMAGEHLP_MODULE);
1234 BOOL WINAPI SymGetModuleInfoW(HANDLE, DWORD, PIMAGEHLP_MODULEW);
1235 BOOL WINAPI SymGetSymFromAddr(HANDLE, DWORD, PDWORD, PIMAGEHLP_SYMBOL);
1236 BOOL WINAPI SymGetSymFromName(HANDLE, PCSTR, PIMAGEHLP_SYMBOL);
1237 BOOL WINAPI SymGetSymNext(HANDLE, PIMAGEHLP_SYMBOL);
1238 BOOL WINAPI SymGetSymNextW(HANDLE, PIMAGEHLP_SYMBOLW);
1239 BOOL WINAPI SymGetSymPrev(HANDLE, PIMAGEHLP_SYMBOL);
1240 BOOL WINAPI SymGetSymPrevW(HANDLE, PIMAGEHLP_SYMBOLW);
1241 DWORD WINAPI SymLoadModule(HANDLE, HANDLE, PCSTR, PCSTR, DWORD, DWORD);
1242 BOOL WINAPI SymRegisterCallback(HANDLE, PSYMBOL_REGISTERED_CALLBACK, PVOID);
1243 BOOL WINAPI SymRegisterFunctionEntryCallback(HANDLE, PSYMBOL_FUNCENTRY_CALLBACK, PVOID);
1244 BOOL WINAPI SymUnDName(PIMAGEHLP_SYMBOL, PSTR, DWORD);
1245 BOOL WINAPI SymUnloadModule(HANDLE, DWORD);
1247 #endif
1249 #ifdef __cplusplus
1250 } /* extern "C" */
1251 #endif /* defined(__cplusplus) */
1253 #endif /* __WINE_DBGHELP_H */