Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

372 lines
6.7 KiB

  1. #include "sdktoolspch.h"
  2. #pragma hdrstop
  3. #define _IMAGEHLP_SOURCE_
  4. #include <imagehlp.h>
  5. static
  6. BOOL
  7. IMAGEAPI
  8. ImageEnumerateCertificates(
  9. IN HANDLE FileHandle,
  10. IN WORD TypeFilter,
  11. OUT PDWORD CertificateCount,
  12. IN OUT PDWORD Indices OPTIONAL,
  13. IN DWORD IndexCount OPTIONAL
  14. )
  15. {
  16. return FALSE;
  17. }
  18. static
  19. BOOL
  20. IMAGEAPI
  21. ImageGetCertificateData(
  22. IN HANDLE FileHandle,
  23. IN DWORD CertificateIndex,
  24. OUT LPWIN_CERTIFICATE Certificate,
  25. IN OUT PDWORD RequiredLength
  26. )
  27. {
  28. return FALSE;
  29. }
  30. static
  31. BOOL
  32. IMAGEAPI
  33. ImageGetCertificateHeader(
  34. IN HANDLE FileHandle,
  35. IN DWORD CertificateIndex,
  36. IN OUT LPWIN_CERTIFICATE CertificateHeader
  37. )
  38. {
  39. return FALSE;
  40. }
  41. static
  42. BOOL
  43. IMAGEAPI
  44. ImageGetDigestStream(
  45. IN HANDLE FileHandle,
  46. IN DWORD DigestLevel,
  47. IN DIGEST_FUNCTION DigestFunction,
  48. IN DIGEST_HANDLE DigestHandle
  49. )
  50. {
  51. return FALSE;
  52. }
  53. static
  54. BOOL
  55. IMAGEAPI
  56. MapAndLoad(
  57. LPSTR ImageName,
  58. LPSTR DllPath,
  59. PLOADED_IMAGE LoadedImage,
  60. BOOL DotDll,
  61. BOOL ReadOnly
  62. )
  63. {
  64. return FALSE;
  65. }
  66. static
  67. BOOL
  68. StackWalk(
  69. DWORD MachineType,
  70. HANDLE hProcess,
  71. HANDLE hThread,
  72. LPSTACKFRAME StackFrame32,
  73. LPVOID ContextRecord,
  74. PREAD_PROCESS_MEMORY_ROUTINE ReadMemory32,
  75. PFUNCTION_TABLE_ACCESS_ROUTINE FunctionTableAccess32,
  76. PGET_MODULE_BASE_ROUTINE GetModuleBase32,
  77. PTRANSLATE_ADDRESS_ROUTINE TranslateAddress32
  78. )
  79. {
  80. return FALSE;
  81. }
  82. static
  83. BOOL
  84. StackWalk64(
  85. DWORD MachineType,
  86. HANDLE hProcess,
  87. HANDLE hThread,
  88. LPSTACKFRAME64 StackFrame,
  89. LPVOID ContextRecord,
  90. PREAD_PROCESS_MEMORY_ROUTINE64 ReadMemory,
  91. PFUNCTION_TABLE_ACCESS_ROUTINE64 FunctionTableAccess,
  92. PGET_MODULE_BASE_ROUTINE64 GetModuleBase,
  93. PTRANSLATE_ADDRESS_ROUTINE64 TranslateAddress
  94. )
  95. {
  96. return FALSE;
  97. }
  98. static
  99. LPVOID
  100. IMAGEAPI
  101. SymFunctionTableAccess(
  102. HANDLE hProcess,
  103. DWORD AddrBase
  104. )
  105. {
  106. return NULL;
  107. }
  108. static
  109. LPVOID
  110. IMAGEAPI
  111. SymFunctionTableAccess64(
  112. HANDLE hProcess,
  113. DWORD64 AddrBase
  114. )
  115. {
  116. return NULL;
  117. }
  118. static
  119. BOOL
  120. IMAGEAPI
  121. SymGetModuleInfo(
  122. IN HANDLE hProcess,
  123. IN DWORD dwAddr,
  124. OUT PIMAGEHLP_MODULE ModuleInfo
  125. )
  126. {
  127. if (ModuleInfo != NULL) {
  128. DWORD dwSize = ModuleInfo->SizeOfStruct;
  129. ZeroMemory(ModuleInfo, dwSize);
  130. ModuleInfo->SizeOfStruct = dwSize;
  131. }
  132. return FALSE;
  133. }
  134. static
  135. BOOL
  136. IMAGEAPI
  137. SymGetModuleInfo64(
  138. IN HANDLE hProcess,
  139. IN DWORD64 dwAddr,
  140. OUT PIMAGEHLP_MODULE64 ModuleInfo
  141. )
  142. {
  143. return FALSE;
  144. }
  145. static
  146. DWORD
  147. IMAGEAPI
  148. SymGetOptions(
  149. VOID
  150. )
  151. {
  152. return 0;
  153. }
  154. static
  155. BOOL
  156. IMAGEAPI
  157. SymGetSymFromAddr(
  158. IN HANDLE hProcess,
  159. IN DWORD Address,
  160. OUT PDWORD Displacement,
  161. OUT PIMAGEHLP_SYMBOL Symbol
  162. )
  163. {
  164. if (Displacement != NULL) {
  165. *Displacement = 0;
  166. }
  167. if (Symbol != NULL) {
  168. DWORD dwSize = Symbol->SizeOfStruct;
  169. ZeroMemory(Symbol, dwSize);
  170. Symbol->SizeOfStruct = dwSize;
  171. }
  172. return FALSE;
  173. }
  174. static
  175. BOOL
  176. IMAGEAPI
  177. SymGetSymFromAddr64(
  178. IN HANDLE hProcess,
  179. IN DWORD64 Address,
  180. OUT PDWORD64 Displacement,
  181. OUT PIMAGEHLP_SYMBOL64 Symbol
  182. )
  183. {
  184. if (Displacement != NULL) {
  185. *Displacement = 0;
  186. }
  187. if (Symbol != NULL) {
  188. DWORD dwSize = Symbol->SizeOfStruct;
  189. ZeroMemory(Symbol, dwSize);
  190. Symbol->SizeOfStruct = dwSize;
  191. }
  192. return FALSE;
  193. }
  194. static
  195. BOOL
  196. IMAGEAPI
  197. SymInitialize(
  198. IN HANDLE hProcess,
  199. IN LPSTR UserSearchPath,
  200. IN BOOL InvadeProcess
  201. )
  202. {
  203. return FALSE;
  204. }
  205. static
  206. DWORD
  207. IMAGEAPI
  208. SymLoadModule(
  209. IN HANDLE hProcess,
  210. IN HANDLE hFile,
  211. IN PSTR ImageName,
  212. IN PSTR ModuleName,
  213. IN DWORD BaseOfDll,
  214. IN DWORD DllSize
  215. )
  216. {
  217. return FALSE;
  218. }
  219. static
  220. DWORD64
  221. IMAGEAPI
  222. SymLoadModule64(
  223. IN HANDLE hProcess,
  224. IN HANDLE hFile,
  225. IN PSTR ImageName,
  226. IN PSTR ModuleName,
  227. IN DWORD64 BaseOfDll,
  228. IN DWORD DllSize
  229. )
  230. {
  231. return FALSE;
  232. }
  233. static
  234. DWORD64
  235. IMAGEAPI
  236. SymLoadModuleEx(
  237. IN HANDLE hProcess,
  238. IN HANDLE hFile,
  239. IN PSTR ImageName,
  240. IN PSTR ModuleName,
  241. IN DWORD64 BaseOfDll,
  242. IN DWORD DllSize,
  243. IN PMODLOAD_DATA Data,
  244. IN DWORD Flags
  245. )
  246. {
  247. return FALSE;
  248. }
  249. static
  250. DWORD
  251. IMAGEAPI
  252. SymSetOptions(
  253. DWORD UserOptions
  254. )
  255. {
  256. return FALSE;
  257. }
  258. static
  259. BOOL
  260. IMAGEAPI
  261. SymUnDName(
  262. IN PIMAGEHLP_SYMBOL sym,
  263. OUT LPSTR UnDecName,
  264. OUT DWORD UnDecNameLength
  265. )
  266. {
  267. if (UnDecName != NULL && UnDecNameLength > 0) {
  268. UnDecName[0] = '\0';
  269. }
  270. return FALSE;
  271. }
  272. static
  273. BOOL
  274. IMAGEAPI
  275. SymUnDName64(
  276. IN PIMAGEHLP_SYMBOL64 sym,
  277. OUT LPSTR UnDecName,
  278. OUT DWORD UnDecNameLength
  279. )
  280. {
  281. if (UnDecName != NULL && UnDecNameLength > 0) {
  282. UnDecName[0] = '\0';
  283. }
  284. return FALSE;
  285. }
  286. static
  287. DWORD
  288. IMAGEAPI
  289. WINAPI
  290. UnDecorateSymbolName(
  291. LPCSTR name,
  292. LPSTR outputString,
  293. DWORD maxStringLength,
  294. DWORD flags
  295. )
  296. {
  297. if (outputString != NULL && maxStringLength > 0) {
  298. outputString[0] = '\0';
  299. }
  300. return FALSE;
  301. }
  302. static
  303. BOOL
  304. UnMapAndLoad(
  305. PLOADED_IMAGE pLi
  306. )
  307. {
  308. return FALSE;
  309. }
  310. //
  311. // !! WARNING !! The entries below must be in alphabetical order, and are CASE SENSITIVE (eg lower case comes last!)
  312. //
  313. DEFINE_PROCNAME_ENTRIES(imagehlp)
  314. {
  315. DLPENTRY(ImageEnumerateCertificates)
  316. DLPENTRY(ImageGetCertificateData)
  317. DLPENTRY(ImageGetCertificateHeader)
  318. DLPENTRY(ImageGetDigestStream)
  319. DLPENTRY(MapAndLoad)
  320. DLPENTRY(StackWalk)
  321. DLPENTRY(StackWalk64)
  322. DLPENTRY(SymFunctionTableAccess)
  323. DLPENTRY(SymFunctionTableAccess64)
  324. DLPENTRY(SymGetModuleInfo)
  325. DLPENTRY(SymGetModuleInfo64)
  326. DLPENTRY(SymGetOptions)
  327. DLPENTRY(SymGetSymFromAddr)
  328. DLPENTRY(SymGetSymFromAddr64)
  329. DLPENTRY(SymInitialize)
  330. DLPENTRY(SymLoadModule)
  331. DLPENTRY(SymLoadModule64)
  332. DLPENTRY(SymLoadModuleEx)
  333. DLPENTRY(SymSetOptions)
  334. DLPENTRY(SymUnDName)
  335. DLPENTRY(SymUnDName64)
  336. DLPENTRY(UnDecorateSymbolName)
  337. DLPENTRY(UnMapAndLoad)
  338. };
  339. DEFINE_PROCNAME_MAP(imagehlp)