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.

209 lines
8.4 KiB

  1. //
  2. // Define flags and specific dump routines for the UDFR/W structures
  3. //
  4. #include "pch.h"
  5. #ifdef UDFS_RW_IN_BUILD
  6. #include "fatkd.h"
  7. #include "..\..\udfsrw\nodetype.h"
  8. #include "..\..\udfsrw\udf.h"
  9. #include "..\..\udfsrw\udfstruc.h"
  10. #include "..\..\udfsrw\udfdata.h"
  11. #include "udfskd.h"
  12. STATE UdfScbFlags[] = {
  13. { SCB_STATE_INITIALIZED, SCB_STATE_INITIALIZED, "Init"},
  14. { SCB_STATE_EMBEDDED_DATA, SCB_STATE_EMBEDDED_DATA, "Embedded"},
  15. { SCB_STATE_MCB_INITIALIZED, SCB_STATE_MCB_INITIALIZED, "MCBInit"},
  16. { SCB_STATE_STREAM_DIRECTORY, SCB_STATE_STREAM_DIRECTORY, "StreamDirectory"},
  17. { SCB_STATE_SECONDARY_STREAM, SCB_STATE_SECONDARY_STREAM, "SecondaryStream"},
  18. { SCB_STATE_SYSTEM_STREAM, SCB_STATE_SYSTEM_STREAM, "SystemStream"},
  19. { SCB_STATE_IN_SCB_TABLE, SCB_STATE_IN_SCB_TABLE, "InSCBTable"},
  20. { SCB_STATE_VMCB_MAPPING, SCB_STATE_VMCB_MAPPING, "VMCB"},
  21. { SCB_STATE_TEMPORARY, SCB_STATE_TEMPORARY, "Temp"},
  22. { SCB_STATE_DELETE_ON_CLOSE, SCB_STATE_DELETE_ON_CLOSE, "DeleteOnClose"},
  23. { SCB_STATE_TRUNCATE_ON_CLOSE, SCB_STATE_TRUNCATE_ON_CLOSE, "TruncateOnClose"},
  24. { SCB_STATE_NON_RELOCATABLE, SCB_STATE_NON_RELOCATABLE, "NonRelocatable"},
  25. { SCB_STATE_EXTENDED_FE, SCB_STATE_EXTENDED_FE, "ExtendedFE"},
  26. { SCB_STATE_SPARSE, SCB_STATE_SPARSE, "Sparse"},
  27. { SCB_STATE_MCB_ANR_INITIALIZED, SCB_STATE_MCB_ANR_INITIALIZED, "ANRMCBInit"},
  28. { SCB_STATE_UPDATE_TIMESTAMPS, SCB_STATE_UPDATE_TIMESTAMPS, "UpdateTimestamps"},
  29. { SCB_STATE_ALLOW_ONEGIG_WORKAROUND, SCB_STATE_ALLOW_ONEGIG_WORKAROUND, "OneGigWorkaround"},
  30. { SCB_STATE_DE_EMBED_IN_PROGRESS, SCB_STATE_DE_EMBED_IN_PROGRESS,"DeEmbedInProgress"},
  31. { SCB_STATE_LONG_ADS, SCB_STATE_LONG_ADS, "LongADs"},
  32. { SCB_STATE_FILE_DATA_MODIFIED, SCB_STATE_FILE_DATA_MODIFIED, "FileDataModified"},
  33. { 0 }
  34. };
  35. STATE UdfRwCcbFlags[] = {
  36. { CCB_FLAG_OPEN_BY_ID, CCB_FLAG_OPEN_BY_ID, "OpenById"},
  37. { CCB_FLAG_OPEN_RELATIVE_BY_ID, CCB_FLAG_OPEN_RELATIVE_BY_ID, "OpenRelById"},
  38. { CCB_FLAG_IGNORE_CASE, CCB_FLAG_IGNORE_CASE, "IgnoreCase"},
  39. { CCB_FLAG_DISMOUNT_ON_CLOSE, CCB_FLAG_DISMOUNT_ON_CLOSE, "DismountOnClose"},
  40. { CCB_FLAG_ALLOW_EXTENDED_DASD_IO, CCB_FLAG_ALLOW_EXTENDED_DASD_IO, "ExtendedDASD"},
  41. { CCB_FLAG_DELETE_ON_CLOSE, CCB_FLAG_DELETE_ON_CLOSE, "DeleteOnClose"},
  42. { CCB_FLAG_READ_ONLY, CCB_FLAG_READ_ONLY, "ReadOnly"},
  43. { CCB_FLAG_ENUM_NAME_EXP_HAS_WILD, CCB_FLAG_ENUM_NAME_EXP_HAS_WILD, "EnumNameHasWild"},
  44. { CCB_FLAG_ENUM_MATCH_ALL, CCB_FLAG_ENUM_MATCH_ALL, "EnumMatchAll"},
  45. { CCB_FLAG_ENUM_RETURN_NEXT, CCB_FLAG_ENUM_RETURN_NEXT, "EnumReturnNext"},
  46. { CCB_FLAG_ENUM_INITIALIZED, CCB_FLAG_ENUM_INITIALIZED, "EnumInitialised"},
  47. { CCB_FLAG_ENUM_NOMATCH_CONSTANT_ENTRY, CCB_FLAG_ENUM_NOMATCH_CONSTANT_ENTRY, "NoMatchConstantEntry"},
  48. { 0 }
  49. };
  50. STATE UdfRwIrpContextFlags[] = {
  51. { IRP_CONTEXT_FLAG_ON_STACK, IRP_CONTEXT_FLAG_ON_STACK, "OnStack"},
  52. { IRP_CONTEXT_FLAG_MORE_PROCESSING, IRP_CONTEXT_FLAG_MORE_PROCESSING, "MoreProcessing"},
  53. { IRP_CONTEXT_FLAG_FORCE_POST, IRP_CONTEXT_FLAG_FORCE_POST, "ForcePost"},
  54. { IRP_CONTEXT_FLAG_WAIT, IRP_CONTEXT_FLAG_WAIT, "Wait"},
  55. { IRP_CONTEXT_FLAG_TOP_LEVEL, IRP_CONTEXT_FLAG_TOP_LEVEL, "TopLevel"},
  56. { IRP_CONTEXT_FLAG_TOP_LEVEL_UDFS, IRP_CONTEXT_FLAG_TOP_LEVEL_UDFS, "TopLevelUdfs"},
  57. { IRP_CONTEXT_FLAG_IN_TEARDOWN, IRP_CONTEXT_FLAG_IN_TEARDOWN, "InTeardown"},
  58. { IRP_CONTEXT_FLAG_ALLOC_IO, IRP_CONTEXT_FLAG_ALLOC_IO, "AllocIo"},
  59. { IRP_CONTEXT_FLAG_DISABLE_POPUPS, IRP_CONTEXT_FLAG_DISABLE_POPUPS, "DisablePopups"},
  60. { IRP_CONTEXT_FLAG_IN_FSP, IRP_CONTEXT_FLAG_IN_FSP, "InFsp"},
  61. { IRP_CONTEXT_FLAG_FULL_NAME, IRP_CONTEXT_FLAG_FULL_NAME, "FullName"},
  62. { IRP_CONTEXT_FLAG_TRAIL_BACKSLASH, IRP_CONTEXT_FLAG_TRAIL_BACKSLASH, "TrailBackslash"},
  63. { IRP_CONTEXT_FLAG_DEFERRED_WRITE, IRP_CONTEXT_FLAG_DEFERRED_WRITE, "DeferredWrite"},
  64. { 0 }
  65. };
  66. STATE UdfRwVcbStateFlags[] = {
  67. { VCB_STATE_REMOVABLE_MEDIA, VCB_STATE_REMOVABLE_MEDIA, "Removable"},
  68. { VCB_STATE_LOCKED, VCB_STATE_LOCKED, "Locked"},
  69. { VCB_STATE_NOTIFY_REMOUNT, VCB_STATE_NOTIFY_REMOUNT, "NotifyRemount"},
  70. { VCB_STATE_METHOD_2_FIXUP, VCB_STATE_METHOD_2_FIXUP, "Method2Fixup"},
  71. { VCB_STATE_READ_ONLY, VCB_STATE_READ_ONLY, "ReadOnly"},
  72. { VCB_STATE_MOUNTED_DIRTY, VCB_STATE_MOUNTED_DIRTY, "MountedDirty"},
  73. { VCB_STATE_BITMAP_INIT, VCB_STATE_BITMAP_INIT, "BitmapInit"},
  74. { VCB_STATE_MEDIA_WRITE_PROTECT, VCB_STATE_MEDIA_WRITE_PROTECT, "WriteProtect"},
  75. { 0 }
  76. };
  77. STATE UdfRwLcbFlags[] = {
  78. { LCB_FLAG_IGNORE_CASE, LCB_FLAG_IGNORE_CASE, "IgnoreCase"},
  79. { LCB_FLAG_SHORT_NAME, LCB_FLAG_SHORT_NAME, "ShortName"},
  80. { LCB_FLAG_POOL_ALLOCATED, LCB_FLAG_POOL_ALLOCATED, "PoolAllocated"},
  81. { LCB_FLAG_DELETE_ON_CLEANUP, LCB_FLAG_DELETE_ON_CLEANUP, "DeleteOnCleanup"},
  82. { LCB_FLAG_DELETE_IN_PROGRESS,LCB_FLAG_DELETE_IN_PROGRESS , "DeleteInProgress"},
  83. { LCB_FLAG_LINKS_REMOVED, LCB_FLAG_LINKS_REMOVED, "NameLinksRemoved"},
  84. { 0 }
  85. };
  86. BOOLEAN
  87. NodeIsUdfsRwIndex( USHORT T)
  88. {
  89. return T == UDFSRW_NTC_SCB_INDEX;
  90. }
  91. BOOLEAN
  92. NodeIsUdfsRwData( USHORT T)
  93. {
  94. return T == UDFSRW_NTC_SCB_DATA;
  95. }
  96. BOOLEAN
  97. LcbDeleted( ULONG F)
  98. {
  99. return (0 != (F & LCB_FLAG_DELETE_IN_PROGRESS));
  100. }
  101. // OK
  102. DUMP_ROUTINE( DumpUdfScb)
  103. {
  104. ULONG Flags, Offset, Offsetb, ScbState;
  105. UINT64 NonP;
  106. dprintf("[ Option flags: 1 = list children, 2 = List parent links, 4 = dump Mcbs ]\n\n");
  107. ROE( GetFieldValue( Address, InfoNode->TypeName, "ScbState", ScbState));
  108. dprintf("ScbState : ");
  109. PrintState( UdfScbFlags, ScbState );
  110. ROE( GetFieldValue( Address, InfoNode->TypeName, "Flags", Flags));
  111. dprintf("Header.Flags : ");
  112. PrintState( HeaderFlags, Flags );
  113. ROE( GetFieldValue( Address, InfoNode->TypeName, "Flags2", Flags));
  114. dprintf("Header.Flags2: ");
  115. PrintState( HeaderFlags2, Flags );
  116. dprintf("\n");
  117. Dt( InfoNode->TypeName, Address, 0, 0, NULL);
  118. //
  119. // Nonpaged portion
  120. //
  121. ROE( GetFieldValue( Address, InfoNode->TypeName, "ScbNonpaged", NonP));
  122. if (NonP) {
  123. dprintf("\nNonpaged portion @ %I64x\n\n",NonP);
  124. Dt( "Udfs!SCB_NONPAGED", NonP, 1, 0, NULL);
  125. }
  126. if (( Options & 1) && (UDFSRW_NTC_SCB_INDEX == InfoNode->TypeCode)) {
  127. dprintf("\nChild Lcb list\n");
  128. ROE( GetFieldOffset( "udfs!_SCB", "ChildLcbQueue", &Offset));
  129. ROE( GetFieldOffset( "udfs!_LCB", "ParentScbLinks", &Offsetb));
  130. DumpList( Address + Offset,
  131. UdfSummaryLcbDumpRoutine,
  132. Offsetb,
  133. FALSE,
  134. 0 );
  135. }
  136. if (Options & 2) {
  137. dprintf("\nParent Lcb list\n");
  138. ROE( GetFieldOffset( "udfs!_SCB", "ParentLcbQueue", &Offset));
  139. ROE( GetFieldOffset( "udfs!_LCB", "ChildScbLinks", &Offsetb));
  140. DumpList( Address + Offset,
  141. UdfSummaryLcbDumpRoutine,
  142. Offsetb,
  143. FALSE,
  144. 0 );
  145. }
  146. if (Options & 4) {
  147. if (ScbState & SCB_STATE_MCB_INITIALIZED) {
  148. ROE( GetFieldOffset( InfoNode->TypeName, "Mcb", &Offset));
  149. dprintf("\nA+R Mcb\n");
  150. DumpLargeMcb( Address+Offset, 0, NULL);
  151. }
  152. if (ScbState & SCB_STATE_MCB_ANR_INITIALIZED) {
  153. ROE( GetFieldOffset( InfoNode->TypeName, "ANRMcb", &Offset));
  154. dprintf("\nA+NR Mcb\n");
  155. DumpLargeMcb( Address+Offset, 0, NULL);
  156. }
  157. }
  158. dprintf("\n");
  159. }
  160. #endif