update for HEAD-2003021201
[reactos.git] / drivers / fs / ntfs / attrib.c
index 3d3c062..acdb2b6 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  ReactOS kernel
- *  Copyright (C) 2002 ReactOS Team
+ *  Copyright (C) 2002,2003 ReactOS Team
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -20,7 +20,7 @@
  *
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
- * FILE:             services/fs/ntfs/attrib.c
+ * FILE:             drivers/fs/ntfs/attrib.c
  * PURPOSE:          NTFS filesystem driver
  * PROGRAMMER:       Eric Kohl
  */
@@ -29,7 +29,7 @@
 
 #include <ddk/ntddk.h>
 
-//#define NDEBUG
+#define NDEBUG
 #include <debug.h>
 
 #include "ntfs.h"
 /* FUNCTIONS ****************************************************************/
 
 VOID
+NtfsDumpFileNameAttribute(PATTRIBUTE Attribute)
+{
+  PRESIDENT_ATTRIBUTE ResAttr;
+  PFILENAME_ATTRIBUTE FileNameAttr;
+
+  DbgPrint("  $FILE_NAME ");
+
+  ResAttr = (PRESIDENT_ATTRIBUTE)Attribute;
+//  DbgPrint(" Length %lu  Offset %hu ", ResAttr->ValueLength, ResAttr->ValueOffset);
+
+  FileNameAttr = (PFILENAME_ATTRIBUTE)((PVOID)ResAttr + ResAttr->ValueOffset);
+  DbgPrint(" '%.*S' ", FileNameAttr->NameLength, FileNameAttr->Name);
+}
+
+
+VOID
+NtfsDumpVolumeNameAttribute(PATTRIBUTE Attribute)
+{
+  PRESIDENT_ATTRIBUTE ResAttr;
+  PWCHAR VolumeName;
+
+  DbgPrint("  $VOLUME_NAME ");
+
+  ResAttr = (PRESIDENT_ATTRIBUTE)Attribute;
+//  DbgPrint(" Length %lu  Offset %hu ", ResAttr->ValueLength, ResAttr->ValueOffset);
+
+  VolumeName = (PWCHAR)((PVOID)ResAttr + ResAttr->ValueOffset);
+  DbgPrint(" '%.*S' ", ResAttr->ValueLength/2, VolumeName);
+}
+
+
+VOID
+NtfsDumpVolumeInformationAttribute(PATTRIBUTE Attribute)
+{
+  PRESIDENT_ATTRIBUTE ResAttr;
+  PVOLINFO_ATTRIBUTE VolInfoAttr;
+
+  DbgPrint("  $VOLUME_INFORMATION ");
+
+  ResAttr = (PRESIDENT_ATTRIBUTE)Attribute;
+//  DbgPrint(" Length %lu  Offset %hu ", ResAttr->ValueLength, ResAttr->ValueOffset);
+
+  VolInfoAttr = (PVOLINFO_ATTRIBUTE)((PVOID)ResAttr + ResAttr->ValueOffset);
+  DbgPrint(" NTFS Version %u.%u  Flags 0x%04hx ",
+          VolInfoAttr->MajorVersion,
+          VolInfoAttr->MinorVersion,
+          VolInfoAttr->Flags);
+}
+
+
+VOID
 NtfsDumpAttribute(PATTRIBUTE Attribute)
 {
   PNONRESIDENT_ATTRIBUTE NresAttr;
@@ -59,7 +110,7 @@ NtfsDumpAttribute(PATTRIBUTE Attribute)
        break;
 
       case AttributeFileName:
-       DbgPrint("  $FILE_NAME ");
+       NtfsDumpFileNameAttribute(Attribute);
        break;
 
       case AttributeObjectId:
@@ -71,11 +122,11 @@ NtfsDumpAttribute(PATTRIBUTE Attribute)
        break;
 
       case AttributeVolumeName:
-       DbgPrint("  $VOLUME_NAME ");
+       NtfsDumpVolumeNameAttribute(Attribute);
        break;
 
       case AttributeVolumeInformation:
-       DbgPrint("  $VOLUME_INFORMATION ");
+       NtfsDumpVolumeInformationAttribute(Attribute);
        break;
 
       case AttributeData:
@@ -130,7 +181,7 @@ NtfsDumpAttribute(PATTRIBUTE Attribute)
     }
 
   DbgPrint("(%s)\n",
-          Attribute->Nonresident ? "nonresident" : "resident");
+          Attribute->Nonresident ? "non-resident" : "resident");
 
   if (Attribute->Nonresident != 0)
     {