|
|
1.1 root 1: /*++ BUILD Version: 0001 Increment this if a change has global effects
2:
3: Copyright (c) 1993 Microsoft Corporation
4:
5: Module Name:
6:
7: imagehlp.h
8:
9: Abstract:
10:
11: This module defines the prptotypes and constants required for the image
12: help routines.
13:
14: Revision History:
15:
16: --*/
17:
18: #ifndef _IMAGEHLP_
19: #define _IMAGEHLP_
20:
21: #ifdef __cplusplus
22: extern "C" {
23: #endif
24:
25: //
26: // Define checksum return codes.
27: //
28:
29: #define CHECKSUM_SUCCESS 0
30: #define CHECKSUM_OPEN_FAILURE 1
31: #define CHECKSUM_MAP_FAILURE 2
32: #define CHECKSUM_MAPVIEW_FAILURE 3
33: #define CHECKSUM_UNICODE_FAILURE 4
34:
35:
36:
37: //
38: // Define checksum function prototypes.
39: //
40:
41: PIMAGE_NT_HEADERS
42: CheckSumMappedFile (
43: LPVOID BaseAddress,
44: DWORD FileLength,
45: LPDWORD HeaderSum,
46: LPDWORD CheckSum
47: );
48:
49: DWORD
50: MapFileAndCheckSumA (
51: LPSTR Filename,
52: LPDWORD HeaderSum,
53: LPDWORD CheckSum
54: );
55:
56: DWORD
57: MapFileAndCheckSumW (
58: PWSTR Filename,
59: LPDWORD HeaderSum,
60: LPDWORD CheckSum
61: );
62:
63: #ifdef UNICODE
64: #define MapFileAndCheckSum MapFileAndCheckSumW
65: #else
66: #define MapFileAndCheckSum MapFileAndCheckSumA
67: #endif // !UNICODE
68:
69:
70: BOOL
71: TouchFileTimes (
72: HANDLE FileHandle,
73: LPSYSTEMTIME lpSystemTime
74: );
75:
76: BOOL
77: SplitSymbols (
78: LPSTR ImageName,
79: LPSTR SymbolsPath,
80: LPSTR SymbolFilePath
81: );
82:
83: HANDLE
84: FindDebugInfoFile (
85: LPSTR FileName,
86: LPSTR SymbolPath,
87: LPSTR DebugFilePath
88: );
89:
90: BOOL
91: UpdateDebugInfoFile(
92: LPSTR ImageFileName,
93: LPSTR SymbolPath,
94: LPSTR DebugFilePath,
95: PIMAGE_NT_HEADERS NtHeaders
96: );
97:
98: //
99: // Function table extracted from MIPS/ALPHA images. Does not contain
100: // information needed only for runtime support. Just those fields for
101: // each entry needed by a debugger.
102: //
103:
104: typedef struct _IMAGE_FUNCTION_ENTRY {
105: DWORD StartingAddress;
106: DWORD EndingAddress;
107: DWORD EndOfPrologue;
108: } IMAGE_FUNCTION_ENTRY, *PIMAGE_FUNCTION_ENTRY;
109:
110: typedef struct _IMAGE_DEBUG_INFORMATION {
111: LIST_ENTRY List;
112: DWORD Size;
113: PVOID MappedBase;
114: USHORT Machine;
115: USHORT Characteristics;
116: DWORD CheckSum;
117: DWORD ImageBase;
118: DWORD SizeOfImage;
119:
120: DWORD NumberOfSections;
121: PIMAGE_SECTION_HEADER Sections;
122:
123: DWORD ExportedNamesSize;
124: LPSTR ExportedNames;
125:
126: DWORD NumberOfFunctionTableEntries;
127: PIMAGE_FUNCTION_ENTRY FunctionTableEntries;
128: DWORD LowestFunctionStartingAddress;
129: DWORD HighestFunctionEndingAddress;
130:
131: DWORD NumberOfFpoTableEntries;
132: PFPO_DATA FpoTableEntries;
133:
134: DWORD SizeOfCoffSymbols;
135: PIMAGE_COFF_SYMBOLS_HEADER CoffSymbols;
136:
137: DWORD SizeOfCodeViewSymbols;
138: PVOID CodeViewSymbols;
139:
140: LPSTR ImageFilePath;
141: LPSTR ImageFileName;
142: LPSTR DebugFilePath;
143:
144: DWORD TimeDateStamp;
145: } IMAGE_DEBUG_INFORMATION, *PIMAGE_DEBUG_INFORMATION;
146:
147:
148: PIMAGE_DEBUG_INFORMATION
149: MapDebugInformation (
150: HANDLE FileHandle,
151: LPSTR FileName,
152: LPSTR SymbolPath,
153: DWORD ImageBase
154: );
155:
156: BOOL
157: UnmapDebugInformation(
158: PIMAGE_DEBUG_INFORMATION DebugInfo
159: );
160:
161: BOOL
162: SearchTreeForFile(
163: LPSTR RootPath,
164: LPSTR InputPathName,
165: LPSTR OutputPathBuffer
166: );
167:
168: BOOL
169: MakeSureDirectoryPathExists(
170: LPSTR DirPath
171: );
172:
173: //
174: // UnDecorateSymbolName Flags
175: //
176:
177: #define UNDNAME_COMPLETE (0x0000) // Enable full undecoration
178: #define UNDNAME_NO_LEADING_UNDERSCORES (0x0001) // Remove leading underscores from MS extended keywords
179: #define UNDNAME_NO_MS_KEYWORDS (0x0002) // Disable expansion of MS extended keywords
180: #define UNDNAME_NO_FUNCTION_RETURNS (0x0004) // Disable expansion of return type for primary declaration
181: #define UNDNAME_NO_ALLOCATION_MODEL (0x0008) // Disable expansion of the declaration model
182: #define UNDNAME_NO_ALLOCATION_LANGUAGE (0x0010) // Disable expansion of the declaration language specifier
183: #define UNDNAME_NO_MS_THISTYPE (0x0020) // NYI Disable expansion of MS keywords on the 'this' type for primary declaration
184: #define UNDNAME_NO_CV_THISTYPE (0x0040) // NYI Disable expansion of CV modifiers on the 'this' type for primary declaration
185: #define UNDNAME_NO_THISTYPE (0x0060) // Disable all modifiers on the 'this' type
186: #define UNDNAME_NO_ACCESS_SPECIFIERS (0x0080) // Disable expansion of access specifiers for members
187: #define UNDNAME_NO_THROW_SIGNATURES (0x0100) // Disable expansion of 'throw-signatures' for functions and pointers to functions
188: #define UNDNAME_NO_MEMBER_TYPE (0x0200) // Disable expansion of 'static' or 'virtual'ness of members
189: #define UNDNAME_NO_RETURN_UDT_MODEL (0x0400) // Disable expansion of MS model for UDT returns
190: #define UNDNAME_32_BIT_DECODE (0x0800) // Undecorate 32-bit decorated names
191:
192: DWORD
193: WINAPI
194: UnDecorateSymbolName(
195: LPSTR DecoratedName,
196: LPSTR UnDecoratedName,
197: DWORD UndecoratedLength,
198: DWORD Flags
199: );
200:
201: #ifdef __cplusplus
202: }
203: #endif
204:
205: #endif
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.