2 * imagehlp.h - Declarations for IMAGEHLP
5 #ifndef __WINE_IMAGEHLP_H
6 #define __WINE_IMAGEHLP_H
13 #endif /* defined(__cplusplus) */
15 /***********************************************************************
19 typedef PVOID DIGEST_HANDLE
;
21 /***********************************************************************
25 typedef enum _IMAGEHLP_STATUS_REASON
{
29 BindImportModuleFailed
,
30 BindImportProcedureFailed
,
36 BindExpandFileHeaders
,
38 BindMismatchedSymbols
,
40 } IMAGEHLP_STATUS_REASON
;
42 #define BIND_NO_BOUND_IMPORTS 0x00000001
43 #define BIND_NO_UPDATE 0x00000002
44 #define BIND_ALL_IMAGES 0x00000004
45 #define BIND_CACHE_IMPORT_DLLS 0x00000008
47 #define CERT_PE_IMAGE_DIGEST_DEBUG_INFO 0x01
48 #define CERT_PE_IMAGE_DIGEST_RESOURCES 0x02
49 #define CERT_PE_IMAGE_DIGEST_ALL_IMPORT_INFO 0x04
50 #define CERT_PE_IMAGE_DIGEST_NON_PE_INFO 0x08
52 #define CERT_SECTION_TYPE_ANY 0xFF
54 #define WIN_CERT_REVISION_1_0 0x0100
55 #define WIN_CERT_REVISION_2_0 0x0200
57 #define WIN_CERT_TYPE_X509 0x0001 /* X.509 Certificate */
58 #define WIN_CERT_TYPE_PKCS_SIGNED_DATA 0x0002 /* PKCS SignedData */
59 #define WIN_CERT_TYPE_RESERVED_1 0x0003 /* Reserved */
61 #define SPLITSYM_REMOVE_PRIVATE 0x00000001
62 #define SPLITSYM_EXTRACT_ALL 0x00000002
63 #define SPLITSYM_SYMBOLPATH_IS_SRC 0x00000004
68 #define FRAME_NONFPO 3
70 #define CHECKSUM_SUCCESS 0
71 #define CHECKSUM_OPEN_FAILURE 1
72 #define CHECKSUM_MAP_FAILURE 2
73 #define CHECKSUM_MAPVIEW_FAILURE 3
74 #define CHECKSUM_UNICODE_FAILURE 4
76 typedef enum _ADRESS_MODE
{
83 #define SYMOPT_CASE_INSENSITIVE 0x00000001
84 #define SYMOPT_UNDNAME 0x00000002
85 #define SYMOPT_DEFERRED_LOADS 0x00000004
86 #define SYMOPT_NO_CPP 0x00000008
87 #define SYMOPT_LOAD_LINES 0x00000010
88 #define SYMOPT_OMAP_FIND_NEAREST 0x00000020
90 #define SYMF_OMAP_GENERATED 0x00000001
91 #define SYMF_OMAP_MODIFIED 0x00000002
93 typedef enum _SYM_TYPE
{
100 SymSym
/* .sym file */
103 #define UNDNAME_COMPLETE 0x0000
104 #define UNDNAME_NO_LEADING_UNDERSCORES 0x0001
105 #define UNDNAME_NO_MS_KEYWORDS 0x0002
106 #define UNDNAME_NO_FUNCTION_RETURNS 0x0004
107 #define UNDNAME_NO_ALLOCATION_MODEL 0x0008
108 #define UNDNAME_NO_ALLOCATION_LANGUAGE 0x0010
109 #define UNDNAME_NO_MS_THISTYPE 0x0020
110 #define UNDNAME_NO_CV_THISTYPE 0x0040
111 #define UNDNAME_NO_THISTYPE 0x0060
112 #define UNDNAME_NO_ACCESS_SPECIFIERS 0x0080
113 #define UNDNAME_NO_THROW_SIGNATURES 0x0100
114 #define UNDNAME_NO_MEMBER_TYPE 0x0200
115 #define UNDNAME_NO_RETURN_UDT_MODEL 0x0400
116 #define UNDNAME_32_BIT_DECODE 0x0800
117 #define UNDNAME_NAME_ONLY 0x1000
118 #define UNDNAME_NO_ARGUMENTS 0x2000
119 #define UNDNAME_NO_SPECIAL_SYMS 0x4000
121 #define CBA_DEFERRED_SYMBOL_LOAD_START 0x00000001
122 #define CBA_DEFERRED_SYMBOL_LOAD_COMPLETE 0x00000002
123 #define CBA_DEFERRED_SYMBOL_LOAD_FAILURE 0x00000003
124 #define CBA_SYMBOLS_UNLOADED 0x00000004
125 #define CBA_DUPLICATE_SYMBOL 0x00000005
127 /***********************************************************************
131 typedef struct _LOADED_IMAGE
{
134 PUCHAR MappedAddress
;
135 PIMAGE_NT_HEADERS FileHeader
;
136 PIMAGE_SECTION_HEADER LastRvaSection
;
137 ULONG NumberOfSections
;
138 PIMAGE_SECTION_HEADER Sections
;
139 ULONG Characteristics
;
140 BOOLEAN fSystemImage
;
144 } LOADED_IMAGE
, *PLOADED_IMAGE
;
146 typedef struct _WIN_CERTIFICATE
{
148 WORD wRevision
; /* WIN_CERT_REVISON_xxx */
149 WORD wCertificateType
; /* WIN_CERT_TYPE_xxx */
150 BYTE bCertificate
[ANYSIZE_ARRAY
];
151 } WIN_CERTIFICATE
, *PWIN_CERTIFICATE
;
153 typedef struct _API_VERSION
{
158 } API_VERSION
, *PAPI_VERSION
;
160 typedef struct _IMAGE_DEBUG_INFORMATION
{
165 USHORT Characteristics
;
170 DWORD NumberOfSections
;
171 PIMAGE_SECTION_HEADER Sections
;
173 DWORD ExportedNamesSize
;
176 DWORD NumberOfFunctionTableEntries
;
177 PIMAGE_FUNCTION_ENTRY FunctionTableEntries
;
178 DWORD LowestFunctionStartingAddress
;
179 DWORD HighestFunctionEndingAddress
;
181 DWORD NumberOfFpoTableEntries
;
182 PFPO_DATA FpoTableEntries
;
184 DWORD SizeOfCoffSymbols
;
185 PIMAGE_COFF_SYMBOLS_HEADER CoffSymbols
;
187 DWORD SizeOfCodeViewSymbols
;
188 PVOID CodeViewSymbols
;
197 PIMAGE_DEBUG_DIRECTORY DebugDirectory
;
198 DWORD NumberOfDebugDirectories
;
201 } IMAGE_DEBUG_INFORMATION
, *PIMAGE_DEBUG_INFORMATION
;
203 typedef struct _ADDRESS
{
207 } ADDRESS
, *PADDRESS
;
209 typedef struct _KDHELP
{
211 DWORD ThCallbackStack
;
214 DWORD KiCallUserMode
;
215 DWORD KeUserCallbackDispatcher
;
216 DWORD SystemRangeStart
;
219 typedef struct _STACKFRAME
{
224 PVOID FuncTableEntry
;
230 } STACKFRAME
, *PSTACKFRAME
;
232 typedef struct _IMAGEHLP_SYMBOL
{
238 CHAR Name
[ANYSIZE_ARRAY
];
239 } IMAGEHLP_SYMBOL
, *PIMAGEHLP_SYMBOL
;
241 typedef struct _IMAGEHLP_MODULE
{
251 CHAR LoadedImageName
[256];
252 } IMAGEHLP_MODULE
, *PIMAGEHLP_MODULE
;
254 typedef struct _IMAGEHLP_LINE
{
260 } IMAGEHLP_LINE
, *PIMAGEHLP_LINE
;
262 typedef struct _IMAGEHLP_DEFERRED_SYMBOL_LOAD
{
267 CHAR FileName
[MAX_PATH
];
269 } IMAGEHLP_DEFERRED_SYMBOL_LOAD
, *PIMAGEHLP_DEFERRED_SYMBOL_LOAD
;
271 typedef struct _IMAGEHLP_DUPLICATE_SYMBOL
{
274 PIMAGEHLP_SYMBOL Symbol
;
275 ULONG SelectedSymbol
;
276 } IMAGEHLP_DUPLICATE_SYMBOL
, *PIMAGEHLP_DUPLICATE_SYMBOL
;
278 /***********************************************************************
282 typedef BOOL
CALLBACK (*PIMAGEHLP_STATUS_ROUTINE
)(
283 IMAGEHLP_STATUS_REASON Reason
, LPSTR ImageName
, LPSTR DllName
,
284 ULONG Va
, ULONG Parameter
287 typedef BOOL
CALLBACK (*PSYM_ENUMMODULES_CALLBACK
)(
288 LPSTR ModuleName
, ULONG BaseOfDll
, PVOID UserContext
291 typedef BOOL
CALLBACK (*PSYM_ENUMSYMBOLS_CALLBACK
)(
292 LPSTR SymbolName
, ULONG SymbolAddress
, ULONG SymbolSize
,
296 typedef BOOL
CALLBACK (*PENUMLOADED_MODULES_CALLBACK
)(
297 LPSTR ModuleName
, ULONG ModuleBase
, ULONG ModuleSize
,
301 typedef BOOL
CALLBACK (*PSYMBOL_REGISTERED_CALLBACK
)(
302 HANDLE hProcess
, ULONG ActionCode
, PVOID CallbackData
,
306 typedef BOOL
CALLBACK (*DIGEST_FUNCTION
)(
307 DIGEST_HANDLE refdata
, PBYTE pData
, DWORD dwLength
310 typedef BOOL
CALLBACK (*PREAD_PROCESS_MEMORY_ROUTINE
)(
311 HANDLE hProcess
, PCVOID lpBaseAddress
, PVOID lpBuffer
,
312 DWORD nSize
, PDWORD lpNumberOfBytesRead
315 typedef PVOID
CALLBACK (*PFUNCTION_TABLE_ACCESS_ROUTINE
)(
316 HANDLE hProcess
, DWORD AddrBase
319 typedef DWORD
CALLBACK (*PGET_MODULE_BASE_ROUTINE
)(
320 HANDLE hProcess
, DWORD ReturnAddress
);
322 typedef DWORD
CALLBACK (*PTRANSLATE_ADDRESS_ROUTINE
)(
323 HANDLE hProcess
, HANDLE hThread
, PADDRESS lpaddr
326 /***********************************************************************
330 BOOL WINAPI
BindImage(
331 LPSTR ImageName
, LPSTR DllPath
, LPSTR SymbolPath
333 BOOL WINAPI
BindImageEx(
334 DWORD Flags
, LPSTR ImageName
, LPSTR DllPath
, LPSTR SymbolPath
,
335 PIMAGEHLP_STATUS_ROUTINE StatusRoutine
337 PIMAGE_NT_HEADERS WINAPI
CheckSumMappedFile(
338 LPVOID BaseAddress
, DWORD FileLength
,
339 LPDWORD HeaderSum
, LPDWORD CheckSum
341 BOOL WINAPI
EnumerateLoadedModules(
343 PENUMLOADED_MODULES_CALLBACK EnumLoadedModulesCallback
,
346 HANDLE WINAPI
FindDebugInfoFile(
347 LPSTR FileName
, LPSTR SymbolPath
, LPSTR DebugFilePath
349 HANDLE WINAPI
FindExecutableImage(
350 LPSTR FileName
, LPSTR SymbolPath
, LPSTR ImageFilePath
352 BOOL WINAPI
GetImageConfigInformation(
353 PLOADED_IMAGE LoadedImage
,
354 PIMAGE_LOAD_CONFIG_DIRECTORY ImageConfigInformation
356 DWORD WINAPI
GetImageUnusedHeaderBytes(
357 PLOADED_IMAGE LoadedImage
,
358 LPDWORD SizeUnusedHeaderBytes
360 DWORD WINAPI
GetTimestampForLoadedLibrary(
363 BOOL WINAPI
ImageAddCertificate(
364 HANDLE FileHandle
, PWIN_CERTIFICATE Certificate
, PDWORD Index
366 PVOID WINAPI
ImageDirectoryEntryToData(
367 PVOID Base
, BOOLEAN MappedAsImage
, USHORT DirectoryEntry
, PULONG Size
369 BOOL WINAPI
ImageEnumerateCertificates(
370 HANDLE FileHandle
, WORD TypeFilter
, PDWORD CertificateCount
,
371 PDWORD Indices
, DWORD IndexCount
373 BOOL WINAPI
ImageGetCertificateData(
374 HANDLE FileHandle
, DWORD CertificateIndex
,
375 PWIN_CERTIFICATE Certificate
, PDWORD RequiredLength
377 BOOL WINAPI
ImageGetCertificateHeader(
378 HANDLE FileHandle
, DWORD CertificateIndex
,
379 PWIN_CERTIFICATE Certificateheader
381 BOOL WINAPI
ImageGetDigestStream(
382 HANDLE FileHandle
, DWORD DigestLevel
,
383 DIGEST_FUNCTION DigestFunction
, DIGEST_HANDLE DigestHandle
385 PLOADED_IMAGE WINAPI
ImageLoad(
386 LPSTR DllName
, LPSTR DllPath
388 PIMAGE_NT_HEADERS WINAPI
ImageNtHeader(
391 BOOL WINAPI
ImageRemoveCertificate(
392 HANDLE FileHandle
, DWORD Index
394 PIMAGE_SECTION_HEADER WINAPI
ImageRvaToSection(
395 PIMAGE_NT_HEADERS NtHeaders
, PVOID Base
, ULONG Rva
397 PVOID WINAPI
ImageRvaToVa(
398 PIMAGE_NT_HEADERS NtHeaders
, PVOID Base
, ULONG Rva
,
399 PIMAGE_SECTION_HEADER
*LastRvaSection
401 BOOL WINAPI
ImageUnload(
402 PLOADED_IMAGE LoadedImage
404 PAPI_VERSION WINAPI
ImagehlpApiVersion(
407 PAPI_VERSION WINAPI
ImagehlpApiVersionEx(
408 PAPI_VERSION AppVersion
410 BOOL WINAPI
MakeSureDirectoryPathExists(
413 BOOL WINAPI
MapAndLoad(
414 LPSTR ImageName
, LPSTR DllPath
, PLOADED_IMAGE LoadedImage
,
415 BOOL DotDll
, BOOL ReadOnly
417 PIMAGE_DEBUG_INFORMATION WINAPI
MapDebugInformation(
418 HANDLE FileHandle
, LPSTR FileName
,
419 LPSTR SymbolPath
, DWORD ImageBase
421 DWORD WINAPI
MapFileAndCheckSumA(
422 LPSTR Filename
, LPDWORD HeaderSum
, LPDWORD CheckSum
424 DWORD WINAPI
MapFileAndCheckSumW(
425 LPWSTR Filename
, LPDWORD HeaderSum
, LPDWORD CheckSum
427 BOOL WINAPI
ReBaseImage(
428 LPSTR CurrentImageName
, LPSTR SymbolPath
, BOOL fReBase
,
429 BOOL fRebaseSysfileOk
, BOOL fGoingDown
, ULONG CheckImageSize
,
430 ULONG
*OldImageSize
, ULONG
*OldImageBase
, ULONG
*NewImageSize
,
431 ULONG
*NewImageBase
, ULONG TimeStamp
433 BOOL WINAPI
RemovePrivateCvSymbolic(
434 PCHAR DebugData
, PCHAR
*NewDebugData
, ULONG
*NewDebugSize
436 VOID WINAPI
RemoveRelocations(
439 BOOL WINAPI
SearchTreeForFile(
440 LPSTR RootPath
, LPSTR InputPathName
, LPSTR OutputPathBuffer
442 BOOL WINAPI
SetImageConfigInformation(
443 PLOADED_IMAGE LoadedImage
,
444 PIMAGE_LOAD_CONFIG_DIRECTORY ImageConfigInformation
446 BOOL WINAPI
SplitSymbols(
447 LPSTR ImageName
, LPSTR SymbolsPath
,
448 LPSTR SymbolFilePath
, DWORD Flags
450 BOOL WINAPI
StackWalk(
451 DWORD MachineType
, HANDLE hProcess
, HANDLE hThread
,
452 PSTACKFRAME StackFrame
, PVOID ContextRecord
,
453 PREAD_PROCESS_MEMORY_ROUTINE ReadMemoryRoutine
,
454 PFUNCTION_TABLE_ACCESS_ROUTINE FunctionTableAccessRoutine
,
455 PGET_MODULE_BASE_ROUTINE GetModuleBaseRoutine
,
456 PTRANSLATE_ADDRESS_ROUTINE TranslateAddress
458 BOOL WINAPI
SymCleanup(
461 BOOL WINAPI
SymEnumerateModules(
462 HANDLE hProcess
, PSYM_ENUMMODULES_CALLBACK EnumModulesCallback
,
465 BOOL WINAPI
SymEnumerateSymbols(
466 HANDLE hProcess
, DWORD BaseOfDll
,
467 PSYM_ENUMSYMBOLS_CALLBACK EnumSymbolsCallback
, PVOID UserContext
469 PVOID WINAPI
SymFunctionTableAccess(
470 HANDLE hProcess
, DWORD AddrBase
472 DWORD WINAPI
SymGetModuleBase(
473 HANDLE hProcess
, DWORD dwAddr
475 BOOL WINAPI
SymGetModuleInfo(
476 HANDLE hProcess
, DWORD dwAddr
,
477 PIMAGEHLP_MODULE ModuleInfo
479 DWORD WINAPI
SymGetOptions(
482 BOOL WINAPI
SymGetSearchPath(
483 HANDLE hProcess
, LPSTR szSearchPath
, DWORD SearchPathLength
485 BOOL WINAPI
SymGetSymFromAddr(
486 HANDLE hProcess
, DWORD dwAddr
,
487 PDWORD pdwDisplacement
, PIMAGEHLP_SYMBOL Symbol
489 BOOL WINAPI
SymGetSymFromName(
490 HANDLE hProcess
, LPSTR Name
, PIMAGEHLP_SYMBOL Symbol
492 BOOL WINAPI
SymGetSymNext(
493 HANDLE hProcess
, PIMAGEHLP_SYMBOL Symbol
495 BOOL WINAPI
SymGetSymPrev(
496 HANDLE hProcess
, PIMAGEHLP_SYMBOL Symbol
498 BOOL WINAPI
SymInitialize(
499 HANDLE hProcess
, LPSTR UserSearchPath
, BOOL fInvadeProcess
501 BOOL WINAPI
SymLoadModule(
502 HANDLE hProcess
, HANDLE hFile
, LPSTR ImageName
, LPSTR ModuleName
,
503 DWORD BaseOfDll
, DWORD SizeOfDll
505 BOOL WINAPI
SymRegisterCallback(
506 HANDLE hProcess
, PSYMBOL_REGISTERED_CALLBACK CallbackFunction
,
509 DWORD WINAPI
SymSetOptions(
512 BOOL WINAPI
SymSetSearchPath(
513 HANDLE hProcess
, LPSTR szSearchPath
515 BOOL WINAPI
SymUnDName(
516 PIMAGEHLP_SYMBOL sym
, LPSTR UnDecName
, DWORD UnDecNameLength
518 BOOL WINAPI
SymUnloadModule(
519 HANDLE hProcess
, DWORD BaseOfDll
521 BOOL WINAPI
TouchFileTimes(
522 HANDLE FileHandle
, LPSYSTEMTIME lpSystemTime
524 DWORD WINAPI
UnDecorateSymbolName(
525 LPCSTR DecoratedName
, LPSTR UnDecoratedName
,
526 DWORD UndecoratedLength
, DWORD Flags
528 BOOL WINAPI
UnMapAndLoad(
529 PLOADED_IMAGE LoadedImage
531 BOOL WINAPI
UnmapDebugInformation(
532 PIMAGE_DEBUG_INFORMATION DebugInfo
534 BOOL WINAPI
UpdateDebugInfoFile(
535 LPSTR ImageFileName
, LPSTR SymbolPath
,
536 LPSTR DebugFilePath
, PIMAGE_NT_HEADERS NtHeaders
538 BOOL WINAPI
UpdateDebugInfoFileEx(
539 LPSTR ImageFileName
, LPSTR SymbolPath
, LPSTR DebugFilePath
,
540 PIMAGE_NT_HEADERS NtHeaders
, DWORD OldChecksum
543 /***********************************************************************
547 extern HANDLE IMAGEHLP_hHeap
;
551 #endif /* defined(__cplusplus) */
553 #endif /* __WINE_IMAGEHLP_H */