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.

235 lines
4.3 KiB

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