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.

370 lines
5.8 KiB

  1. /*++
  2. Copyright (C) Microsoft Corporation, 1990 - 2000
  3. All rights reserved.
  4. Module Name:
  5. dbglocal.h
  6. Abstract:
  7. Header file for Spooler Subsystem Debugger Extensions
  8. Author:
  9. Krishna Ganugapati (KrishnaG) 08-July-1992
  10. Revision History:
  11. --*/
  12. // Macro Land
  13. // Note: if you use any of these macros within your code, you must have the
  14. // following variables present and set to the appropriate value
  15. //
  16. // HANDLE hCurrentProcess
  17. // PNTSD_GET_EXPRESSION EvalExpression
  18. //
  19. //
  20. #define move(dst, src)\
  21. try {\
  22. ReadProcessMemory(hCurrentProcess, (LPVOID)src, &dst, sizeof(dst), NULL);\
  23. } except (EXCEPTION_EXECUTE_HANDLER) {\
  24. return 0;\
  25. }
  26. #define movestruct(src, dst, type)\
  27. try {\
  28. ReadProcessMemory(hCurrentProcess, (LPVOID)src, dst, sizeof(type), NULL);\
  29. } except (EXCEPTION_EXECUTE_HANDLER) {\
  30. return 0;\
  31. }
  32. #define movemem(src, dst, sz)\
  33. try {\
  34. if (!ReadProcessMemory(hCurrentProcess, (LPVOID)src, dst, sz, NULL)) { \
  35. ((PBYTE)(dst))[0] = 0; \
  36. } \
  37. } except (EXCEPTION_EXECUTE_HANDLER) {\
  38. return 0;\
  39. }
  40. #define movestr(src, dst, sz)\
  41. try {\
  42. if (!ReadProcessString(hCurrentProcess, (LPVOID)src, dst, sz, NULL)) { \
  43. ((PBYTE)(dst))[0] = 0; \
  44. } \
  45. } except (EXCEPTION_EXECUTE_HANDLER) {\
  46. return 0;\
  47. }
  48. #define GetAddress(dst, src)\
  49. try {\
  50. dst = EvalExpression(src);\
  51. } except (GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION ?\
  52. EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH) {\
  53. Print("NTSD: Access violation on \"%s\", switch to server context\n", src);\
  54. return(0);\
  55. }
  56. VOID
  57. EnterSplSem(
  58. VOID
  59. );
  60. VOID
  61. LeaveSplSem(
  62. VOID
  63. );
  64. #if DBG
  65. VOID
  66. SplInSem(
  67. VOID
  68. );
  69. VOID
  70. SplOutSem(
  71. VOID
  72. );
  73. #else
  74. #define SplInSem()
  75. #define SplOutSem()
  76. #endif
  77. BOOL
  78. DbgDumpIniPrintProc(
  79. HANDLE hCurrentProcess,
  80. PNTSD_OUTPUT_ROUTINE Print,
  81. PINIPRINTPROC pIniPrintProc
  82. );
  83. BOOL
  84. DbgDumpIniDriver(
  85. HANDLE hCurrentProcess,
  86. PNTSD_OUTPUT_ROUTINE Print,
  87. PINIDRIVER pIniDriver
  88. );
  89. BOOL
  90. DbgDumpIniEnvironment(
  91. HANDLE hCurrentProcess,
  92. PNTSD_OUTPUT_ROUTINE Print,
  93. PINIENVIRONMENT pIniEnvironment
  94. );
  95. BOOL
  96. DbgDumpIniNetPrint(
  97. HANDLE hCurrentProcess,
  98. PNTSD_OUTPUT_ROUTINE Print,
  99. PININETPRINT pIniNetPrint
  100. );
  101. BOOL
  102. DbgDumpIniMonitor(
  103. HANDLE hCurrentProcess,
  104. PNTSD_OUTPUT_ROUTINE Print,
  105. PINIMONITOR pIniMonitor
  106. );
  107. BOOL
  108. DbgDumpIniPort(
  109. HANDLE hCurrentProcess,
  110. PNTSD_OUTPUT_ROUTINE Print,
  111. PINIPORT pIniPort
  112. );
  113. BOOL
  114. DbgDumpWIniPort(
  115. HANDLE hCurrentProcess,
  116. PNTSD_OUTPUT_ROUTINE Print,
  117. PWINIPORT pIniPort
  118. );
  119. BOOL
  120. DbgDumpIniPrinter(
  121. HANDLE hCurrentProcess,
  122. PNTSD_OUTPUT_ROUTINE Print,
  123. PINIPRINTER pIniPrinter
  124. );
  125. BOOL
  126. DbgDumpIniForm(
  127. HANDLE hCurrentProcess,
  128. PNTSD_OUTPUT_ROUTINE Print,
  129. PINIFORM pForm
  130. );
  131. BOOL
  132. DbgDumpIniJob(
  133. HANDLE hCurrentProcess,
  134. PNTSD_OUTPUT_ROUTINE Print,
  135. PINIJOB pIniJob
  136. );
  137. BOOL
  138. DbgDumpProvidor(
  139. HANDLE hCurrentProcess,
  140. PNTSD_OUTPUT_ROUTINE Print,
  141. LPPROVIDOR pProvidor
  142. );
  143. BOOL
  144. DbgDumpSpool(
  145. HANDLE hCurrentProcess,
  146. PNTSD_OUTPUT_ROUTINE Print,
  147. PSPOOL pSpool
  148. );
  149. BOOL
  150. DbgDumpShadowFile(
  151. HANDLE hCurrentProcess,
  152. PNTSD_OUTPUT_ROUTINE Print,
  153. PSHADOWFILE pShadowFile
  154. );
  155. BOOL
  156. DbgDumpShadowFile2(
  157. HANDLE hCurrentProcess,
  158. PNTSD_OUTPUT_ROUTINE Print,
  159. PSHADOWFILE_2 pShadowFile
  160. );
  161. VOID
  162. WINAPIV
  163. PrintData(
  164. PNTSD_OUTPUT_ROUTINE Print,
  165. LPSTR TypeString,
  166. LPSTR VarString,
  167. ...
  168. );
  169. BOOL
  170. DbgDumpChange(
  171. HANDLE hCurrentProcess,
  172. PNTSD_OUTPUT_ROUTINE Print,
  173. PCHANGE pChange
  174. );
  175. BOOL
  176. DumpDevMode(
  177. HANDLE hCurrentProcess,
  178. PNTSD_OUTPUT_ROUTINE Print,
  179. UINT_PTR lpAddress
  180. );
  181. BOOL
  182. DbgDumpSecurityDescriptor(
  183. HANDLE hCurrentProcess,
  184. PNTSD_OUTPUT_ROUTINE Print,
  185. PISECURITY_DESCRIPTOR pSecurityDescriptor
  186. );
  187. BOOL
  188. DbgDumpSid(
  189. HANDLE hCurrentProcess,
  190. PNTSD_OUTPUT_ROUTINE Print,
  191. PVOID SidAddress
  192. );
  193. BOOL
  194. DbgDumpAcl(
  195. HANDLE hCurrentProcess,
  196. PNTSD_OUTPUT_ROUTINE Print,
  197. PVOID AclAddress
  198. );
  199. VOID
  200. ConvertSidToAsciiString(
  201. PSID pSid,
  202. LPSTR String
  203. );
  204. DWORD
  205. EvalValue(
  206. LPSTR *pptstr,
  207. PNTSD_GET_EXPRESSION EvalExpression,
  208. PNTSD_OUTPUT_ROUTINE Print
  209. );
  210. BOOL
  211. DbgDumpIniSpooler(
  212. HANDLE hCurrentProcess,
  213. PNTSD_OUTPUT_ROUTINE Print,
  214. PINISPOOLER pIniSpooler
  215. );
  216. BOOL
  217. DbgDumpPrintHandle(
  218. HANDLE hCurrentProcess,
  219. PNTSD_OUTPUT_ROUTINE Print,
  220. PPRINTHANDLE pPrintHandle
  221. );
  222. BOOL
  223. DbgDumpChange(
  224. HANDLE hCurrentProcess,
  225. PNTSD_OUTPUT_ROUTINE Print,
  226. PCHANGE pChange
  227. );
  228. BOOL
  229. DbgDumpNotify(
  230. HANDLE hCurrentProcess,
  231. PNTSD_OUTPUT_ROUTINE Print,
  232. PNOTIFY pNotify
  233. );
  234. BOOL
  235. DbgDumpChangeInfo(
  236. HANDLE hCurrentProcess,
  237. PNTSD_OUTPUT_ROUTINE Print,
  238. PCHANGEINFO pChangeInfo
  239. );
  240. BOOL
  241. DbgDumpStructure(
  242. HANDLE hCurrentProcess,
  243. PNTSD_OUTPUT_ROUTINE Print,
  244. UINT_PTR pData
  245. );
  246. BOOL
  247. DbgDumpIniSpooler(
  248. HANDLE hCurrentProcess,
  249. PNTSD_OUTPUT_ROUTINE Print,
  250. PINISPOOLER pIniSpooler
  251. );
  252. BOOL
  253. DbgDumpLL(
  254. HANDLE hCurrentProcess,
  255. PNTSD_OUTPUT_ROUTINE Print,
  256. UINT_PTR pAddress,
  257. BOOL bCountOn,
  258. DWORD dwCount,
  259. PVOID pNextAddress
  260. );
  261. BOOL
  262. DbgDumpPI2(
  263. HANDLE hCurrentProcess,
  264. PNTSD_OUTPUT_ROUTINE Print,
  265. UINT_PTR lpAddress,
  266. DWORD dwCount
  267. );
  268. BOOL
  269. DbgDumpPI0(
  270. HANDLE hCurrentProcess,
  271. PNTSD_OUTPUT_ROUTINE Print,
  272. UINT_PTR lpAddress,
  273. DWORD dwCount
  274. );
  275. BOOL
  276. DbgDumpFI1(
  277. HANDLE hCurrentProcess,
  278. PNTSD_OUTPUT_ROUTINE Print,
  279. UINT_PTR lpAddress,
  280. DWORD dwCount
  281. );
  282. BOOL
  283. DbgDumpPDEF(
  284. HANDLE hCurrentProcess,
  285. PNTSD_OUTPUT_ROUTINE Print,
  286. UINT_PTR lpAddress,
  287. DWORD dwCount
  288. );
  289. BOOL
  290. ReadProcessString(
  291. IN HANDLE hProcess,
  292. IN LPCVOID lpBaseAddress,
  293. OUT LPVOID lpBuffer,
  294. IN SIZE_T nSize,
  295. OUT SIZE_T *lpNumberOfBytesRead
  296. );
  297. BOOL
  298. QuerySystemInformation(
  299. VOID
  300. );