- Print the file information class if debug prints are enabled in VfatGet/SetInformation.  
- Check for the open handle count instead of the reference count if file deletion is requested.
Modified: trunk/reactos/drivers/fs/vfat/finfo.c

Modified: trunk/reactos/drivers/fs/vfat/finfo.c
--- trunk/reactos/drivers/fs/vfat/finfo.c	2005-01-25 21:09:55 UTC (rev 13279)
+++ trunk/reactos/drivers/fs/vfat/finfo.c	2005-01-25 21:10:42 UTC (rev 13280)
@@ -15,6 +15,54 @@
 #define NDEBUG
 #include "vfat.h"
 
+/* GLOBALS ******************************************************************/
+
+const char* FileInformationClassNames[] = 
+{
+  "??????",
+  "FileDirectoryInformation",
+  "FileFullDirectoryInformation",
+  "FileBothDirectoryInformation",
+  "FileBasicInformation",
+  "FileStandardInformation",
+  "FileInternalInformation",
+  "FileEaInformation",
+  "FileAccessInformation",
+  "FileNameInformation",
+  "FileRenameInformation",
+  "FileLinkInformation",
+  "FileNamesInformation",
+  "FileDispositionInformation",
+  "FilePositionInformation",
+  "FileFullEaInformation",
+  "FileModeInformation",
+  "FileAlignmentInformation",
+  "FileAllInformation",
+  "FileAllocationInformation",
+  "FileEndOfFileInformation",
+  "FileAlternateNameInformation",
+  "FileStreamInformation",
+  "FilePipeInformation",
+  "FilePipeLocalInformation",
+  "FilePipeRemoteInformation",
+  "FileMailslotQueryInformation",
+  "FileMailslotSetInformation",
+  "FileCompressionInformation",
+  "FileObjectIdInformation",
+  "FileCompletionInformation",
+  "FileMoveClusterInformation",
+  "FileQuotaInformation",
+  "FileReparsePointInformation",
+  "FileNetworkOpenInformation",
+  "FileAttributeTagInformation",
+  "FileTrackingInformation",
+  "FileIdBothDirectoryInformation",
+  "FileIdFullDirectoryInformation",
+  "FileValidDataLengthInformation",
+  "FileShortNameInformation",
+  "FileMaximumInformation"
+};
+
 /* FUNCTIONS ****************************************************************/
 
 static NTSTATUS
@@ -248,9 +296,9 @@
     {
       if (MmFlushImageSection (FileObject->SectionObjectPointer, MmFlushForDelete))
         {
-          if (FCB->RefCount > 1)
+          if (FCB->OpenHandleCount > 1)
             {
-	      DPRINT1("%d %x\n", FCB->RefCount, CcGetFileObjectFromSectionPtrs(FileObject->SectionObjectPointer));
+	      DPRINT1("%d %x\n", FCB->OpenHandleCount, CcGetFileObjectFromSectionPtrs(FileObject->SectionObjectPointer));
               Status = STATUS_ACCESS_DENIED;
             }
           else
@@ -650,6 +698,10 @@
   FileInformationClass = IrpContext->Stack->Parameters.QueryFile.FileInformationClass;
   FCB = (PVFATFCB) IrpContext->FileObject->FsContext;
 
+  DPRINT("VfatQueryInformation is called for '%s'\n", 
+         FileInformationClass >= FileMaximumInformation - 1 ? "????" : FileInformationClassNames[FileInformationClass]);
+
+
   SystemBuffer = IrpContext->Irp->AssociatedIrp.SystemBuffer;
   BufferLength = IrpContext->Stack->Parameters.QueryFile.Length;
 
@@ -754,6 +806,9 @@
     IrpContext->Stack->Parameters.SetFile.FileInformationClass;
   FCB = (PVFATFCB) IrpContext->FileObject->FsContext;
   SystemBuffer = IrpContext->Irp->AssociatedIrp.SystemBuffer;
+
+  DPRINT("VfatSetInformation is called for '%s'\n", 
+         FileInformationClass >= FileMaximumInformation - 1 ? "????" : FileInformationClassNames[ FileInformationClass]);
   
   DPRINT("FileInformationClass %d\n", FileInformationClass);
   DPRINT("SystemBuffer %x\n", SystemBuffer);