Commit in reactos/drivers/fs/vfat on MAIN
finfo.c+38-151.34 -> 1.35
dir.c+31-151.33 -> 1.34
+69-30
2 modified files
- Don't return a file or allocation size for directories.

reactos/drivers/fs/vfat
finfo.c 1.34 -> 1.35
diff -u -r1.34 -r1.35
--- finfo.c	11 Oct 2003 17:51:56 -0000	1.34
+++ finfo.c	23 May 2004 13:34:32 -0000	1.35
@@ -1,4 +1,4 @@
-/* $Id: finfo.c,v 1.34 2003/10/11 17:51:56 hbirr Exp $
+/* $Id: finfo.c,v 1.35 2004/05/23 13:34:32 hbirr Exp $
  *
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
@@ -37,14 +37,20 @@
   assert (StandardInfo != NULL);
   assert (FCB != NULL);
 
-  RtlZeroMemory(StandardInfo,
-		sizeof(FILE_STANDARD_INFORMATION));
-
-  StandardInfo->AllocationSize = FCB->RFCB.AllocationSize;
-  StandardInfo->EndOfFile = FCB->RFCB.FileSize;
+  if (vfatFCBIsDirectory(FCB))
+    {
+      StandardInfo->AllocationSize.QuadPart = 0LL;
+      StandardInfo->EndOfFile.QuadPart = 0LL;
+      StandardInfo->Directory = TRUE;
+    }
+  else
+    {
+      StandardInfo->AllocationSize = FCB->RFCB.AllocationSize;
+      StandardInfo->EndOfFile = FCB->RFCB.FileSize;
+      StandardInfo->Directory = FALSE;
+    }
   StandardInfo->NumberOfLinks = 0;
   StandardInfo->DeletePending = FCB->Flags & FCB_DELETE_PENDING ? TRUE : FALSE;
-  StandardInfo->Directory = FCB->entry.Attrib & 0x10 ? TRUE : FALSE;
 
   *BufferLength -= sizeof(FILE_STANDARD_INFORMATION);
   return(STATUS_SUCCESS);
@@ -148,7 +154,7 @@
 			   (TIME *)&BasicInfo->LastWriteTime);
   BasicInfo->ChangeTime = BasicInfo->LastWriteTime;
 
-  BasicInfo->FileAttributes = FCB->entry.Attrib;
+  BasicInfo->FileAttributes = FCB->entry.Attrib & 0x3f;
   /* Synthesize FILE_ATTRIBUTE_NORMAL */
   if (0 == (BasicInfo->FileAttributes & (FILE_ATTRIBUTE_DIRECTORY |
                                          FILE_ATTRIBUTE_ARCHIVE |
@@ -299,9 +305,17 @@
 			   Fcb->entry.UpdateTime,
 			   &NetworkInfo->LastWriteTime);
   NetworkInfo->ChangeTime = NetworkInfo->LastWriteTime;
-  NetworkInfo->AllocationSize = Fcb->RFCB.AllocationSize;
-  NetworkInfo->EndOfFile = Fcb->RFCB.FileSize;
-  NetworkInfo->FileAttributes = Fcb->entry.Attrib;
+  if (vfatFCBIsDirectory(Fcb))
+    {
+      NetworkInfo->EndOfFile.QuadPart = 0L;
+      NetworkInfo->AllocationSize.QuadPart = 0L;
+    }
+  else
+    {
+      NetworkInfo->AllocationSize = Fcb->RFCB.AllocationSize;
+      NetworkInfo->EndOfFile = Fcb->RFCB.FileSize;
+    }
+  NetworkInfo->FileAttributes = Fcb->entry.Attrib & 0x3f;
 
   *BufferLength -= sizeof(FILE_NETWORK_OPEN_INFORMATION);
   return STATUS_SUCCESS;
@@ -335,14 +349,23 @@
 			   Fcb->entry.UpdateTime,
 			   (TIME *)&Info->BasicInformation.LastWriteTime);
   Info->BasicInformation.ChangeTime = Info->BasicInformation.LastWriteTime;
-  Info->BasicInformation.FileAttributes = Fcb->entry.Attrib;
+  Info->BasicInformation.FileAttributes = Fcb->entry.Attrib & 0x3f;
 
   /* Standard Information */
-  Info->StandardInformation.AllocationSize = Fcb->RFCB.AllocationSize;
-  Info->StandardInformation.EndOfFile = Fcb->RFCB.FileSize;
+  if (vfatFCBIsDirectory(Fcb))
+    {
+      Info->StandardInformation.AllocationSize.QuadPart = 0LL;
+      Info->StandardInformation.EndOfFile.QuadPart = 0LL;
+      Info->StandardInformation.Directory = TRUE;
+    }
+  else
+    {
+      Info->StandardInformation.AllocationSize = Fcb->RFCB.AllocationSize;
+      Info->StandardInformation.EndOfFile = Fcb->RFCB.FileSize;
+      Info->StandardInformation.Directory = FALSE;
+    }
   Info->StandardInformation.NumberOfLinks = 0;
   Info->StandardInformation.DeletePending = Fcb->Flags & FCB_DELETE_PENDING ? TRUE : FALSE;
-  Info->StandardInformation.Directory = Fcb->entry.Attrib & 0x10 ? TRUE : FALSE;
 
   /* Internal Information */
   /* FIXME: get a real index, that can be used in a create operation */

reactos/drivers/fs/vfat
dir.c 1.33 -> 1.34
diff -u -r1.33 -r1.34
--- dir.c	13 Dec 2003 14:25:04 -0000	1.33
+++ dir.c	23 May 2004 13:34:32 -0000	1.34
@@ -1,5 +1,5 @@
 /*
- * $Id: dir.c,v 1.33 2003/12/13 14:25:04 ekohl Exp $
+ * $Id: dir.c,v 1.34 2004/05/23 13:34:32 hbirr Exp $
  *
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
@@ -110,12 +110,20 @@
   FsdDosDateTimeToFileTime (DirContext->FatDirEntry.UpdateDate, 
                             DirContext->FatDirEntry.UpdateTime, &pInfo->LastWriteTime);
   pInfo->ChangeTime = pInfo->LastWriteTime;
-  pInfo->EndOfFile.u.HighPart = 0;
-  pInfo->EndOfFile.u.LowPart = DirContext->FatDirEntry.FileSize;
-  /* Make allocsize a rounded up multiple of BytesPerCluster */
-  pInfo->AllocationSize.u.HighPart = 0;
-  pInfo->AllocationSize.u.LowPart = ROUND_UP(DirContext->FatDirEntry.FileSize, DeviceExt->FatInfo.BytesPerCluster);
-  pInfo->FileAttributes = DirContext->FatDirEntry.Attrib;
+  if (DirContext->FatDirEntry.Attrib & FILE_ATTRIBUTE_DIRECTORY)
+    {
+      pInfo->EndOfFile.QuadPart = 0LL;
+      pInfo->AllocationSize.QuadPart = 0LL;
+    }
+  else
+    {
+      pInfo->EndOfFile.u.HighPart = 0;
+      pInfo->EndOfFile.u.LowPart = DirContext->FatDirEntry.FileSize;
+      /* Make allocsize a rounded up multiple of BytesPerCluster */
+      pInfo->AllocationSize.u.HighPart = 0;
+      pInfo->AllocationSize.u.LowPart = ROUND_UP(DirContext->FatDirEntry.FileSize, DeviceExt->FatInfo.BytesPerCluster);
+    }
+  pInfo->FileAttributes = DirContext->FatDirEntry.Attrib & 0x3f;
 
   return STATUS_SUCCESS;
 }
