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.

371 lines
6.2 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. size_t cchString
  204. );
  205. DWORD
  206. EvalValue(
  207. LPSTR *pptstr,
  208. PNTSD_GET_EXPRESSION EvalExpression,
  209. PNTSD_OUTPUT_ROUTINE Print
  210. );
  211. BOOL
  212. DbgDumpIniSpooler(
  213. HANDLE hCurrentProcess,
  214. PNTSD_OUTPUT_ROUTINE Print,
  215. PINISPOOLER pIniSpooler
  216. );
  217. BOOL
  218. DbgDumpPrintHandle(
  219. HANDLE hCurrentProcess,
  220. PNTSD_OUTPUT_ROUTINE Print,
  221. PPRINTHANDLE pPrintHandle
  222. );
  223. BOOL
  224. DbgDumpChange(
  225. HANDLE hCurrentProcess,
  226. PNTSD_OUTPUT_ROUTINE Print,
  227. PCHANGE pChange
  228. );
  229. BOOL
  230. DbgDumpNotify(
  231. HANDLE hCurrentProcess,
  232. PNTSD_OUTPUT_ROUTINE Print,
  233. PNOTIFY pNotify
  234. );
  235. BOOL
  236. DbgDumpChangeInfo(
  237. HANDLE hCurrentProcess,
  238. PNTSD_OUTPUT_ROUTINE Print,
  239. PCHANGEINFO pChangeInfo
  240. );
  241. BOOL
  242. DbgDumpStructure(
  243. HANDLE hCurrentProcess,
  244. PNTSD_OUTPUT_ROUTINE Print,
  245. UINT_PTR pData
  246. );
  247. BOOL
  248. DbgDumpIniSpooler(
  249. HANDLE hCurrentProcess,
  250. PNTSD_OUTPUT_ROUTINE Print,
  251. PINISPOOLER pIniSpooler
  252. );
  253. BOOL
  254. DbgDumpLL(
  255. HANDLE hCurrentProcess,
  256. PNTSD_OUTPUT_ROUTINE Print,
  257. UINT_PTR pAddress,
  258. BOOL bCountOn,
  259. DWORD dwCount,
  260. PVOID pNextAddress
  261. );
  262. BOOL
  263. DbgDumpPI2(
  264. HANDLE hCurrentProcess,
  265. PNTSD_OUTPUT_ROUTINE Print,
  266. UINT_PTR lpAddress,
  267. DWORD dwCount
  268. );
  269. BOOL
  270. DbgDumpPI0(
  271. HANDLE hCurrentProcess,
  272. PNTSD_OUTPUT_ROUTINE Print,
  273. UINT_PTR lpAddress,
  274. DWORD dwCount
  275. );
  276. BOOL
  277. DbgDumpFI1(
  278. HANDLE hCurrentProcess,
  279. PNTSD_OUTPUT_ROUTINE Print,
  280. UINT_PTR lpAddress,
  281. DWORD dwCount
  282. );
  283. BOOL
  284. DbgDumpPDEF(
  285. HANDLE hCurrentProcess,
  286. PNTSD_OUTPUT_ROUTINE Print,
  287. UINT_PTR lpAddress,
  288. DWORD dwCount
  289. );
  290. BOOL
  291. ReadProcessString(
  292. IN HANDLE hProcess,
  293. IN LPCVOID lpBaseAddress,
  294. OUT LPVOID lpBuffer,
  295. IN SIZE_T nSize,
  296. OUT SIZE_T *lpNumberOfBytesRead
  297. );
  298. BOOL
  299. QuerySystemInformation(
  300. VOID
  301. );