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.

255 lines
4.4 KiB

  1. #include "precomp.h"
  2. #pragma hdrstop
  3. VOID
  4. DumpMdlChain
  5. (
  6. ULONG _objAddr,
  7. VERBOSITY Verbosity
  8. );
  9. DECLARE_API( MDLChain )
  10. {
  11. ULONG addressToDump = 0;
  12. ULONG result;
  13. if ( *args ) {
  14. sscanf(args, "%lx", &addressToDump);
  15. }
  16. DumpMdlChain( addressToDump, VERBOSITY_NORMAL );
  17. return;
  18. }
  19. #ifdef _obj
  20. # undef _obj
  21. # undef _objAddr
  22. # undef _objType
  23. #endif
  24. #define _obj Mdl
  25. #define _objAddr MdlToDump
  26. #define _objType MDL
  27. VOID
  28. DumpMdlChain
  29. (
  30. ULONG _objAddr,
  31. VERBOSITY Verbosity
  32. )
  33. {
  34. _objType _obj;
  35. ULONG result;
  36. if ( !ReadMemory( _objAddr,
  37. &_obj,
  38. sizeof( _obj ),
  39. &result ))
  40. {
  41. dprintf("%08lx: Could not read MDL structure\n", _objAddr );
  42. return;
  43. }
  44. PrintStartStruct();
  45. PrintPtr( Next );
  46. PrintUShort( Size );
  47. PrintXUShort( MdlFlags );
  48. PrintPtr( Process );
  49. PrintPtr( MappedSystemVa );
  50. PrintPtr( StartVa );
  51. PrintULong( ByteCount );
  52. PrintULong( ByteOffset );
  53. return;
  54. }
  55. VOID
  56. DumpCTELock
  57. (
  58. ULONG_PTR LockToDump,
  59. VERBOSITY Verbosity
  60. )
  61. {
  62. CTELock Lock;
  63. CTELock *pLock;
  64. ULONG result;
  65. pLock = ( CTELock * )LockToDump;
  66. if ( !ReadMemory( LockToDump,
  67. &Lock,
  68. sizeof( Lock ),
  69. &result ))
  70. {
  71. dprintf("%08lx: Could not read CTELock structure\n", LockToDump );
  72. return;
  73. }
  74. dprintf( "{ Lock = %d }", Lock );
  75. return;
  76. }
  77. #ifdef _obj
  78. # undef _obj
  79. # undef _objAddr
  80. # undef _objType
  81. #endif
  82. #define _obj Timer
  83. #define _objAddr pItem
  84. #define _objType CTETimer
  85. VOID
  86. DumpCTETimer
  87. (
  88. ULONG_PTR TimerToDump,
  89. VERBOSITY Verbosity
  90. )
  91. {
  92. CTETimer Timer;
  93. CTETimer *prTimer;
  94. ULONG result;
  95. prTimer = ( CTETimer * )TimerToDump;
  96. if ( !ReadMemory( TimerToDump,
  97. &Timer,
  98. sizeof( Timer ),
  99. &result ))
  100. {
  101. dprintf("%08lx: Could not read CTETimer structure\n", TimerToDump );
  102. return;
  103. }
  104. PrintStart;
  105. PrintULong( t_running );
  106. PrintLock( t_lock );
  107. PrintSymbolPtr( t_handler );
  108. PrintXULong( t_arg );
  109. // DPC
  110. // KTIMER
  111. PrintEnd;
  112. return;
  113. }
  114. #ifdef _obj
  115. # undef _obj
  116. # undef _objAddr
  117. # undef _objType
  118. #endif
  119. #define _obj Event
  120. #define _objAddr pItem
  121. #define _objType CTEEvent
  122. VOID
  123. DumpCTEEvent
  124. (
  125. ULONG_PTR _objAddr,
  126. VERBOSITY Verbosity
  127. )
  128. {
  129. _objType _obj;
  130. ULONG result;
  131. if ( !ReadMemory( _objAddr,
  132. &_obj,
  133. sizeof( _obj ),
  134. &result ))
  135. {
  136. dprintf("%08lx: Could not read CTEEvent structure\n", _objAddr );
  137. return;
  138. }
  139. PrintStart;
  140. PrintULong( ce_scheduled );
  141. PrintLock( ce_lock );
  142. PrintSymbolPtr( ce_handler );
  143. PrintXULong( ce_arg );
  144. PrintWorkQueueItem( ce_workitem );
  145. PrintEnd;
  146. return;
  147. }
  148. #ifdef _obj
  149. # undef _obj
  150. # undef _objAddr
  151. # undef _objType
  152. #endif
  153. #define _obj KEvent
  154. #define _objAddr pItem
  155. #define _objType KEVENT
  156. VOID
  157. DumpKEvent
  158. (
  159. ULONG_PTR _objAddr,
  160. VERBOSITY Verbosity
  161. )
  162. {
  163. _objType _obj;
  164. ULONG result;
  165. if ( !ReadMemory( _objAddr,
  166. &_obj,
  167. sizeof( _obj ),
  168. &result ))
  169. {
  170. dprintf("%08lx: Could not read KEvent structure\n", _objAddr );
  171. return;
  172. }
  173. PrintStart;
  174. PrintUChar( Header.Type );
  175. PrintUChar( Header.Absolute );
  176. PrintUChar( Header.Size );
  177. PrintUChar( Header.Inserted );
  178. PrintXULong( Header.SignalState );
  179. PrintLL( Header.WaitListHead );
  180. PrintEnd;
  181. return;
  182. }
  183. #ifdef _obj
  184. # undef _obj
  185. # undef _objAddr
  186. # undef _objType
  187. #endif
  188. #define _obj QItem
  189. #define _objAddr prQItem
  190. #define _objType WORK_QUEUE_ITEM
  191. VOID
  192. DumpWorkQueueItem
  193. (
  194. ULONG_PTR ItemToDump,
  195. VERBOSITY Verbosity
  196. )
  197. {
  198. _objType _obj;
  199. _objType *_objAddr;
  200. ULONG result;
  201. _objAddr = ( _objType * )ItemToDump;
  202. if ( !ReadMemory( ItemToDump,
  203. &_obj,
  204. sizeof( _obj ),
  205. &result ))
  206. {
  207. dprintf( "%08lx: Could not read %s structure\n",
  208. ItemToDump,
  209. "WORK_QUEUE_ITEM" );
  210. return;
  211. }
  212. PrintStart;
  213. PrintLL( List );
  214. PrintSymbolPtr( WorkerRoutine );
  215. PrintXULong( Parameter );
  216. PrintEnd;
  217. return;
  218. }