Commit in reactos/drivers/fs on MAIN
cdfs/fsctl.c+2-21.18 -> 1.19
vfat/fsctl.c+38-311.27 -> 1.28
+40-33
2 modified files
Arty's summary:
drivers/fs/cdfs/fsctl: Allocate wide chars.  CD title was being truncated
drivers/fs/vfat/fsctl: Tolerate a zero bytes-per-sector
Patches by Herve Poussineau

reactos/drivers/fs/cdfs
fsctl.c 1.18 -> 1.19
diff -u -r1.18 -r1.19
--- fsctl.c	8 Mar 2004 08:51:26 -0000	1.18
+++ fsctl.c	16 Mar 2004 08:30:28 -0000	1.19
@@ -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: fsctl.c,v 1.18 2004/03/08 08:51:26 ekohl Exp $
+/* $Id: fsctl.c,v 1.19 2004/03/16 08:30:28 arty Exp $
  *
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
@@ -83,7 +83,7 @@
       *pw++ = (WCHAR)*pc++;
     }
   *pw = 0;
-  CdInfo->VolumeLabelLength = i;
+  CdInfo->VolumeLabelLength = i * sizeof(WCHAR);
 
   CdInfo->VolumeSpaceSize = Pvd->VolumeSpaceSizeL;
   CdInfo->RootStart = Pvd->RootDirRecord.ExtentLocationL;

reactos/drivers/fs/vfat
fsctl.c 1.27 -> 1.28
diff -u -r1.27 -r1.28
--- fsctl.c	28 Jan 2004 20:53:46 -0000	1.27
+++ fsctl.c	16 Mar 2004 08:30:28 -0000	1.28
@@ -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: fsctl.c,v 1.27 2004/01/28 20:53:46 ekohl Exp $
+/* $Id: fsctl.c,v 1.28 2004/03/16 08:30:28 arty Exp $
  *
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
@@ -127,40 +127,47 @@
    Status = VfatReadDisk(DeviceToMount, &Offset, DiskGeometry.BytesPerSector, (PUCHAR) Boot, FALSE);
    if (NT_SUCCESS(Status))
    {
-      FatInfo.VolumeID = Boot->VolumeID;
-      FatInfo.FATStart = Boot->ReservedSectors;
-      FatInfo.FATCount = Boot->FATCount;
-      FatInfo.FATSectors = Boot->FATSectors ? Boot->FATSectors : ((struct _BootSector32*) Boot)->FATSectors32;
-      FatInfo.BytesPerSector = Boot->BytesPerSector;
-      FatInfo.SectorsPerCluster = Boot->SectorsPerCluster;
-      FatInfo.BytesPerCluster = FatInfo.BytesPerSector * FatInfo.SectorsPerCluster;
-      FatInfo.rootDirectorySectors = ((Boot->RootEntries * 32) + Boot->BytesPerSector - 1) / Boot->BytesPerSector;
-      FatInfo.rootStart = FatInfo.FATStart + FatInfo.FATCount * FatInfo.FATSectors;
-      FatInfo.dataStart = FatInfo.rootStart + FatInfo.rootDirectorySectors;
-      FatInfo.Sectors = Sectors = Boot->Sectors ? Boot->Sectors : Boot->SectorsHuge;
-      Sectors -= Boot->ReservedSectors + FatInfo.FATCount * FatInfo.FATSectors + FatInfo.rootDirectorySectors;
-      FatInfo.NumberOfClusters = Sectors / Boot->SectorsPerCluster;
-      if (FatInfo.NumberOfClusters < 4085)
+      if (Boot->BytesPerSector != 0)
       {
-         DPRINT("FAT12\n");
-         FatInfo.FatType = FAT12;
-      }
-      else if (FatInfo.NumberOfClusters >= 65525)
-      {
-         DPRINT("FAT32\n");
-         FatInfo.FatType = FAT32;
-         FatInfo.RootCluster = ((struct _BootSector32*) Boot)->RootCluster;
-         FatInfo.rootStart = FatInfo.dataStart + ((FatInfo.RootCluster - 2) * FatInfo.SectorsPerCluster);
-         FatInfo.VolumeID = ((struct _BootSector32*) Boot)->VolumeID;
+         FatInfo.VolumeID = Boot->VolumeID;
+         FatInfo.FATStart = Boot->ReservedSectors;
+         FatInfo.FATCount = Boot->FATCount;
+         FatInfo.FATSectors = Boot->FATSectors ? Boot->FATSectors : ((struct _BootSector32*) Boot)->FATSectors32;
+         FatInfo.BytesPerSector = Boot->BytesPerSector;
+         FatInfo.SectorsPerCluster = Boot->SectorsPerCluster;
+         FatInfo.BytesPerCluster = FatInfo.BytesPerSector * FatInfo.SectorsPerCluster;
+         FatInfo.rootDirectorySectors = ((Boot->RootEntries * 32) + Boot->BytesPerSector - 1) / Boot->BytesPerSector;
+         FatInfo.rootStart = FatInfo.FATStart + FatInfo.FATCount * FatInfo.FATSectors;
+         FatInfo.dataStart = FatInfo.rootStart + FatInfo.rootDirectorySectors;
+         FatInfo.Sectors = Sectors = Boot->Sectors ? Boot->Sectors : Boot->SectorsHuge;
+         Sectors -= Boot->ReservedSectors + FatInfo.FATCount * FatInfo.FATSectors + FatInfo.rootDirectorySectors;
+         FatInfo.NumberOfClusters = Sectors / Boot->SectorsPerCluster;
+         if (FatInfo.NumberOfClusters < 4085)
+         {
+            DPRINT("FAT12\n");
+            FatInfo.FatType = FAT12;
+         }
+         else if (FatInfo.NumberOfClusters >= 65525)
+         {
+            DPRINT("FAT32\n");
+            FatInfo.FatType = FAT32;
+            FatInfo.RootCluster = ((struct _BootSector32*) Boot)->RootCluster;
+            FatInfo.rootStart = FatInfo.dataStart + ((FatInfo.RootCluster - 2) * FatInfo.SectorsPerCluster);
+            FatInfo.VolumeID = ((struct _BootSector32*) Boot)->VolumeID;
+         }
+         else
+         {
+            DPRINT("FAT16\n");
+            FatInfo.FatType = FAT16;
+         }
+         if (pFatInfo)
+         {
+            *pFatInfo = FatInfo;
+         }
       }
       else
       {
-         DPRINT("FAT16\n");
-         FatInfo.FatType = FAT16;
-      }
-      if (pFatInfo)
-      {
-         *pFatInfo = FatInfo;
+      	Status = STATUS_INSUFFICIENT_RESOURCES;
       }
    }
    ExFreePool(Boot);
CVSspam 0.2.8