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.

874 lines
30 KiB

  1. /*++
  2. Copyright (c) 1990 Microsoft Corporation
  3. Module Name:
  4. rdpdrkd.c
  5. Abstract:
  6. Redirector Kernel Debugger extension
  7. Author:
  8. Balan Sethu Raman (SethuR) 11-May-1994
  9. Revision History:
  10. 11-Nov-1994 SethuR Created
  11. --*/
  12. #define KDEXT_32BIT
  13. #include "rx.h" // NT network file system driver include file
  14. #include "ntddnfs2.h" // new stuff device driver definitions
  15. #include <pchannel.h>
  16. #include <tschannl.h>
  17. #include <rdpdr.h>
  18. #include "rdpdrp.h"
  19. #include "namespc.h"
  20. #include "strcnv.h"
  21. #include "dbg.h"
  22. #include "topobj.h"
  23. #include "smartptr.h"
  24. #include "kernutil.h"
  25. #include "isession.h"
  26. #include "iexchnge.h"
  27. #include "channel.h"
  28. #include "device.h"
  29. #include "prnport.h"
  30. #include "serport.h"
  31. #include "parport.h"
  32. #include "devmgr.h"
  33. #include "exchnge.h"
  34. #include "session.h"
  35. #include "sessmgr.h"
  36. #include "rdpdyn.h"
  37. #include "rdpevlst.h"
  38. #include "rdpdrpnp.h"
  39. #include "rdpdrprt.h"
  40. #include "trc.h"
  41. #include <string.h>
  42. #include <stdio.h>
  43. #include <kdextlib.h>
  44. #include <rdpdrkd.h>
  45. /*
  46. * RDPDR global variables.
  47. *
  48. */
  49. LPSTR GlobalBool[] = {
  50. 0};
  51. LPSTR GlobalShort[] = {0};
  52. LPSTR GlobalLong[] = {
  53. 0};
  54. LPSTR GlobalPtrs[] = {
  55. "rdpdr!RxExpCXR",
  56. "rdpdr!RxExpEXR",
  57. "rdpdr!RxExpAddr",
  58. "rdpdr!RxExpCode",
  59. "rdpdr!RxActiveContexts",
  60. "rdpdr!RxNetNameTable",
  61. "rdpdr!RxProcessorArchitecture",
  62. "rdpdr!RxBuildNumber",
  63. "rdpdr!RxPrivateBuild",
  64. "rdpdr!ClientList",
  65. 0};
  66. /*
  67. * IRP_CONTEXT debugging.
  68. *
  69. */
  70. FIELD_DESCRIPTOR RxContextFields[] =
  71. {
  72. FIELD3(FieldTypeUShort,RX_CONTEXT,NodeTypeCode),
  73. FIELD3(FieldTypeShort,RX_CONTEXT,NodeByteSize),
  74. FIELD3(FieldTypeULong,RX_CONTEXT,ReferenceCount),
  75. FIELD3(FieldTypeULong,RX_CONTEXT,SerialNumber),
  76. FIELD3(FieldTypeStruct,RX_CONTEXT,WorkQueueItem),
  77. FIELD3(FieldTypePointer,RX_CONTEXT,CurrentIrp),
  78. FIELD3(FieldTypePointer,RX_CONTEXT,CurrentIrpSp),
  79. FIELD3(FieldTypePointer,RX_CONTEXT,pFcb),
  80. FIELD3(FieldTypePointer,RX_CONTEXT,pFobx),
  81. //FIELD3(FieldTypePointer,RX_CONTEXT,pRelevantSrvOpen),
  82. FIELD3(FieldTypePointer,RX_CONTEXT,LastExecutionThread),
  83. #ifdef RDBSS_TRACKER
  84. FIELD3(FieldTypePointer,RX_CONTEXT,AcquireReleaseFcbTrackerX),
  85. #endif
  86. FIELD3(FieldTypePointer,RX_CONTEXT,MRxContext[2]),
  87. FIELD3(FieldTypeSymbol,RX_CONTEXT,ResumeRoutine),
  88. FIELD3(FieldTypePointer,RX_CONTEXT,RealDevice),
  89. FIELD3(FieldTypeULongFlags,RX_CONTEXT,Flags),
  90. FIELD3(FieldTypeChar,RX_CONTEXT,MajorFunction),
  91. FIELD3(FieldTypeChar,RX_CONTEXT,MinorFunction),
  92. FIELD3(FieldTypeULong,RX_CONTEXT,StoredStatus),
  93. FIELD3(FieldTypeStruct,RX_CONTEXT,SyncEvent),
  94. FIELD3(FieldTypeStruct,RX_CONTEXT,RxContextSerializationQLinks),
  95. FIELD3(FieldTypeStruct,RX_CONTEXT,Create),
  96. FIELD3(FieldTypeStruct,RX_CONTEXT,LowIoContext),
  97. FIELD3(FieldTypePointer,RX_CONTEXT,Create.NetNamePrefixEntry),
  98. FIELD3(FieldTypePointer,RX_CONTEXT,Create.pSrvCall),
  99. FIELD3(FieldTypePointer,RX_CONTEXT,Create.pNetRoot),
  100. FIELD3(FieldTypePointer,RX_CONTEXT,Create.pVNetRoot),
  101. //FIELD3(FieldTypePointer,RX_CONTEXT,Create.pSrvOpen),
  102. FIELDLAST
  103. };
  104. /*
  105. * SRV_CALL debugging.
  106. *
  107. */
  108. //CODE.IMPROVEMENT we should have a fieldtype for prefixentry that
  109. // will print out the names
  110. FIELD_DESCRIPTOR SrvCallFields[] =
  111. {
  112. FIELD3(FieldTypeUShort,SRV_CALL,NodeTypeCode),
  113. FIELD3(FieldTypeShort,SRV_CALL,NodeByteSize),
  114. FIELD3(FieldTypeStruct,SRV_CALL,PrefixEntry),
  115. FIELD3(FieldTypeUnicodeString,SRV_CALL,PrefixEntry.Prefix),
  116. FIELD3(FieldTypePointer,SRV_CALL,Context),
  117. FIELD3(FieldTypePointer,SRV_CALL,Context2),
  118. FIELD3(FieldTypeULong,SRV_CALL,Flags),
  119. FIELDLAST
  120. };
  121. /*
  122. * NET_ROOT debugging.
  123. *
  124. */
  125. FIELD_DESCRIPTOR NetRootFields[] =
  126. {
  127. FIELD3(FieldTypeUShort,NET_ROOT,NodeTypeCode),
  128. FIELD3(FieldTypeShort,NET_ROOT,NodeByteSize),
  129. FIELD3(FieldTypeULong,NET_ROOT,NodeReferenceCount),
  130. FIELD3(FieldTypeStruct,NET_ROOT,PrefixEntry),
  131. FIELD3(FieldTypeUnicodeString,NET_ROOT,PrefixEntry.Prefix),
  132. FIELD3(FieldTypeStruct,NET_ROOT,FcbTable),
  133. //FIELD3(FieldTypePointer,NET_ROOT,Dispatch),
  134. FIELD3(FieldTypePointer,NET_ROOT,Context),
  135. FIELD3(FieldTypePointer,NET_ROOT,Context2),
  136. FIELD3(FieldTypePointer,NET_ROOT,pSrvCall),
  137. FIELD3(FieldTypeULong,NET_ROOT,Flags),
  138. FIELDLAST
  139. };
  140. /*
  141. * V_NET_ROOT debugging.
  142. *
  143. */
  144. FIELD_DESCRIPTOR VNetRootFields[] =
  145. {
  146. FIELD3(FieldTypeUShort,V_NET_ROOT,NodeTypeCode),
  147. FIELD3(FieldTypeShort,V_NET_ROOT,NodeByteSize),
  148. FIELD3(FieldTypeULong,V_NET_ROOT,NodeReferenceCount),
  149. FIELD3(FieldTypeStruct,V_NET_ROOT,PrefixEntry),
  150. FIELD3(FieldTypeUnicodeString,V_NET_ROOT,PrefixEntry.Prefix),
  151. FIELD3(FieldTypeUnicodeString,V_NET_ROOT,NamePrefix),
  152. FIELD3(FieldTypePointer,V_NET_ROOT,Context),
  153. FIELD3(FieldTypePointer,V_NET_ROOT,Context2),
  154. FIELD3(FieldTypePointer,V_NET_ROOT,pNetRoot),
  155. FIELDLAST
  156. };
  157. /*
  158. * FCB debugging.
  159. *
  160. */
  161. FIELD_DESCRIPTOR FcbFields[] =
  162. {
  163. FIELD3(FieldTypeUShort,FCB,Header.NodeTypeCode),
  164. FIELD3(FieldTypeShort,FCB,Header.NodeByteSize),
  165. FIELD3(FieldTypeULong,FCB,NodeReferenceCount),
  166. FIELD3(FieldTypeULong,FCB,FcbState),
  167. FIELD3(FieldTypeULong,FCB,OpenCount),
  168. FIELD3(FieldTypeULong,FCB,UncleanCount),
  169. FIELD3(FieldTypePointer,FCB,Header.Resource),
  170. FIELD3(FieldTypePointer,FCB,Header.PagingIoResource),
  171. FIELD3(FieldTypeStruct,FCB,FcbTableEntry),
  172. FIELD3(FieldTypeUnicodeString,FCB,PrivateAlreadyPrefixedName),
  173. FIELD3(FieldTypePointer,FCB,VNetRoot),
  174. FIELD3(FieldTypePointer,FCB,pNetRoot),
  175. FIELD3(FieldTypePointer,FCB,Context),
  176. FIELD3(FieldTypePointer,FCB,Context2),
  177. FIELDLAST
  178. };
  179. /*
  180. * SRV_OPEN debugging.
  181. *
  182. */
  183. FIELD_DESCRIPTOR SrvOpenFields[] =
  184. {
  185. FIELD3(FieldTypeShort,SRV_OPEN,NodeTypeCode),
  186. FIELD3(FieldTypeShort,SRV_OPEN,NodeByteSize),
  187. FIELD3(FieldTypeULong,SRV_OPEN,NodeReferenceCount),
  188. FIELD3(FieldTypePointer,SRV_OPEN,pFcb),
  189. FIELD3(FieldTypeULong,SRV_OPEN,Flags),
  190. FIELDLAST
  191. };
  192. /*
  193. * FOBX debugging.
  194. *
  195. */
  196. FIELD_DESCRIPTOR FobxFields[] =
  197. {
  198. FIELD3(FieldTypeShort,FOBX,NodeTypeCode),
  199. FIELD3(FieldTypeShort,FOBX,NodeByteSize),
  200. FIELD3(FieldTypeULong,FOBX,NodeReferenceCount),
  201. FIELD3(FieldTypePointer,FOBX,pSrvOpen),
  202. FIELDLAST
  203. };
  204. //this enum is used in the definition of the structures that can be dumped....the order here
  205. //is not important, only that there is a definition for each dumpee structure.....
  206. typedef enum _STRUCTURE_IDS {
  207. StrEnum_RX_CONTEXT = 1,
  208. StrEnum_FCB,
  209. StrEnum_SRV_OPEN,
  210. StrEnum_FOBX,
  211. StrEnum_SRV_CALL,
  212. StrEnum_NET_ROOT,
  213. StrEnum_V_NET_ROOT,
  214. StrEnum_CHANNELAPCCONTEXT,
  215. StrEnum_TopObj,
  216. StrEnum_DrExchangeManager,
  217. StrEnum_DrExchange,
  218. StrEnum_DrIoContext,
  219. StrEnum_DrDeviceManager,
  220. StrEnum_DoubleList,
  221. StrEnum_KernelResource,
  222. StrEnum_VirtualChannel,
  223. StrEnum_DrDevice,
  224. StrEnum_DrPrinterPort,
  225. StrEnum_DrParallelPort,
  226. StrEnum_DrSerialPort,
  227. StrEnum_DrSessionManager,
  228. StrEnum_DrSession,
  229. StrEnum_ReferenceTraceRecord,
  230. StrEnum_SESSIONLISTNODE,
  231. StrEnum_EVENTLISTNODE,
  232. StrEnum_RDPDR_IOCOMPLETION_PACKET,
  233. StrEnum_RDPDR_IOREQUEST_PACKET,
  234. StrEnum_RDPDR_UPDATE_DEVICEINFO_PACKET,
  235. StrEnum_RDPDR_DEVICE_REPLY_PACKET,
  236. StrEnum_RDPDR_DEVICELIST_ANNOUNCE_PACKET,
  237. StrEnum_RDPDR_DEVICE_ANNOUNCE,
  238. StrEnum_RDPDR_CLIENT_NAME_PACKET,
  239. StrEnum_RDPDR_CLIENT_CONFIRM_PACKET,
  240. StrEnum_RDPDR_SERVER_ANNOUNCE_PACKET,
  241. StrEnum_RDPDR_HEADER,
  242. StrEnum_TRC_CONFIG,
  243. StrEnum_TRC_PREFIX_DATA,
  244. StrEnum_last
  245. };
  246. // 1) All ENUM_VALUE_DESCRIPTOR definitions are named EnumValueDescrsOf_ENUMTYPENAME, where
  247. // ENUMTYPENAME defines the corresponding enumerated type.
  248. //
  249. ENUM_VALUE_DESCRIPTOR EnumValueDescrsOf_DEVICE_STATUS [] =
  250. {
  251. {0, "dsAvailable"},
  252. {1, "dsDisabled"},
  253. {0, NULL}
  254. };
  255. ENUM_VALUE_DESCRIPTOR EnumValueDescrsOf_DEVICE_TYPE [] =
  256. {
  257. {1, "RDPDR_DTYP_SERIAL"},
  258. {2, "RDPDR_DTYP_PARALLEL"},
  259. {3, "RDPDR_DTYP_FILE"},
  260. {4, "RDPDR_DTYP_PRINT"},
  261. {0, NULL}
  262. };
  263. ENUM_VALUE_DESCRIPTOR EnumValueDescrsOf_CLIENT_STATUS [] =
  264. {
  265. {0, "csDisconnected"},
  266. {1, "csPendingClientConfirm"},
  267. {2, "csPendingClientReconfirm"},
  268. {3, "csConnected"},
  269. {4, "csExpired"},
  270. {0, NULL}
  271. };
  272. ENUM_VALUE_DESCRIPTOR EnumValueDescrsOf_ExchangeManagerState [] =
  273. {
  274. {0, "demsStopped"},
  275. {1, "demsStarted"},
  276. {0, NULL}
  277. };
  278. #if DBG
  279. #define TOPOBJFIELDS(ObjTyp) \
  280. FIELD3(FieldTypeBoolean, ObjTyp, _IsValid), \
  281. FIELD3(FieldTypeULong, ObjTyp, _ObjectType), \
  282. FIELD3(FieldTypeBoolean, ObjTyp, _ForceTrace), \
  283. FIELD3(FieldTypePointer, ObjTyp, _ClassName), \
  284. FIELD3(FieldTypeULong, ObjTyp, _magicNo)
  285. #else // DBG
  286. #define TOPOBJFIELDS(ObjTyp) \
  287. FIELD3(FieldTypeBoolean, ObjTyp, _IsValid), \
  288. FIELD3(FieldTypeULong, ObjTyp, _ObjectType)
  289. #endif // DBG
  290. FIELD_DESCRIPTOR TopObjFields[] =
  291. {
  292. TOPOBJFIELDS(TopObj),
  293. FIELDLAST
  294. };
  295. FIELD_DESCRIPTOR DrExchangeManagerFields[] =
  296. {
  297. TOPOBJFIELDS(DrExchangeManager),
  298. FIELD3(FieldTypePointer, DrExchangeManager, _RxMidAtlas),
  299. FIELD4(FieldTypeEnum, DrExchangeManager, _demsState, EnumValueDescrsOf_ExchangeManagerState),
  300. FIELD3(FieldTypePointer, DrExchangeManager, _Session),
  301. FIELDLAST
  302. };
  303. FIELD_DESCRIPTOR DrExchangeFields[] =
  304. {
  305. TOPOBJFIELDS(DrExchange),
  306. FIELD3(FieldTypeULong, DrExchange, _crefs),
  307. FIELD3(FieldTypePointer, DrExchange, _ExchangeManager),
  308. FIELD3(FieldTypePointer, DrExchange, _Context),
  309. FIELD3(FieldTypePointer, DrExchange, _ExchangeUser),
  310. FIELD3(FieldTypeUShort, DrExchange, _Mid),
  311. FIELDLAST
  312. };
  313. FIELD_DESCRIPTOR DrIoContextFields[] =
  314. {
  315. TOPOBJFIELDS(DrIoContext),
  316. FIELD3(FieldTypePointer, DrIoContext, _Device),
  317. FIELD3(FieldTypeBool, DrIoContext, _Busy),
  318. FIELD3(FieldTypeBool, DrIoContext, _Cancelled),
  319. FIELD3(FieldTypeBool, DrIoContext, _Disconnected),
  320. FIELD3(FieldTypePointer, DrIoContext, _RxContext),
  321. FIELD3(FieldTypeChar, DrIoContext, _MajorFunction),
  322. FIELD3(FieldTypeChar, DrIoContext, _MinorFunction),
  323. FIELDLAST
  324. };
  325. FIELD_DESCRIPTOR DrDeviceManagerFields[] =
  326. {
  327. TOPOBJFIELDS(DrDeviceManager),
  328. FIELD3(FieldTypeStruct, DrDeviceManager, _DeviceList),
  329. FIELD3(FieldTypePointer, DrDeviceManager, _Session),
  330. FIELDLAST
  331. };
  332. FIELD_DESCRIPTOR DoubleListFields[] =
  333. {
  334. TOPOBJFIELDS(DoubleList),
  335. FIELD3(FieldTypeStruct, DoubleList, _List),
  336. FIELDLAST
  337. };
  338. FIELD_DESCRIPTOR KernelResourceFields[] =
  339. {
  340. TOPOBJFIELDS(KernelResource),
  341. FIELD3(FieldTypeStruct, KernelResource, _Resource),
  342. FIELDLAST
  343. };
  344. FIELD_DESCRIPTOR VirtualChannelFields[] =
  345. {
  346. TOPOBJFIELDS(VirtualChannel),
  347. FIELD3(FieldTypeULong, VirtualChannel, _crefs),
  348. FIELD3(FieldTypePointer, VirtualChannel, _Channel),
  349. FIELD3(FieldTypeStruct, VirtualChannel, _HandleLock),
  350. FIELD3(FieldTypePointer, VirtualChannel, _DeletionEvent),
  351. FIELDLAST
  352. };
  353. #define DRDEVICEFIELDS(ObjType) \
  354. TOPOBJFIELDS(ObjType), \
  355. FIELD3(FieldTypeULong, ObjType, _crefs), \
  356. FIELD3(FieldTypeStruct, ObjType, _Session), \
  357. FIELD3(FieldTypeULong, ObjType, _DeviceId), \
  358. FIELD4(FieldTypeEnum, ObjType, _DeviceType, EnumValueDescrsOf_DEVICE_TYPE), \
  359. FIELD3(FieldTypeStruct, ObjType, _PreferredDosName), \
  360. FIELD4(FieldTypeEnum, ObjType, _DeviceStatus, EnumValueDescrsOf_DEVICE_STATUS)
  361. FIELD_DESCRIPTOR DrDeviceFields[] =
  362. {
  363. DRDEVICEFIELDS(DrDevice),
  364. FIELDLAST
  365. };
  366. #define DRPRINTERPORTFIELDS(ObjType) \
  367. DRDEVICEFIELDS(ObjType), \
  368. FIELD3(FieldTypeULong, ObjType, _PortNumber), \
  369. FIELD3(FieldTypeStruct, ObjType, _SymbolicLinkName), \
  370. FIELD3(FieldTypeBool, ObjType, _IsOpen)
  371. FIELD_DESCRIPTOR DrPrinterPortFields[] =
  372. {
  373. DRPRINTERPORTFIELDS(DrPrinterPort),
  374. FIELDLAST
  375. };
  376. FIELD_DESCRIPTOR DrParallelPortFields[] =
  377. {
  378. DRPRINTERPORTFIELDS(DrParallelPort),
  379. FIELDLAST
  380. };
  381. FIELD_DESCRIPTOR DrSerialPortFields[] =
  382. {
  383. DRPRINTERPORTFIELDS(DrSerialPort),
  384. FIELDLAST
  385. };
  386. FIELD_DESCRIPTOR DrSessionManagerFields[] =
  387. {
  388. TOPOBJFIELDS(DrSessionManager),
  389. FIELD3(FieldTypeStruct, DrSessionManager, _SessionList),
  390. FIELDLAST
  391. };
  392. FIELD_DESCRIPTOR DrSessionFields[] =
  393. {
  394. TOPOBJFIELDS(DrSession),
  395. FIELD3(FieldTypeULong, DrSession, _crefs),
  396. FIELD3(FieldTypeStruct, DrSession, _Channel),
  397. FIELD3(FieldTypeStruct, DrSession, _PacketReceivers),
  398. FIELD3(FieldTypeStruct, DrSession, _ConnectNotificatingLock),
  399. FIELD3(FieldTypeStruct, DrSession, _ChannelLock),
  400. FIELD4(FieldTypeEnum, DrSession, _SessionState, EnumValueDescrsOf_CLIENT_STATUS),
  401. FIELD3(FieldTypePointer, DrSession, _ChannelBuffer),
  402. FIELD3(FieldTypeULong, DrSession, _ChannelBufferSize),
  403. FIELD3(FieldTypeStruct, DrSession, _ChannelDeletionEvent),
  404. FIELD3(FieldTypeULong, DrSession, _ReadStatus.Status),
  405. FIELD3(FieldTypeULong, DrSession, _ReadStatus.Information),
  406. FIELD3(FieldTypeULong, DrSession, _ClientId),
  407. FIELD3(FieldTypeStruct, DrSession, _ExchangeManager),
  408. FIELD3(FieldTypeULong, DrSession, _PartialPacketData),
  409. FIELD3(FieldTypeStruct, DrSession, _ClientName),
  410. FIELD3(FieldTypeStruct, DrSession, _DeviceManager),
  411. FIELD3(FieldTypeULong, DrSession, _SessionId),
  412. FIELD3(FieldTypeUShort, DrSession, _ClientVersion.Major),
  413. FIELD3(FieldTypeUShort, DrSession, _ClientVersion.Major),
  414. FIELD3(FieldTypeLong, DrSession, _Initialized),
  415. FIELDLAST
  416. };
  417. typedef struct tagCHANNELAPCCONTEXT {
  418. SmartPtr<VirtualChannel> Channel;
  419. PIO_APC_ROUTINE ApcRoutine;
  420. PVOID ApcContext;
  421. } CHANNELAPCCONTEXT, *PCHANNELAPCCONTEXT;
  422. FIELD_DESCRIPTOR ChannelApcContextFields[] =
  423. {
  424. FIELD3(FieldTypeStruct, CHANNELAPCCONTEXT, Channel),
  425. FIELD3(FieldTypePointer, CHANNELAPCCONTEXT, ApcRoutine),
  426. FIELD3(FieldTypePointer, CHANNELAPCCONTEXT, ApcContext),
  427. FIELDLAST
  428. };
  429. #if DBG
  430. FIELD_DESCRIPTOR ReferenceTraceRecordFields[] =
  431. {
  432. FIELD3(FieldTypeSymbol, ReferenceTraceRecord, Stack[0]),
  433. FIELD3(FieldTypeSymbol, ReferenceTraceRecord, Stack[1]),
  434. FIELD3(FieldTypeSymbol, ReferenceTraceRecord, Stack[2]),
  435. FIELD3(FieldTypeSymbol, ReferenceTraceRecord, Stack[3]),
  436. FIELD3(FieldTypeSymbol, ReferenceTraceRecord, Stack[4]),
  437. FIELD3(FieldTypeSymbol, ReferenceTraceRecord, Stack[5]),
  438. FIELD3(FieldTypeSymbol, ReferenceTraceRecord, Stack[6]),
  439. FIELD3(FieldTypeSymbol, ReferenceTraceRecord, Stack[7]),
  440. FIELD3(FieldTypeSymbol, ReferenceTraceRecord, Stack[8]),
  441. FIELD3(FieldTypeSymbol, ReferenceTraceRecord, Stack[9]),
  442. FIELD3(FieldTypePointer, ReferenceTraceRecord, pRefCount),
  443. FIELD3(FieldTypePointer, ReferenceTraceRecord, ClassName),
  444. FIELD3(FieldTypeLong, ReferenceTraceRecord, refs),
  445. FIELDLAST
  446. };
  447. #endif
  448. FIELD_DESCRIPTOR SESSIONLISTNODEFields[] =
  449. {
  450. #if DBG
  451. FIELD3(FieldTypeULong, SESSIONLISTNODE, magicNo),
  452. #endif
  453. FIELD3(FieldTypeULong, SESSIONLISTNODE, sessionID),
  454. FIELD3(FieldTypeStruct, SESSIONLISTNODE, requestListHead),
  455. FIELD3(FieldTypeStruct, SESSIONLISTNODE, eventListHead),
  456. FIELD3(FieldTypeStruct, SESSIONLISTNODE, listEntry),
  457. FIELDLAST
  458. };
  459. FIELD_DESCRIPTOR EVENTLISTNODEFields[] =
  460. {
  461. #if DBG
  462. FIELD3(FieldTypeULong, EVENTLISTNODE, magicNo),
  463. #endif
  464. FIELD3(FieldTypePointer, EVENTLISTNODE, event),
  465. FIELD3(FieldTypeULong, EVENTLISTNODE, type),
  466. FIELD3(FieldTypeStruct, EVENTLISTNODE, listEntry),
  467. FIELDLAST
  468. };
  469. #define RDPDRPACKETCODE(Component, PacketId) \
  470. MAKELONG(Component, PacketId)
  471. ENUM_VALUE_DESCRIPTOR EnumValueDescrsOf_PACKET_CODE [] =
  472. {
  473. {RDPDRPACKETCODE(RDPDR_CTYP_CORE, DR_CORE_SERVER_ANNOUNCE), "RDPDR_SERVER_ANNOUNCE_PACKET@"},
  474. {RDPDRPACKETCODE(RDPDR_CTYP_CORE, DR_CORE_CLIENTID_CONFIRM), "DR_CORE_CLIENTID_CONFIRM_PACKET@"},
  475. {RDPDRPACKETCODE(RDPDR_CTYP_CORE, DR_CORE_CLIENT_NAME), "DR_CORE_CLIENT_NAME_PACKET@"},
  476. {RDPDRPACKETCODE(RDPDR_CTYP_CORE, DR_CORE_DEVICE_ANNOUNCE), "DR_CORE_DEVICE_ANNOUNCE@"},
  477. {RDPDRPACKETCODE(RDPDR_CTYP_CORE, DR_CORE_DEVICELIST_ANNOUNCE), "DR_CORE_DEVICELIST_ANNOUNCE_PACKET@"},
  478. {RDPDRPACKETCODE(RDPDR_CTYP_CORE, DR_CORE_DEVICELIST_REPLY), "DR_CORE_DEVICELIST_REPLY_PACKET@"},
  479. {RDPDRPACKETCODE(RDPDR_CTYP_CORE, DR_CORE_DEVICE_REPLY), "DR_CORE_DEVICE_REPLY_PACKET@"},
  480. {RDPDRPACKETCODE(RDPDR_CTYP_CORE, DR_CORE_DEVICE_IOREQUEST), "DR_CORE_DEVICE_IOREQUEST_PACKET@"},
  481. {RDPDRPACKETCODE(RDPDR_CTYP_CORE, DR_CORE_DEVICE_IOCOMPLETION), "DR_CORE_DEVICE_IOCOMPLETION_PACKET@"},
  482. {0, NULL}
  483. };
  484. FIELD_DESCRIPTOR RdpdrHeaderFields[] =
  485. {
  486. FIELD3(FieldTypeUShort, RDPDR_HEADER, Component),
  487. FIELD3(FieldTypeUShort, RDPDR_HEADER, PacketId),
  488. FIELD4(FieldTypeEnum, RDPDR_HEADER, Component, EnumValueDescrsOf_PACKET_CODE),
  489. FIELDLAST
  490. };
  491. FIELD_DESCRIPTOR RdpdrServerAnnounceFields[] =
  492. {
  493. FIELD3(FieldTypeUShort, RDPDR_HEADER, Component),
  494. FIELD3(FieldTypeUShort, RDPDR_HEADER, PacketId),
  495. FIELD4(FieldTypeEnum, RDPDR_HEADER, Component, EnumValueDescrsOf_PACKET_CODE),
  496. FIELD3(FieldTypeUShort, RDPDR_SERVER_ANNOUNCE_PACKET, VersionInfo.Major),
  497. FIELD3(FieldTypeUShort, RDPDR_SERVER_ANNOUNCE_PACKET, VersionInfo.Minor),
  498. FIELD3(FieldTypeULong, RDPDR_SERVER_ANNOUNCE_PACKET, ServerAnnounce.ClientId),
  499. FIELDLAST
  500. };
  501. FIELD_DESCRIPTOR RdpdrClientConfirmFields[] =
  502. {
  503. FIELD3(FieldTypeUShort, RDPDR_HEADER, Component),
  504. FIELD3(FieldTypeUShort, RDPDR_HEADER, PacketId),
  505. FIELD4(FieldTypeEnum, RDPDR_HEADER, Component, EnumValueDescrsOf_PACKET_CODE),
  506. FIELD3(FieldTypeUShort, RDPDR_CLIENT_CONFIRM_PACKET, VersionInfo.Major),
  507. FIELD3(FieldTypeUShort, RDPDR_CLIENT_CONFIRM_PACKET, VersionInfo.Minor),
  508. FIELD3(FieldTypeULong, RDPDR_CLIENT_CONFIRM_PACKET, ClientConfirm.ClientId),
  509. FIELDLAST
  510. };
  511. FIELD_DESCRIPTOR RdpdrClientNameFields[] =
  512. {
  513. FIELD3(FieldTypeUShort, RDPDR_HEADER, Component),
  514. FIELD3(FieldTypeUShort, RDPDR_HEADER, PacketId),
  515. FIELD4(FieldTypeEnum, RDPDR_HEADER, Component, EnumValueDescrsOf_PACKET_CODE),
  516. // FIELD3(FieldTypeULong, RDPDR_CLIENT_NAME_PACKET, (ULONG)Name.Unicode),
  517. FIELD3(FieldTypeULong, RDPDR_CLIENT_NAME_PACKET, Name.CodePage),
  518. FIELD3(FieldTypeULong, RDPDR_CLIENT_NAME_PACKET, Name.ComputerNameLen),
  519. FIELDLAST
  520. };
  521. FIELD_DESCRIPTOR RdpdrDeviceAnnounceFields[] =
  522. {
  523. FIELD3(FieldTypeULong, RDPDR_DEVICE_ANNOUNCE, DeviceType),
  524. FIELD3(FieldTypeULong, RDPDR_DEVICE_ANNOUNCE, DeviceId),
  525. FIELD3(FieldTypeStruct, RDPDR_DEVICE_ANNOUNCE, PreferredDosName),
  526. FIELD3(FieldTypeULong, RDPDR_DEVICE_ANNOUNCE, DeviceDataLength),
  527. FIELDLAST
  528. };
  529. FIELD_DESCRIPTOR RdpdrDeviceListAnnounceFields[] =
  530. {
  531. FIELD3(FieldTypeUShort, RDPDR_HEADER, Component),
  532. FIELD3(FieldTypeUShort, RDPDR_HEADER, PacketId),
  533. FIELD4(FieldTypeEnum, RDPDR_HEADER, Component, EnumValueDescrsOf_PACKET_CODE),
  534. FIELD3(FieldTypeULong, RDPDR_DEVICELIST_ANNOUNCE_PACKET, DeviceListAnnounce.DeviceCount),
  535. FIELD3(FieldTypeStruct, RDPDR_DEVICELIST_ANNOUNCE_PACKET, DeviceAnnounce),
  536. FIELDLAST
  537. };
  538. ENUM_VALUE_DESCRIPTOR EnumValueDescrsOf_DEVICE_REPLY_RESULT [] =
  539. {
  540. {0, "RDPDR_DEVICE_REPLY_SUCCESS"},
  541. {1, "RDPDR_DEVICE_REPLY_REJECTED"},
  542. {0, NULL}
  543. };
  544. FIELD_DESCRIPTOR RdpdrDeviceReplyFields[] =
  545. {
  546. FIELD3(FieldTypeUShort, RDPDR_HEADER, Component),
  547. FIELD3(FieldTypeUShort, RDPDR_HEADER, PacketId),
  548. FIELD4(FieldTypeEnum, RDPDR_HEADER, Component, EnumValueDescrsOf_PACKET_CODE),
  549. FIELD3(FieldTypeULong, RDPDR_DEVICE_REPLY_PACKET, DeviceReply.DeviceId),
  550. FIELD4(FieldTypeEnum, RDPDR_DEVICE_REPLY_PACKET, DeviceReply.ResultCode, EnumValueDescrsOf_DEVICE_REPLY_RESULT ),
  551. FIELDLAST
  552. };
  553. FIELD_DESCRIPTOR RdpdrUpdateDeviceInfoFields[] =
  554. {
  555. FIELD3(FieldTypeUShort, RDPDR_HEADER, Component),
  556. FIELD3(FieldTypeUShort, RDPDR_HEADER, PacketId),
  557. FIELD4(FieldTypeEnum, RDPDR_HEADER, Component, EnumValueDescrsOf_PACKET_CODE),
  558. FIELD3(FieldTypeULong, RDPDR_UPDATE_DEVICEINFO_PACKET, DeviceUpdate.DeviceId),
  559. FIELD3(FieldTypeULong, RDPDR_UPDATE_DEVICEINFO_PACKET, DeviceUpdate.DeviceDataLength),
  560. FIELDLAST
  561. };
  562. ENUM_VALUE_DESCRIPTOR EnumValueDescrsOf_MAJOR_FUNCTION [] =
  563. {
  564. {0x00, "IRP_MJ_CREATE"},
  565. {0x01, "IRP_MJ_CREATE_NAMED_PIPE"},
  566. {0x02, "IRP_MJ_CLOSE"},
  567. {0x03, "IRP_MJ_READ"},
  568. {0x04, "IRP_MJ_WRITE"},
  569. {0x05, "IRP_MJ_QUERY_INFORMATION"},
  570. {0x06, "IRP_MJ_SET_INFORMATION"},
  571. {0x07, "IRP_MJ_QUERY_EA"},
  572. {0x08, "IRP_MJ_SET_EA"},
  573. {0x09, "IRP_MJ_FLUSH_BUFFERS"},
  574. {0x0a, "IRP_MJ_QUERY_VOLUME_INFORMATION"},
  575. {0x0b, "IRP_MJ_SET_VOLUME_INFORMATION"},
  576. {0x0c, "IRP_MJ_DIRECTORY_CONTROL"},
  577. {0x0d, "IRP_MJ_FILE_SYSTEM_CONTROL"},
  578. {0x0e, "IRP_MJ_DEVICE_CONTROL"},
  579. {0x0f, "IRP_MJ_INTERNAL_DEVICE_CONTROL"},
  580. {0x10, "IRP_MJ_SHUTDOWN"},
  581. {0x11, "IRP_MJ_LOCK_CONTROL"},
  582. {0x12, "IRP_MJ_CLEANUP"},
  583. {0x13, "IRP_MJ_CREATE_MAILSLOT"},
  584. {0x14, "IRP_MJ_QUERY_SECURITY"},
  585. {0x15, "IRP_MJ_SET_SECURITY"},
  586. {0x16, "IRP_MJ_POWER"},
  587. {0x17, "IRP_MJ_SYSTEM_CONTROL"},
  588. {0x18, "IRP_MJ_DEVICE_CHANGE"},
  589. {0x19, "IRP_MJ_QUERY_QUOTA"},
  590. {0x1a, "IRP_MJ_SET_QUOTA"},
  591. {0x1b, "IRP_MJ_PNP"},
  592. {0x1b, "IRP_MJ_MAXIMUM_FUNCTION"},
  593. {0, NULL}
  594. };
  595. FIELD_DESCRIPTOR RdpdrIoRequestFields[] =
  596. {
  597. FIELD3(FieldTypeUShort, RDPDR_HEADER, Component),
  598. FIELD3(FieldTypeUShort, RDPDR_HEADER, PacketId),
  599. FIELD4(FieldTypeEnum, RDPDR_HEADER, Component, EnumValueDescrsOf_PACKET_CODE),
  600. FIELD3(FieldTypeULong, RDPDR_IOREQUEST_PACKET, IoRequest.DeviceId),
  601. FIELD3(FieldTypeULong, RDPDR_IOREQUEST_PACKET, IoRequest.FileId),
  602. FIELD3(FieldTypeULong, RDPDR_IOREQUEST_PACKET, IoRequest.CompletionId),
  603. FIELD4(FieldTypeEnum, RDPDR_IOREQUEST_PACKET, IoRequest.MajorFunction, EnumValueDescrsOf_MAJOR_FUNCTION),
  604. FIELD3(FieldTypeULong, RDPDR_IOREQUEST_PACKET, IoRequest.MinorFunction),
  605. FIELD3(FieldTypeULong, RDPDR_IOREQUEST_PACKET, IoRequest.Parameters.Create.DesiredAccess),
  606. FIELD3(FieldTypeULong, RDPDR_IOREQUEST_PACKET, IoRequest.Parameters.Create.AllocationSize.u.HighPart),
  607. FIELD3(FieldTypeULong, RDPDR_IOREQUEST_PACKET, IoRequest.Parameters.Create.AllocationSize.u.LowPart),
  608. FIELD3(FieldTypeULong, RDPDR_IOREQUEST_PACKET, IoRequest.Parameters.Create.FileAttributes),
  609. FIELD3(FieldTypeULong, RDPDR_IOREQUEST_PACKET, IoRequest.Parameters.Create.ShareAccess),
  610. FIELD3(FieldTypeULong, RDPDR_IOREQUEST_PACKET, IoRequest.Parameters.Create.Disposition),
  611. FIELD3(FieldTypeULong, RDPDR_IOREQUEST_PACKET, IoRequest.Parameters.Create.CreateOptions),
  612. FIELD3(FieldTypeULong, RDPDR_IOREQUEST_PACKET, IoRequest.Parameters.Create.PathLength),
  613. FIELD3(FieldTypeULong, RDPDR_IOREQUEST_PACKET, IoRequest.Parameters.Read.Length),
  614. FIELD3(FieldTypeULong, RDPDR_IOREQUEST_PACKET, IoRequest.Parameters.Write.Length),
  615. FIELD3(FieldTypeULong, RDPDR_IOREQUEST_PACKET, IoRequest.Parameters.DeviceIoControl.OutputBufferLength),
  616. FIELD3(FieldTypeULong, RDPDR_IOREQUEST_PACKET, IoRequest.Parameters.DeviceIoControl.InputBufferLength),
  617. FIELD3(FieldTypeULong, RDPDR_IOREQUEST_PACKET, IoRequest.Parameters.DeviceIoControl.IoControlCode),
  618. FIELDLAST
  619. };
  620. FIELD_DESCRIPTOR RdpdrIoCompletionFields[] =
  621. {
  622. FIELD3(FieldTypeUShort, RDPDR_HEADER, Component),
  623. FIELD3(FieldTypeUShort, RDPDR_HEADER, PacketId),
  624. FIELD4(FieldTypeEnum, RDPDR_HEADER, Component, EnumValueDescrsOf_PACKET_CODE),
  625. FIELD3(FieldTypeULong, RDPDR_IOCOMPLETION_PACKET, IoCompletion.DeviceId),
  626. FIELD3(FieldTypeULong, RDPDR_IOCOMPLETION_PACKET, IoCompletion.CompletionId),
  627. FIELD3(FieldTypeULong, RDPDR_IOCOMPLETION_PACKET, IoCompletion.IoStatus),
  628. FIELD3(FieldTypeULong, RDPDR_IOCOMPLETION_PACKET, IoCompletion.Parameters.Create.FileId),
  629. FIELD3(FieldTypeULong, RDPDR_IOCOMPLETION_PACKET, IoCompletion.Parameters.Read.Length),
  630. FIELD3(FieldTypeStruct, RDPDR_IOCOMPLETION_PACKET, IoCompletion.Parameters.Read.Buffer),
  631. FIELD3(FieldTypeULong, RDPDR_IOCOMPLETION_PACKET, IoCompletion.Parameters.Write.Length),
  632. FIELD3(FieldTypeULong, RDPDR_IOCOMPLETION_PACKET, IoCompletion.Parameters.DeviceIoControl.OutputBufferLength),
  633. FIELD3(FieldTypeStruct, RDPDR_IOCOMPLETION_PACKET, IoCompletion.Parameters.DeviceIoControl.OutputBuffer),
  634. FIELDLAST
  635. };
  636. #if DBG
  637. ENUM_VALUE_DESCRIPTOR EnumValueDescrsOf_TRACE_LEVEL [] =
  638. {
  639. {0, "TRC_LEVEL_DBG"},
  640. {1, "TRC_LEVEL_NRM"},
  641. {2, "TRC_LEVEL_ALT"},
  642. {3, "TRC_LEVEL_ERR"},
  643. {4, "TRC_LEVEL_ASSERT"},
  644. {5, "TRC_LEVEL_DIS"},
  645. {0, NULL}
  646. };
  647. FIELD_DESCRIPTOR TRC_CONFIGFields[] =
  648. {
  649. FIELD4(FieldTypeULong, TRC_CONFIG, TraceLevel, EnumValueDescrsOf_TRACE_LEVEL),
  650. FIELD3(FieldTypeULong, TRC_CONFIG, FunctionLength),
  651. FIELD3(FieldTypeULong, TRC_CONFIG, TraceDebugger),
  652. FIELD3(FieldTypeULong, TRC_CONFIG, TraceProfile),
  653. FIELD3(FieldTypeStruct, TRC_CONFIG, Prefix[0]),
  654. FIELD3(FieldTypeStruct, TRC_CONFIG, Prefix[1]),
  655. FIELDLAST
  656. };
  657. FIELD_DESCRIPTOR TRC_PREFIX_DATAFields[] =
  658. {
  659. FIELD3(FieldTypeStruct, TRC_PREFIX_DATA, name),
  660. FIELD3(FieldTypeULong, TRC_PREFIX_DATA, start),
  661. FIELD3(FieldTypeULong, TRC_PREFIX_DATA, end),
  662. FIELDLAST
  663. };
  664. #endif // DBG
  665. //
  666. // List of structs currently handled by the debugger extensions
  667. //
  668. STRUCT_DESCRIPTOR Structs[] =
  669. {
  670. STRUCT(RX_CONTEXT,RxContextFields,0xffff,RDBSS_NTC_RX_CONTEXT),
  671. STRUCT(FCB,FcbFields,0xeff0,RDBSS_STORAGE_NTC(0)),
  672. STRUCT(FCB,FcbFields,0xeff0,RDBSS_STORAGE_NTC(0xf0)),
  673. STRUCT(SRV_OPEN,SrvOpenFields,0xffff,RDBSS_NTC_SRVOPEN),
  674. STRUCT(FOBX,FobxFields,0xffff,RDBSS_NTC_FOBX),
  675. STRUCT(SRV_CALL,SrvCallFields,0xffff,RDBSS_NTC_SRVCALL),
  676. STRUCT(NET_ROOT,NetRootFields,0xffff,RDBSS_NTC_NETROOT),
  677. STRUCT(V_NET_ROOT,VNetRootFields,0xffff,RDBSS_NTC_V_NETROOT),
  678. STRUCT(CHANNELAPCCONTEXT,ChannelApcContextFields,0xffff,0),
  679. STRUCT(TopObj,TopObjFields,0xffff,0),
  680. STRUCT(DrExchangeManager,DrExchangeManagerFields,0xffff,0),
  681. STRUCT(DrExchange,DrExchangeFields,0xffff,0),
  682. STRUCT(DrIoContext,DrIoContextFields,0xffff,0),
  683. STRUCT(DrDeviceManager,DrDeviceManagerFields,0xffff,0),
  684. STRUCT(DoubleList,DoubleListFields,0xffff,0),
  685. STRUCT(KernelResource,KernelResourceFields,0xffff,0),
  686. STRUCT(VirtualChannel,VirtualChannelFields,0xffff,0),
  687. STRUCT(DrDevice,DrDeviceFields,0xffff,0),
  688. STRUCT(DrPrinterPort,DrPrinterPortFields,0xffff,0),
  689. STRUCT(DrParallelPort,DrParallelPortFields,0xffff,0),
  690. STRUCT(DrSerialPort,DrSerialPortFields,0xffff,0),
  691. STRUCT(DrSessionManager,DrSessionManagerFields,0xffff,0),
  692. STRUCT(DrSession,DrSessionFields,0xffff,0),
  693. #if DBG
  694. STRUCT(ReferenceTraceRecord,ReferenceTraceRecordFields,0xffff,0),
  695. #endif
  696. STRUCT(SESSIONLISTNODE,SESSIONLISTNODEFields,0xffff,0),
  697. STRUCT(EVENTLISTNODE,EVENTLISTNODEFields,0xffff,0),
  698. STRUCT(RDPDR_IOCOMPLETION_PACKET,RdpdrIoCompletionFields,0xffff,0),
  699. STRUCT(RDPDR_IOREQUEST_PACKET,RdpdrIoRequestFields,0xffff,0),
  700. STRUCT(RDPDR_UPDATE_DEVICEINFO_PACKET,RdpdrUpdateDeviceInfoFields,0xffff,0),
  701. STRUCT(RDPDR_DEVICE_REPLY_PACKET,RdpdrDeviceReplyFields,0xffff,0),
  702. STRUCT(RDPDR_DEVICELIST_ANNOUNCE_PACKET,RdpdrDeviceListAnnounceFields,0xffff,0),
  703. STRUCT(RDPDR_DEVICE_ANNOUNCE,RdpdrDeviceAnnounceFields,0xffff,0),
  704. STRUCT(RDPDR_CLIENT_NAME_PACKET,RdpdrClientNameFields,0xffff,0),
  705. STRUCT(RDPDR_CLIENT_CONFIRM_PACKET,RdpdrClientConfirmFields,0xffff,0),
  706. STRUCT(RDPDR_SERVER_ANNOUNCE_PACKET,RdpdrServerAnnounceFields,0xffff,0),
  707. STRUCT(RDPDR_HEADER,RdpdrHeaderFields,0xffff,0),
  708. #if DBG
  709. STRUCT(TRC_CONFIG,TRC_CONFIGFields,0xffff,0),
  710. STRUCT(TRC_PREFIX_DATA,TRC_PREFIX_DATAFields,0xffff,0),
  711. #endif // DBG
  712. STRUCTLAST
  713. };
  714. ULONG_PTR FieldOffsetOfContextListEntryInRxC(){ return FIELD_OFFSET(RX_CONTEXT,ContextListEntry);}
  715. PCWSTR GetExtensionLibPerDebugeeArchitecture(ULONG DebugeeArchitecture){
  716. switch (DebugeeArchitecture) {
  717. case RX_PROCESSOR_ARCHITECTURE_INTEL:
  718. return L"kdextx86.dll";
  719. case RX_PROCESSOR_ARCHITECTURE_MIPS:
  720. return L"kdextmip.dll";
  721. case RX_PROCESSOR_ARCHITECTURE_ALPHA:
  722. return L"kdextalp.dll";
  723. case RX_PROCESSOR_ARCHITECTURE_PPC:
  724. return L"kdextppc.dll";
  725. default:
  726. return(NULL);
  727. }
  728. }
  729. //CODE.IMPROVEMENT it is not good to try to structure along the lines of "this routine knows
  730. // rxstructures" versus "this routine knows debugger extensions". also we
  731. // need a precomp.h
  732. BOOLEAN wGetData( ULONG_PTR dwAddress, PVOID ptr, ULONG size, IN PSZ type);
  733. VOID ReadRxContextFields(ULONG_PTR RxContext,PULONG_PTR pFcb,PULONG_PTR pThread, PULONG_PTR pMiniCtx2)
  734. {
  735. RX_CONTEXT RxContextBuffer;
  736. if (!wGetData(RxContext,&RxContextBuffer,sizeof(RxContextBuffer),"RxContextFieldss")) return;
  737. *pFcb = (ULONG_PTR)(RxContextBuffer.pFcb);
  738. *pThread = (ULONG_PTR)(RxContextBuffer.LastExecutionThread);
  739. *pMiniCtx2 = (ULONG_PTR)(RxContextBuffer.MRxContext[2]);
  740. }
  741. FOLLOWON_HELPER_RETURNS
  742. __FollowOnError (
  743. OUT PBYTE Buffer2,
  744. IN PBYTE followontext,
  745. ULONG LastId,
  746. ULONG Index)
  747. {
  748. if (LastId==0) {
  749. sprintf((char *)Buffer2,"Cant dump a %s. no previous dump.\n",
  750. followontext,Index);
  751. } else {
  752. sprintf((char *)Buffer2,"Cant dump a %s from a %s\n",
  753. followontext,Structs[Index].StructName);
  754. }
  755. return(FOLLOWONHELPER_ERROR);
  756. }
  757. #define FollowOnError(A) (__FollowOnError(Buffer2,A,p->IdOfLastDump,p->IndexOfLastDump))
  758. VOID dprintfsprintfbuffer(BYTE *Buffer);
  759. DECLARE_FOLLOWON_HELPER_CALLEE(FcbFollowOn)
  760. {
  761. //BYTE DbgBuf[200];
  762. //sprintf(DbgBuf,"top p,id=%08lx,%d",p,p->IdOfLastDump);
  763. //dprintfsprintfbuffer(DbgBuf);
  764. switch (p->IdOfLastDump) {
  765. case StrEnum_RX_CONTEXT:{
  766. PRX_CONTEXT RxContext = (PRX_CONTEXT)(&p->StructDumpBuffer[0]);
  767. sprintf((char *)Buffer2," %08p\n",RxContext->pFcb);
  768. return(FOLLOWONHELPER_DUMP);
  769. }
  770. break;
  771. default:
  772. return FollowOnError((PUCHAR)"irp");
  773. }
  774. }