X-Git-Url: http://git.jankratochvil.net/?p=reactos.git;a=blobdiff_plain;f=drivers%2Ffs%2Fvfat%2Ffat.c;h=c4356020bb1d18a43b66b2d23ff975cb3e6ffba4;hp=499f1a3d09a88c2ae0dfd9a59183421f8fb7cd6b;hb=03af8776dc14167b078911b0c7c5327d1bcdd128;hpb=f4077c1bf64ef89d74a8d4822d2d7aada3ba9927 diff --git a/drivers/fs/vfat/fat.c b/drivers/fs/vfat/fat.c index 499f1a3..c435602 100644 --- a/drivers/fs/vfat/fat.c +++ b/drivers/fs/vfat/fat.c @@ -632,7 +632,7 @@ WriteCluster(PDEVICE_EXTENSION DeviceExt, return(Status); } -ULONG +ULONGLONG ClusterToSector(PDEVICE_EXTENSION DeviceExt, ULONG Cluster) /* @@ -641,7 +641,8 @@ ClusterToSector(PDEVICE_EXTENSION DeviceExt, */ { return DeviceExt->FatInfo.dataStart + - ((Cluster - 2) * DeviceExt->FatInfo.SectorsPerCluster); + ((ULONGLONG)(Cluster - 2) * DeviceExt->FatInfo.SectorsPerCluster); + } NTSTATUS @@ -774,44 +775,4 @@ GetNextCluster(PDEVICE_EXTENSION DeviceExt, return(Status); } - -NTSTATUS -GetNextSector(PDEVICE_EXTENSION DeviceExt, - ULONG CurrentSector, - PULONG NextSector, - BOOLEAN Extend) -/* Some functions don't have access to the cluster they're really reading from. - Maybe this is a dirty solution, but it will allow them to handle fragmentation. */ -{ - NTSTATUS Status; - - DPRINT("GetNextSector(DeviceExt %x, CurrentSector %x)\n", - DeviceExt, - CurrentSector); - if (CurrentSectorFatInfo.dataStart || ((CurrentSector - DeviceExt->FatInfo.dataStart + 1) % DeviceExt->FatInfo.SectorsPerCluster)) - /* Basically, if the next sequential sector would be on a cluster border, then we'll need to check in the FAT */ - { - (*NextSector)=CurrentSector+1; - return (STATUS_SUCCESS); - } - else - { - CurrentSector = (CurrentSector - DeviceExt->FatInfo.dataStart) / DeviceExt->FatInfo.SectorsPerCluster + 2; - - Status = GetNextCluster(DeviceExt, CurrentSector, NextSector, Extend); - if (!NT_SUCCESS(Status)) - { - return(Status); - } - if ((*NextSector) == 0 || (*NextSector) == 0xffffffff) - { - /* The caller wants to know a sector. These FAT codes don't correspond to any sector. */ - return(STATUS_UNSUCCESSFUL); - } - - (*NextSector) = ClusterToSector(DeviceExt,(*NextSector)); - return(STATUS_SUCCESS); - } -} - /* EOF */