Leaked source code of windows server 2003
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.

435 lines
8.0 KiB

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