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.

1016 lines
23 KiB

  1. //+----------------------------------------------------------------------------
  2. //
  3. // Copyright (C) 1992, Microsoft Corporation.
  4. //
  5. // File: DUMPSUP.C
  6. //
  7. // Contents:
  8. // This module implements a collection of data structure dump
  9. // routines for debugging the Dfs file system
  10. //
  11. // Functions: DfsDump - Print the contents of a dfs data structure
  12. //
  13. // History: 12 Nov 1991 AlanW Created from CDFS souce.
  14. // 8 May 1992 PeterCo Modifications for PKT support
  15. // 14 July 1992 SudK Modifications to dump PKT structures.
  16. // 30 April 1993 SudK Modified to work with KD Extensions.
  17. //
  18. // Notes: This module is included by the user-mode program
  19. // DfsDump.c. When this occurs, the structures will
  20. // be in user addressible memory, but pointers will
  21. // be inaccessible. The sysmbol USERMODE will be
  22. // defined when included by DfsDump.c.
  23. //
  24. //-----------------------------------------------------------------------------
  25. #ifdef USERMODE
  26. #undef DBG
  27. #define DBG 1
  28. #endif //USERMODE
  29. #ifdef KDEXTMODE
  30. #undef DBG
  31. #define DBG 1
  32. #endif //KDEXTMODE
  33. #include "dsprocs.h"
  34. #include "attach.h"
  35. #include "fcbsup.h"
  36. #ifdef KDEXTMODE
  37. typedef void (*PNTKD_OUTPUT_ROUTINE)(char *, ...);
  38. extern PNTKD_OUTPUT_ROUTINE lpOutputRoutine;
  39. void
  40. DfsKdextReadAndPrintString(PUNICODE_STRING pustr);
  41. #define DbgPrint (lpOutputRoutine)
  42. #endif //KDEXTMODE
  43. #if DBG
  44. VOID DfsDump( IN PVOID Ptr );
  45. VOID DfsDumpDataHeader( IN PDS_DATA Ptr);
  46. VOID DfsDumpVcb( IN PVCB Ptr );
  47. VOID DfsDumpPkt( IN PDFS_PKT Ptr );
  48. VOID DfsDumpPktEntry( IN PDFS_PKT_ENTRY Ptr);
  49. VOID DfsDumpPktEntryId( IN PDFS_PKT_ENTRY_ID Ptr);
  50. VOID DfsDumpPktEntryInfo(IN PDFS_PKT_ENTRY_INFO Ptr);
  51. VOID DfsDumpDfsService( IN PDFS_SERVICE Ptr);
  52. VOID DfsDumpProvider(IN PPROVIDER_DEF Ptr);
  53. VOID DfsDumpFcbHash( IN PFCB_HASH_TABLE Ptr );
  54. VOID DfsDumpFcb( IN PFCB Ptr );
  55. VOID DfsDumpIrpContext( IN PIRP_CONTEXT Ptr );
  56. VOID DfsDumpVolumeDevice( IN PDFS_VOLUME_OBJECT Ptr );
  57. VOID DfsDumpLogicalRootDevice( IN PLOGICAL_ROOT_DEVICE_OBJECT Ptr );
  58. VOID DfsDumpFilesysDevice( IN PDEVICE_OBJECT Ptr );
  59. VOID DfsDumpDevice( IN PDEVICE_OBJECT Ptr );
  60. VOID PrintGuid( IN GUID *Ptr);
  61. #ifdef ALLOC_PRAGMA
  62. #pragma alloc_text ( PAGE, DfsDumpDataHeader )
  63. #pragma alloc_text ( PAGE, DfsDumpVcb )
  64. #pragma alloc_text ( PAGE, DfsDumpPkt )
  65. #pragma alloc_text ( PAGE, DfsDumpPktEntry )
  66. #pragma alloc_text ( PAGE, DfsDumpPktEntryId )
  67. #pragma alloc_text ( PAGE, DfsDumpPktEntryInfo )
  68. #pragma alloc_text ( PAGE, DfsDumpDfsService )
  69. #pragma alloc_text ( PAGE, DfsDumpProvider )
  70. #pragma alloc_text ( PAGE, DfsDumpFcbHash )
  71. #pragma alloc_text ( PAGE, DfsDumpFcb )
  72. #pragma alloc_text ( PAGE, DfsDumpIrpContext )
  73. #pragma alloc_text ( PAGE, DfsDumpVolumeDevice )
  74. #pragma alloc_text ( PAGE, DfsDumpLogicalRootDevice )
  75. #pragma alloc_text ( PAGE, DfsDumpFilesysDevice )
  76. #pragma alloc_text ( PAGE, DfsDumpDevice )
  77. #pragma alloc_text ( PAGE, PrintGuid )
  78. #endif // ALLOC_PRAGMA
  79. #ifdef KDEXTMODE
  80. #define PrintString(pStr) DfsKdextReadAndPrintString(pStr)
  81. #else
  82. #ifdef USERMODE
  83. #define PrintString(pStr) DfsReadAndPrintString(pStr)
  84. #else
  85. #define PrintString(pStr) DbgPrint("%wZ", (pStr))
  86. #endif //USERMODE
  87. #endif //KDEXTMODE
  88. ULONG DfsDumpCurrentColumn = 0;
  89. ULONG DfsDumpCurrentIndent = 0;
  90. #define DumpNewLine() { \
  91. DbgPrint("\n"); \
  92. DfsDumpCurrentColumn = 0; \
  93. }
  94. #define DumpLabel(Label,Width) { \
  95. ULONG i, LastPeriod=0; \
  96. CHAR _Str[19]; \
  97. for(i=0;i<strlen(#Label);i++) {if (#Label[i] == '.') LastPeriod = i;} \
  98. RtlCopyMemory(&_Str[0],&#Label[LastPeriod],Width); \
  99. for(i=strlen(_Str);i<Width;i++) {_Str[i] = ' '; } \
  100. _Str[Width] = '\0'; \
  101. if (DfsDumpCurrentColumn==0) \
  102. for(i=0;i<DfsDumpCurrentIndent;i++) {DbgPrint(" ");} \
  103. DbgPrint(" %s", _Str); \
  104. }
  105. #define DumpField(Field) { \
  106. if ((DfsDumpCurrentColumn + 18 + 9 + 9) > 80) {DumpNewLine();} \
  107. DumpLabel(Field,18); \
  108. DbgPrint(":%8lx", Ptr->Field); \
  109. DbgPrint(" "); \
  110. DfsDumpCurrentColumn += 18 + 9 + 9; \
  111. }
  112. #define DumpLargeInt(Field) { \
  113. if ((DfsDumpCurrentColumn + 18 + 17) > 80) {DumpNewLine();} \
  114. DumpLabel(Field,18); \
  115. DbgPrint(":%8lx", Ptr->Field.HighPart); \
  116. DbgPrint("%8lx", Ptr->Field.LowPart); \
  117. DbgPrint(" "); \
  118. DfsDumpCurrentColumn += 18 + 17; \
  119. }
  120. #define DumpListEntry(Links) { \
  121. if ((DfsDumpCurrentColumn + 18 + 9 + 9) > 80) {DumpNewLine();} \
  122. DumpLabel(Links,18); \
  123. DbgPrint(" %8lx", Ptr->Links.Flink); \
  124. DbgPrint(":%8lx", Ptr->Links.Blink); \
  125. DfsDumpCurrentColumn += 18 + 9 + 9; \
  126. }
  127. #define DumpString(Field) { \
  128. ULONG Width = Ptr->Field.Length/sizeof (WCHAR); \
  129. if (Ptr->Field.Buffer == NULL) { Width = 6; } \
  130. if ((DfsDumpCurrentColumn + 18 + Width) > 80) {DumpNewLine();} \
  131. DumpLabel(Field,18); \
  132. if (Ptr->Field.Buffer == NULL) { DbgPrint("*NULL*"); } else { \
  133. PrintString(&Ptr->Field); \
  134. } \
  135. DfsDumpCurrentColumn += 18 + Width; \
  136. }
  137. #define DumpGuid(Field) { \
  138. if ((DfsDumpCurrentColumn + 8 + 35) > 80) {DumpNewLine();} \
  139. DumpLabel(Field,8); \
  140. PrintGuid(&Ptr->Field); \
  141. DfsDumpCurrentColumn += 8 + 35; \
  142. }
  143. #define DumpBuffer(Field, len) { \
  144. ULONG i; \
  145. if ((DfsDumpCurrentColumn+18+2*Ptr->len+8)>80) {DumpNewLine();} \
  146. DumpLabel(Field,18); \
  147. for (i=0; i<(ULONG)(Ptr->len-1); i++) \
  148. DbgPrint("%c", Ptr->Field[i]); \
  149. for (i=0; i<(ULONG)(Ptr->len-1); i++) \
  150. DbgPrint("%02x", Ptr->Field[i]); \
  151. DfsDumpCurrentColumn += 18 + Ptr->len + 8; \
  152. }
  153. #define TestForNull(Name) { \
  154. if (Ptr == NULL) { \
  155. DbgPrint("%s - Cannot dump a NULL pointer\n", Name); \
  156. return; \
  157. } \
  158. }
  159. VOID
  160. DfsDump (
  161. IN PVOID Ptr
  162. )
  163. /*++
  164. Routine Description:
  165. This routine determines the type of internal record reference by ptr and
  166. calls the appropriate dump routine.
  167. Arguments:
  168. Ptr - Supplies the pointer to the record to be dumped
  169. Return Value:
  170. None
  171. --*/
  172. {
  173. TestForNull("DfsDump");
  174. switch (NodeType(Ptr)) {
  175. case DSFS_NTC_DATA_HEADER:
  176. DfsDumpDataHeader( Ptr );
  177. break;
  178. case DSFS_NTC_VCB:
  179. DfsDumpVcb( Ptr );
  180. break;
  181. case DSFS_NTC_PKT:
  182. DfsDumpPkt( Ptr );
  183. break;
  184. case DSFS_NTC_PKT_ENTRY:
  185. DfsDumpPktEntry( Ptr );
  186. break;
  187. case DSFS_NTC_PROVIDER:
  188. DfsDumpProvider( Ptr );
  189. break;
  190. case DSFS_NTC_FCB_HASH:
  191. DfsDumpFcbHash( Ptr );
  192. break;
  193. case DSFS_NTC_FCB:
  194. DfsDumpFcb( Ptr );
  195. break;
  196. case DSFS_NTC_IRP_CONTEXT:
  197. DfsDumpIrpContext( Ptr );
  198. break;
  199. case IO_TYPE_DEVICE:
  200. if (((PDEVICE_OBJECT)Ptr)->DeviceType == FILE_DEVICE_DFS_VOLUME)
  201. DfsDumpVolumeDevice( Ptr );
  202. else if (((PDEVICE_OBJECT)Ptr)->DeviceType == FILE_DEVICE_DFS)
  203. DfsDumpLogicalRootDevice( Ptr );
  204. else if (((PDEVICE_OBJECT)Ptr)->DeviceType == FILE_DEVICE_DFS_FILE_SYSTEM)
  205. DfsDumpFilesysDevice( Ptr );
  206. else
  207. DbgPrint("DfsDump - Unknown device type code %4x\n",
  208. ((PDEVICE_OBJECT)Ptr)->DeviceType);
  209. break;
  210. default:
  211. DbgPrint("DfsDump - Unknown Node type code %4x\n",
  212. *((PNODE_TYPE_CODE)(Ptr)));
  213. break;
  214. }
  215. return;
  216. }
  217. static VOID
  218. DfsDumpPtrAndNtc (
  219. char *Str,
  220. PVOID Ptr
  221. ) {
  222. #ifndef KDEXTMODE
  223. #ifndef USERMODE
  224. DumpNewLine();
  225. DbgPrint("%s @ %lx\t", Str, (Ptr));
  226. #endif //USERMODE
  227. #endif //KDEXTMODE
  228. DumpLabel(Node, sizeof("Node "));
  229. DbgPrint("Type: %04x", ((PDS_DATA)Ptr)->NodeTypeCode);
  230. DbgPrint("\tNode Size: %04x", ((PDS_DATA)Ptr)->NodeByteSize);
  231. DumpNewLine();
  232. return;
  233. }
  234. static VOID
  235. DfsDumpDataHeader (
  236. IN PDS_DATA Ptr
  237. )
  238. /*++
  239. Routine Description:
  240. Dump the top data structure
  241. Arguments:
  242. Ptr - a pointer to the anchor block
  243. Return Value:
  244. None
  245. --*/
  246. {
  247. // ASSERT(Ptr == &DfsData);
  248. DfsDumpPtrAndNtc("DfsData", (Ptr));
  249. DumpListEntry (VcbQueue);
  250. DumpListEntry (AVdoQueue);
  251. DumpField (DriverObject);
  252. DumpField (FileSysDeviceObject);
  253. DumpField (cProvider);
  254. DumpField (pProvider);
  255. DumpField (OurProcess);
  256. DumpField (FcbHashTable);
  257. DumpNewLine();
  258. return;
  259. }
  260. static VOID
  261. DfsDumpVcb (
  262. IN PVCB Ptr
  263. )
  264. /*++
  265. Routine Description:
  266. Dump a Vcb structure.
  267. Arguments:
  268. Ptr - Supplies the Vcb to be dumped.
  269. Return Value:
  270. None
  271. --*/
  272. {
  273. // TestForNull("DfsDumpVcb");
  274. DfsDumpPtrAndNtc("Vcb", (Ptr));
  275. DumpListEntry (VcbLinks);
  276. DumpString (LogicalRoot);
  277. DumpString (LogRootPrefix);
  278. DumpNewLine();
  279. return;
  280. }
  281. //----------------------------------------------------------------------
  282. //
  283. // Function: DfsDumpPktEntry()
  284. //
  285. // Arguments: Ptr - Pointer to the DFS_PKT_ENTRY Structure to be dumped.
  286. //
  287. // Returns: Nothing.
  288. //
  289. // Description: This function dumps the various fields of the PKT Entry.
  290. //
  291. // History: 14 July 1992 Sudk Created.
  292. //
  293. //----------------------------------------------------------------------
  294. static VOID
  295. DfsDumpPktEntry( IN PDFS_PKT_ENTRY Ptr)
  296. {
  297. DfsDumpPtrAndNtc("PktEntry", (Ptr));
  298. DumpListEntry(Link);
  299. DumpField(Type);
  300. DumpField(FileOpenCount);
  301. DumpField(ExpireTime);
  302. DumpField(ActiveService);
  303. DumpField(LocalService);
  304. DumpField(Superior);
  305. DumpField(SubordinateCount);
  306. DumpListEntry(SubordinateList);
  307. DumpListEntry(SiblingLink);
  308. DumpNewLine();
  309. DumpField(ClosestDC);
  310. DumpListEntry(ChildList);
  311. DumpListEntry(NextLink);
  312. DumpNewLine();
  313. DfsDumpPktEntryId(&(Ptr->Id));
  314. DfsDumpPktEntryInfo(&(Ptr->Info));
  315. DumpNewLine();
  316. }
  317. //----------------------------------------------------------------------
  318. //
  319. // Function: DfsDumpPktEntryId()
  320. //
  321. // Arguments: Ptr - Pointer to EntryId structure.
  322. //
  323. // Returns: Nothing.
  324. //
  325. // Description: Dumps the EntryId structure passed to it.
  326. //
  327. // History: 14 July 1992 Sudk Created.
  328. //
  329. //----------------------------------------------------------------------
  330. static VOID
  331. DfsDumpPktEntryId(IN PDFS_PKT_ENTRY_ID Ptr)
  332. {
  333. DumpNewLine();
  334. DumpLabel(PKT_ENTRY_ID, sizeof "PKT_ENTRY_ID");
  335. DfsDumpCurrentIndent += 2;
  336. DumpNewLine();
  337. DumpGuid(Uid);
  338. DumpString(Prefix);
  339. DumpNewLine();
  340. DfsDumpCurrentIndent -= 2;
  341. }
  342. //----------------------------------------------------------------------
  343. //
  344. // Function: PrintGuid
  345. //
  346. // Synopsis: Prints a GUID value in a 35 byte field
  347. //
  348. // Arguments: Ptr - Pointer to a GUID.
  349. //
  350. // Returns: Nothing.
  351. //
  352. // History: 14 July 1992 Sudk Created.
  353. //
  354. //----------------------------------------------------------------------
  355. static VOID
  356. PrintGuid( IN GUID *Ptr)
  357. {
  358. int i;
  359. DbgPrint("%08x-%04x-%04x-", Ptr->Data1, Ptr->Data2, Ptr->Data3);
  360. for (i=0; i<8; i++) {
  361. DbgPrint("%02x", Ptr->Data4[i]);
  362. }
  363. }
  364. //----------------------------------------------------------------------
  365. //
  366. // Function: DfsDumpPktEntryInfo()
  367. //
  368. // Arguments: Ptr - Pointer to EntryInfo structure.
  369. //
  370. // Returns: Nothing.
  371. //
  372. // Description: Dumps the EntryInfo structure passed to it.
  373. //
  374. // History: 14 July 1992 Sudk Created.
  375. //
  376. //----------------------------------------------------------------------
  377. static VOID
  378. DfsDumpPktEntryInfo(IN PDFS_PKT_ENTRY_INFO Ptr)
  379. {
  380. DumpLabel(PKT_ENTRY_INFO, sizeof("PKT_ENTRY_INFO"));
  381. DfsDumpCurrentIndent += 2;
  382. DumpNewLine();
  383. DumpField(Timeout);
  384. DumpField(ServiceCount);
  385. DumpField(ServiceList);
  386. DfsDumpCurrentIndent -= 2;
  387. DumpNewLine();
  388. }
  389. //----------------------------------------------------------------------
  390. //
  391. // Function: DfsDumpDfsService()
  392. //
  393. // Arguments: Ptr - Pointer to the DFS_SERVICE struct to be dumped.
  394. //
  395. // Returns: Nothing.
  396. //
  397. // Description: A simple dump of the above structure.
  398. //
  399. // History: 14 June 1992 Sudk Created.
  400. //
  401. //----------------------------------------------------------------------
  402. VOID
  403. DfsDumpDfsService( IN PDFS_SERVICE Ptr)
  404. {
  405. DumpLabel(DFS_SERVICE, sizeof("DFS_SERVICE"));
  406. DfsDumpCurrentIndent += 2;
  407. DumpNewLine();
  408. DumpField(Type);
  409. DumpField(Capability);
  410. DumpField(Status);
  411. DumpField(ProviderId);
  412. DumpField(pProvider);
  413. DumpField(ConnFile);
  414. DumpField(pMachEntry);
  415. DumpNewLine();
  416. DumpString(Name);
  417. DumpNewLine();
  418. DumpString(Address);
  419. DumpNewLine();
  420. DumpString(StgId);
  421. DfsDumpCurrentIndent -= 2;
  422. DumpNewLine();
  423. }
  424. //----------------------------------------------------------------------
  425. //
  426. // Function: DfsDumpDSMachine()
  427. //
  428. // Arguments: Ptr - Pointer to the DS_MACHINE struct to be dumped.
  429. //
  430. // Returns: Nothing.
  431. //
  432. // Description: A simple dump of the above structure.
  433. //
  434. // History: 12 April 1994 Sudk Created.
  435. //
  436. //----------------------------------------------------------------------
  437. VOID
  438. DfsDumpDSMachine( IN PDS_MACHINE Ptr)
  439. {
  440. ULONG i;
  441. DumpLabel(DS_MACHINE, sizeof("DS_MACHINE"));
  442. DfsDumpCurrentIndent += 2;
  443. DumpNewLine();
  444. DumpGuid(guidSite);
  445. DumpGuid(guidMachine);
  446. DumpField(grfFlags);
  447. DumpField(pwszShareName);
  448. DumpField(cPrincipals);
  449. DumpField(prgpwszPrincipals);
  450. DumpField(cTransports);
  451. for (i=0; i<Ptr->cTransports; i++) {
  452. DumpField(rpTrans[i]);
  453. }
  454. DfsDumpCurrentIndent -= 2;
  455. DumpNewLine();
  456. }
  457. //----------------------------------------------------------------------
  458. //
  459. // Function: DfsDumpDSTransport()
  460. //
  461. // Arguments: Ptr - Pointer to the DS_TRANSPORT struct to be dumped.
  462. //
  463. // Returns: Nothing.
  464. //
  465. // Description: A simple dump of the above structure.
  466. //
  467. // History: 12 April 1994 Sudk Created.
  468. //
  469. //----------------------------------------------------------------------
  470. VOID
  471. DfsDumpDSTransport( IN PDS_TRANSPORT Ptr)
  472. {
  473. DumpLabel(DS_TRANSPORT, sizeof("DS_TRANSPORT"));
  474. DfsDumpCurrentIndent += 2;
  475. DumpNewLine();
  476. DumpField(usFileProtocol);
  477. DumpField(iPrincipal);
  478. DumpField(grfModifiers);
  479. DumpField(taddr.AddressLength);
  480. DumpNewLine();
  481. switch (Ptr->taddr.AddressType) {
  482. case TDI_ADDRESS_TYPE_IP: {
  483. PTDI_ADDRESS_IP pipAddr;
  484. pipAddr = (PTDI_ADDRESS_IP) Ptr->taddr.Address;
  485. DbgPrint(" TCP/IP Address: %d.%d.%d.%d",
  486. BYTE_0(pipAddr->in_addr),
  487. BYTE_1(pipAddr->in_addr),
  488. BYTE_2(pipAddr->in_addr),
  489. BYTE_3(pipAddr->in_addr));
  490. } break;
  491. case TDI_ADDRESS_TYPE_NETBIOS: {
  492. PTDI_ADDRESS_NETBIOS pnbAddr;
  493. pnbAddr = (PTDI_ADDRESS_NETBIOS) Ptr->taddr.Address;
  494. DbgPrint(" NetBIOS Address: %s", pnbAddr->NetbiosName);
  495. } break;
  496. case TDI_ADDRESS_TYPE_IPX: {
  497. PTDI_ADDRESS_IPX pipxAddr;
  498. pipxAddr = (PTDI_ADDRESS_IPX) Ptr->taddr.Address;
  499. DbgPrint(" IPX Address: Net = %08 Node = %02x%02x%02x%02x%02x%02x",
  500. pipxAddr->NetworkAddress,
  501. pipxAddr->NodeAddress[6],
  502. pipxAddr->NodeAddress[5],
  503. pipxAddr->NodeAddress[4],
  504. pipxAddr->NodeAddress[3],
  505. pipxAddr->NodeAddress[2],
  506. pipxAddr->NodeAddress[1],
  507. pipxAddr->NodeAddress[0]);
  508. } break;
  509. default:
  510. break;
  511. }
  512. DfsDumpCurrentIndent -= 2;
  513. DumpNewLine();
  514. }
  515. //----------------------------------------------------------------------
  516. //
  517. // Function: DfsDumpPkt
  518. //
  519. // Arguments: Ptr - A pointer to a DFS_PKT structure to be dumped.
  520. //
  521. // Returns: Nothing.
  522. //
  523. // Description: This function dumps the various fields of the PKT.
  524. //
  525. // History: 14 July 1992 Sudk Created.
  526. //
  527. //----------------------------------------------------------------------
  528. static VOID
  529. DfsDumpPkt( IN PDFS_PKT Ptr)
  530. {
  531. //
  532. // First Dump the name of the structure, the nodetype and the
  533. // node size of this structure.
  534. //
  535. DfsDumpPtrAndNtc("Pkt", (Ptr));
  536. DumpField(EntryCount);
  537. DumpListEntry(EntryList);
  538. DumpField(DomainPktEntry);
  539. DumpNewLine();
  540. }
  541. //+--------------------------------------------------------------
  542. //
  543. // Function: DfsDumpProvider()
  544. //
  545. // Arguments: Ptr - a pointer to the provider structure to dump.
  546. //
  547. // Description: This function merely dumps the information in a provider struct.
  548. //
  549. // Returns: Nothing.
  550. //
  551. // History: Sudk Created July 16th 1992.
  552. //
  553. //---------------------------------------------------------------
  554. static VOID
  555. DfsDumpProvider( IN PPROVIDER_DEF Ptr)
  556. {
  557. DfsDumpPtrAndNtc("Provider", (Ptr));
  558. DumpField(eProviderId);
  559. DumpField(fProvCapability);
  560. DumpString(DeviceName);
  561. DumpNewLine();
  562. }
  563. static VOID
  564. DfsDumpFcbHash (
  565. IN PFCB_HASH_TABLE Ptr
  566. )
  567. /*++
  568. Routine Description:
  569. Dump an FcbHashTable structure.
  570. Arguments:
  571. Ptr - Supplies the FcbHashTable to be dumped.
  572. Return Value:
  573. None
  574. --*/
  575. {
  576. DfsDumpPtrAndNtc("FcbHash", (Ptr));
  577. DumpField (HashMask);
  578. DumpNewLine();
  579. return;
  580. }
  581. static VOID
  582. DfsDumpFcb (
  583. IN PFCB Ptr
  584. )
  585. /*++
  586. Routine Description:
  587. Dump an Fcb structure.
  588. Arguments:
  589. Ptr - Supplies the Fcb to be dumped.
  590. Return Value:
  591. None
  592. --*/
  593. {
  594. DfsDumpPtrAndNtc("Fcb", (Ptr));
  595. DumpField (Vcb);
  596. DumpString (FullFileName);
  597. DumpField (TargetDevice);
  598. DumpField (FileObject);
  599. DumpNewLine();
  600. return;
  601. }
  602. static VOID
  603. DfsDumpIrpContext (
  604. IN PIRP_CONTEXT Ptr
  605. )
  606. /*++
  607. Routine Description:
  608. Dump an IrpContext structure.
  609. Arguments:
  610. Ptr - Supplies the Irp Context to be dumped.
  611. Return Value:
  612. None
  613. --*/
  614. {
  615. // TestForNull("DfsDumpIrpContext");
  616. DfsDumpPtrAndNtc("IrpContext", (Ptr));
  617. // DumpListEntry (WorkQueueLinks);
  618. DumpField (OriginatingIrp);
  619. DumpField (MajorFunction);
  620. DumpField (MinorFunction);
  621. DumpField (Flags);
  622. DumpField (ExceptionStatus);
  623. DumpNewLine();
  624. return;
  625. }
  626. static VOID
  627. DfsDumpDevice (
  628. IN PDEVICE_OBJECT Ptr
  629. )
  630. /*++
  631. Routine Description:
  632. Dump a device object structure.
  633. Arguments:
  634. Ptr - Supplies the device object to be dumped.
  635. Return Value:
  636. None
  637. --*/
  638. {
  639. // TestForNull("DfsDumpDevice");
  640. DfsDumpPtrAndNtc("Device", (Ptr));
  641. DumpField (ReferenceCount);
  642. DumpField (DriverObject);
  643. DumpField (AttachedDevice);
  644. DumpField (Flags);
  645. DumpField (Characteristics);
  646. DumpField (DeviceExtension);
  647. DumpField (DeviceType);
  648. DumpField (StackSize);
  649. DumpNewLine();
  650. return;
  651. }
  652. static VOID
  653. DfsDumpVolumeDevice (
  654. IN PDFS_VOLUME_OBJECT Ptr
  655. )
  656. /*++
  657. Routine Description:
  658. Dump a dfs volume device object structure.
  659. Arguments:
  660. Ptr - Supplies the device object to be dumped.
  661. Return Value:
  662. None
  663. --*/
  664. {
  665. // TestForNull("DfsDumpDevice");
  666. DfsDumpPtrAndNtc("DfsVolumeDevice", (Ptr));
  667. DumpLabel(DEVICE_OBJECT, sizeof("DEVICE_OBJECT"));
  668. DfsDumpCurrentIndent += 2;
  669. DumpNewLine();
  670. DfsDumpDevice(&Ptr->DeviceObject);
  671. DfsDumpCurrentIndent -= 2;
  672. DumpLabel(PROVIDER_DEF, sizeof("PROVIDER_DEF"));
  673. DfsDumpCurrentIndent += 2;
  674. DumpNewLine();
  675. DfsDumpProvider(&Ptr->Provider);
  676. DfsDumpCurrentIndent -= 2;
  677. DumpField (AttachCount);
  678. DumpListEntry (VdoLinks);
  679. DumpNewLine();
  680. return;
  681. }
  682. static VOID
  683. DfsDumpLogicalRootDevice (
  684. IN PLOGICAL_ROOT_DEVICE_OBJECT Ptr
  685. )
  686. /*++
  687. Routine Description:
  688. Dump a dfs logical root device object structure.
  689. Arguments:
  690. Ptr - Supplies the device object to be dumped.
  691. Return Value:
  692. None
  693. --*/
  694. {
  695. // TestForNull("DfsDumpLogicalRootDevice");
  696. DfsDumpPtrAndNtc("DfsLogicalRootDevice", (Ptr));
  697. DumpLabel(DEVICE_OBJECT, sizeof("DEVICE_OBJECT"));
  698. DfsDumpCurrentIndent += 2;
  699. DumpNewLine();
  700. DfsDumpDevice(&Ptr->DeviceObject);
  701. DfsDumpCurrentIndent -= 2;
  702. DumpLabel(VCB, sizeof("VCB"));
  703. DfsDumpCurrentIndent += 2;
  704. DumpNewLine();
  705. DfsDumpVcb(&Ptr->Vcb);
  706. DfsDumpCurrentIndent -= 2;
  707. // DumpField (AttachCount);
  708. // DumpList (VdoLinks);
  709. DumpNewLine();
  710. return;
  711. }
  712. static VOID
  713. DfsDumpFilesysDevice(
  714. IN PDEVICE_OBJECT Ptr
  715. )
  716. /*++
  717. Routine Description:
  718. Dump the dfs file system device object structure.
  719. Arguments:
  720. Ptr - Supplies the device object to be dumped.
  721. Return Value:
  722. None
  723. --*/
  724. {
  725. // TestForNull("DfsDumpFilesysDevice");
  726. DfsDumpPtrAndNtc("DfsFileSystemDevice", (Ptr));
  727. DumpLabel(DEVICE_OBJECT, sizeof("DEVICE_OBJECT"));
  728. DfsDumpCurrentIndent += 2;
  729. DumpNewLine();
  730. DfsDumpDevice(Ptr);
  731. DfsDumpCurrentIndent -= 2;
  732. DumpNewLine();
  733. return;
  734. }
  735. #endif // DBG