Commit in reactos/drivers/fs/cdfs on MAIN
finfo.c+35-91.9 -> 1.10
dirctl.c+34-111.14 -> 1.15
+69-20
2 modified files
- Don't return a file or allocation size for directories.

reactos/drivers/fs/cdfs
finfo.c 1.9 -> 1.10
diff -u -r1.9 -r1.10
--- finfo.c	8 Mar 2004 08:51:26 -0000	1.9
+++ finfo.c	23 May 2004 13:31:25 -0000	1.10
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: finfo.c,v 1.9 2004/03/08 08:51:26 ekohl Exp $
+/* $Id: finfo.c,v 1.10 2004/05/23 13:31:25 hbirr Exp $
  *
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
@@ -60,11 +60,20 @@
   RtlZeroMemory(StandardInfo,
 		sizeof(FILE_STANDARD_INFORMATION));
 
-  StandardInfo->AllocationSize = Fcb->RFCB.AllocationSize;
-  StandardInfo->EndOfFile = Fcb->RFCB.FileSize;
+  if (CdfsFCBIsDirectory(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 = TRUE;
+    }
   StandardInfo->NumberOfLinks = 0;
   StandardInfo->DeletePending = FALSE;
-  StandardInfo->Directory = Fcb->Entry.FileFlags & 0x02 ? TRUE : FALSE;
 
   *BufferLength -= sizeof(FILE_STANDARD_INFORMATION);
   return(STATUS_SUCCESS);
@@ -207,8 +216,16 @@
 			 &NetworkInfo->LastWriteTime);
   CdfsDateTimeToFileTime(Fcb,
 			 &NetworkInfo->ChangeTime);
-  NetworkInfo->AllocationSize = Fcb->RFCB.AllocationSize;
-  NetworkInfo->EndOfFile = Fcb->RFCB.FileSize;
+  if (CdfsFCBIsDirectory(Fcb))
+    {
+      NetworkInfo->AllocationSize.QuadPart = 0LL;;
+      NetworkInfo->EndOfFile.QuadPart = 0LL;
+    }
+  else
+    {
+      NetworkInfo->AllocationSize = Fcb->RFCB.AllocationSize;
+      NetworkInfo->EndOfFile = Fcb->RFCB.FileSize;
+    }
   CdfsFileFlagsToAttributes(Fcb,
 			    &NetworkInfo->FileAttributes);
 
@@ -249,11 +266,20 @@
 			    &Info->BasicInformation.FileAttributes);
 
   /* Standard Information */
-  Info->StandardInformation.AllocationSize = Fcb->RFCB.AllocationSize;
-  Info->StandardInformation.EndOfFile = Fcb->RFCB.FileSize;
+  if (CdfsFCBIsDirectory(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 = FALSE;
-  Info->StandardInformation.Directory = Fcb->Entry.FileFlags & FILE_FLAG_DIRECTORY ? TRUE : FALSE;
 
   /* Internal Information */
   Info->InternalInformation.IndexNumber.QuadPart = Fcb->IndexNumber.QuadPart;

reactos/drivers/fs/cdfs
dirctl.c 1.14 -> 1.15
diff -u -r1.14 -r1.15
--- dirctl.c	13 Nov 2003 15:25:08 -0000	1.14
+++ dirctl.c	23 May 2004 13:31:25 -0000	1.15
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: dirctl.c,v 1.14 2003/11/13 15:25:08 ekohl Exp $
+/* $Id: dirctl.c,v 1.15 2004/05/23 13:31:25 hbirr Exp $
  *
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
@@ -420,11 +420,18 @@
   /* Convert file flags */
   CdfsFileFlagsToAttributes(Fcb,
 			    &Info->FileAttributes);
+  if (CdfsFCBIsDirectory(Fcb))
+    {
+      Info->EndOfFile.QuadPart = 0LL;
+      Info->AllocationSize.QuadPart = 0LL;
+    }
+  else
+    {
+      Info->EndOfFile.QuadPart = Fcb->Entry.DataLengthL;
 
-  Info->EndOfFile.QuadPart = Fcb->Entry.DataLengthL;
-
-  /* Make AllocSize a rounded up multiple of the sector size */
-  Info->AllocationSize.QuadPart = ROUND_UP(Fcb->Entry.DataLengthL, BLOCKSIZE);
+      /* Make AllocSize a rounded up multiple of the sector size */
+      Info->AllocationSize.QuadPart = ROUND_UP(Fcb->Entry.DataLengthL, BLOCKSIZE);
+    }
 
 //  Info->FileIndex=;
 
@@ -465,10 +472,18 @@
   CdfsFileFlagsToAttributes(Fcb,
 			    &Info->FileAttributes);
 
-  Info->EndOfFile.QuadPart = Fcb->Entry.DataLengthL;
+  if (CdfsFCBIsDirectory(Fcb))
+    {
+      Info->EndOfFile.QuadPart = 0LL;
+      Info->AllocationSize.QuadPart = 0LL;
+    }
+  else
+    {
+      Info->EndOfFile.QuadPart = Fcb->Entry.DataLengthL;
 
-  /* Make AllocSize a rounded up multiple of the sector size */
-  Info->AllocationSize.QuadPart = ROUND_UP(Fcb->Entry.DataLengthL, BLOCKSIZE);
+      /* Make AllocSize a rounded up multiple of the sector size */
+      Info->AllocationSize.QuadPart = ROUND_UP(Fcb->Entry.DataLengthL, BLOCKSIZE);
+    }
 
 //  Info->FileIndex=;
   Info->EaSize = 0;
@@ -510,10 +525,18 @@
   CdfsFileFlagsToAttributes(Fcb,
 			    &Info->FileAttributes);
 
-  Info->EndOfFile.QuadPart = Fcb->Entry.DataLengthL;
+  if (CdfsFCBIsDirectory(Fcb))
+    {
+      Info->EndOfFile.QuadPart = 0LL;
+      Info->AllocationSize.QuadPart = 0LL;
+    }
+  else
+    {
+      Info->EndOfFile.QuadPart = Fcb->Entry.DataLengthL;
 
-  /* Make AllocSize a rounded up multiple of the sector size */
-  Info->AllocationSize.QuadPart = ROUND_UP(Fcb->Entry.DataLengthL, BLOCKSIZE);
+      /* Make AllocSize a rounded up multiple of the sector size */
+      Info->AllocationSize.QuadPart = ROUND_UP(Fcb->Entry.DataLengthL, BLOCKSIZE);
+    }
 
 //  Info->FileIndex=;
   Info->EaSize = 0;
CVSspam 0.2.8