@@ -145,7 +153,7 @@
   /* Make allocsize a rounded up multiple of BytesPerCluster */
   pInfo->AllocationSize.u.HighPart = 0;
   pInfo->AllocationSize.u.LowPart = ROUND_UP(DirContext->FatDirEntry.FileSize, DeviceExt->FatInfo.BytesPerCluster);
-  pInfo->FileAttributes = DirContext->FatDirEntry.Attrib;
+  pInfo->FileAttributes = DirContext->FatDirEntry.Attrib & 0x3f;
 //      pInfo->EaSize=;
   return STATUS_SUCCESS;
 }
@@ -172,13 +180,21 @@
   FsdDosDateTimeToFileTime (DirContext->FatDirEntry.UpdateDate, 
                             DirContext->FatDirEntry.UpdateTime, &pInfo->LastWriteTime);
   pInfo->ChangeTime = pInfo->LastWriteTime;
-  pInfo->EndOfFile.u.HighPart = 0;
-  pInfo->EndOfFile.u.LowPart = DirContext->FatDirEntry.FileSize;
-  /* Make allocsize a rounded up multiple of BytesPerCluster */
-  pInfo->AllocationSize.u.HighPart = 0;
-  pInfo->AllocationSize.u.LowPart = ROUND_UP(DirContext->FatDirEntry.FileSize, DeviceExt->FatInfo.BytesPerCluster);
-  pInfo->FileAttributes = DirContext->FatDirEntry.Attrib;
-//      pInfo->EaSize=;
+  if (DirContext->FatDirEntry.Attrib & FILE_ATTRIBUTE_DIRECTORY)
+    {
+      pInfo->EndOfFile.QuadPart = 0LL;
+      pInfo->AllocationSize.QuadPart = 0LL;
+    }
+  else
+    {
+      pInfo->EndOfFile.u.HighPart = 0;
+      pInfo->EndOfFile.u.LowPart = DirContext->FatDirEntry.FileSize;
+      /* Make allocsize a rounded up multiple of BytesPerCluster */
+      pInfo->AllocationSize.u.HighPart = 0;
+      pInfo->AllocationSize.u.LowPart = ROUND_UP(DirContext->FatDirEntry.FileSize, DeviceExt->FatInfo.BytesPerCluster);
+    }
+  pInfo->FileAttributes = DirContext->FatDirEntry.Attrib & 0x3f;
+  pInfo->EaSize=0;
   return STATUS_SUCCESS;
 }
 
CVSspam 0.2.8