mirror of
https://github.com/reactos/reactos.git
synced 2025-07-23 02:13:36 +00:00
[FORMATTING] Misuse of TAB. Converted to spaces.
svn path=/trunk/; revision=29674
This commit is contained in:
parent
1b1b3c8ca6
commit
db4783f481
1 changed files with 74 additions and 74 deletions
|
@ -31,14 +31,14 @@
|
||||||
/* FUNCTIONS ****************************************************************/
|
/* FUNCTIONS ****************************************************************/
|
||||||
|
|
||||||
#define CACHEPAGESIZE(pDeviceExt) ((pDeviceExt)->FatInfo.BytesPerCluster > PAGE_SIZE ? \
|
#define CACHEPAGESIZE(pDeviceExt) ((pDeviceExt)->FatInfo.BytesPerCluster > PAGE_SIZE ? \
|
||||||
(pDeviceExt)->FatInfo.BytesPerCluster : PAGE_SIZE)
|
(pDeviceExt)->FatInfo.BytesPerCluster : PAGE_SIZE)
|
||||||
|
|
||||||
#define VOLUME_IS_DIRTY 0x00000001
|
#define VOLUME_IS_DIRTY 0x00000001
|
||||||
|
|
||||||
static NTSTATUS
|
static NTSTATUS
|
||||||
VfatHasFileSystem(PDEVICE_OBJECT DeviceToMount,
|
VfatHasFileSystem(PDEVICE_OBJECT DeviceToMount,
|
||||||
PBOOLEAN RecognizedFS,
|
PBOOLEAN RecognizedFS,
|
||||||
PFATINFO pFatInfo)
|
PFATINFO pFatInfo)
|
||||||
{
|
{
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
PARTITION_INFORMATION PartitionInfo;
|
PARTITION_INFORMATION PartitionInfo;
|
||||||
|
@ -57,12 +57,12 @@ VfatHasFileSystem(PDEVICE_OBJECT DeviceToMount,
|
||||||
|
|
||||||
Size = sizeof(DISK_GEOMETRY);
|
Size = sizeof(DISK_GEOMETRY);
|
||||||
Status = VfatBlockDeviceIoControl(DeviceToMount,
|
Status = VfatBlockDeviceIoControl(DeviceToMount,
|
||||||
IOCTL_DISK_GET_DRIVE_GEOMETRY,
|
IOCTL_DISK_GET_DRIVE_GEOMETRY,
|
||||||
NULL,
|
NULL,
|
||||||
0,
|
0,
|
||||||
&DiskGeometry,
|
&DiskGeometry,
|
||||||
&Size,
|
&Size,
|
||||||
FALSE);
|
FALSE);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT("VfatBlockDeviceIoControl faild (%x)\n", Status);
|
DPRINT("VfatBlockDeviceIoControl faild (%x)\n", Status);
|
||||||
|
@ -74,12 +74,12 @@ VfatHasFileSystem(PDEVICE_OBJECT DeviceToMount,
|
||||||
// We have found a hard disk
|
// We have found a hard disk
|
||||||
Size = sizeof(PARTITION_INFORMATION);
|
Size = sizeof(PARTITION_INFORMATION);
|
||||||
Status = VfatBlockDeviceIoControl(DeviceToMount,
|
Status = VfatBlockDeviceIoControl(DeviceToMount,
|
||||||
IOCTL_DISK_GET_PARTITION_INFO,
|
IOCTL_DISK_GET_PARTITION_INFO,
|
||||||
NULL,
|
NULL,
|
||||||
0,
|
0,
|
||||||
&PartitionInfo,
|
&PartitionInfo,
|
||||||
&Size,
|
&Size,
|
||||||
FALSE);
|
FALSE);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT("VfatBlockDeviceIoControl faild (%x)\n", Status);
|
DPRINT("VfatBlockDeviceIoControl faild (%x)\n", Status);
|
||||||
|
@ -150,10 +150,10 @@ VfatHasFileSystem(PDEVICE_OBJECT DeviceToMount,
|
||||||
*RecognizedFS = FALSE;
|
*RecognizedFS = FALSE;
|
||||||
}
|
}
|
||||||
if (*RecognizedFS &&
|
if (*RecognizedFS &&
|
||||||
Boot->BytesPerSector != 512 &&
|
Boot->BytesPerSector != 512 &&
|
||||||
Boot->BytesPerSector != 1024 &&
|
Boot->BytesPerSector != 1024 &&
|
||||||
Boot->BytesPerSector != 2048 &&
|
Boot->BytesPerSector != 2048 &&
|
||||||
Boot->BytesPerSector != 4096)
|
Boot->BytesPerSector != 4096)
|
||||||
{
|
{
|
||||||
DPRINT1("BytesPerSector %d\n", Boot->BytesPerSector);
|
DPRINT1("BytesPerSector %d\n", Boot->BytesPerSector);
|
||||||
*RecognizedFS = FALSE;
|
*RecognizedFS = FALSE;
|
||||||
|
@ -161,7 +161,7 @@ VfatHasFileSystem(PDEVICE_OBJECT DeviceToMount,
|
||||||
|
|
||||||
if (*RecognizedFS &&
|
if (*RecognizedFS &&
|
||||||
Boot->FATCount != 1 &&
|
Boot->FATCount != 1 &&
|
||||||
Boot->FATCount != 2)
|
Boot->FATCount != 2)
|
||||||
{
|
{
|
||||||
DPRINT1("FATCount %d\n", Boot->FATCount);
|
DPRINT1("FATCount %d\n", Boot->FATCount);
|
||||||
*RecognizedFS = FALSE;
|
*RecognizedFS = FALSE;
|
||||||
|
@ -239,9 +239,9 @@ VfatHasFileSystem(PDEVICE_OBJECT DeviceToMount,
|
||||||
FatInfo.RootCluster = FatInfo.rootStart / FatInfo.SectorsPerCluster;
|
FatInfo.RootCluster = FatInfo.rootStart / FatInfo.SectorsPerCluster;
|
||||||
}
|
}
|
||||||
if (PartitionInfoIsValid &&
|
if (PartitionInfoIsValid &&
|
||||||
FatInfo.Sectors > PartitionInfo.PartitionLength.QuadPart / FatInfo.BytesPerSector)
|
FatInfo.Sectors > PartitionInfo.PartitionLength.QuadPart / FatInfo.BytesPerSector)
|
||||||
{
|
{
|
||||||
CHECKPOINT1;
|
CHECKPOINT1;
|
||||||
*RecognizedFS = FALSE;
|
*RecognizedFS = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -322,7 +322,7 @@ VfatHasFileSystem(PDEVICE_OBJECT DeviceToMount,
|
||||||
FatInfo.dataStart = FatInfo.rootStart + FatInfo.rootDirectorySectors;
|
FatInfo.dataStart = FatInfo.rootStart + FatInfo.rootDirectorySectors;
|
||||||
FatInfo.NumberOfClusters = (FatInfo.Sectors - FatInfo.dataStart) / FatInfo.SectorsPerCluster;
|
FatInfo.NumberOfClusters = (FatInfo.Sectors - FatInfo.dataStart) / FatInfo.SectorsPerCluster;
|
||||||
|
|
||||||
if (pFatInfo && *RecognizedFS)
|
if (pFatInfo && *RecognizedFS)
|
||||||
{
|
{
|
||||||
*pFatInfo = FatInfo;
|
*pFatInfo = FatInfo;
|
||||||
}
|
}
|
||||||
|
@ -337,7 +337,7 @@ VfatHasFileSystem(PDEVICE_OBJECT DeviceToMount,
|
||||||
|
|
||||||
static NTSTATUS
|
static NTSTATUS
|
||||||
VfatMountDevice(PDEVICE_EXTENSION DeviceExt,
|
VfatMountDevice(PDEVICE_EXTENSION DeviceExt,
|
||||||
PDEVICE_OBJECT DeviceToMount)
|
PDEVICE_OBJECT DeviceToMount)
|
||||||
/*
|
/*
|
||||||
* FUNCTION: Mounts the device
|
* FUNCTION: Mounts the device
|
||||||
*/
|
*/
|
||||||
|
@ -421,12 +421,12 @@ VfatMount (PVFAT_IRP_CONTEXT IrpContext)
|
||||||
HashTableSize = FCB_HASH_TABLE_SIZE;
|
HashTableSize = FCB_HASH_TABLE_SIZE;
|
||||||
DPRINT("VFAT: Recognized volume\n");
|
DPRINT("VFAT: Recognized volume\n");
|
||||||
Status = IoCreateDevice(VfatGlobalData->DriverObject,
|
Status = IoCreateDevice(VfatGlobalData->DriverObject,
|
||||||
ROUND_UP(sizeof (DEVICE_EXTENSION), sizeof(ULONG)) + sizeof(HASHENTRY*) * HashTableSize,
|
ROUND_UP(sizeof (DEVICE_EXTENSION), sizeof(ULONG)) + sizeof(HASHENTRY*) * HashTableSize,
|
||||||
NULL,
|
NULL,
|
||||||
FILE_DEVICE_FILE_SYSTEM,
|
FILE_DEVICE_FILE_SYSTEM,
|
||||||
0,
|
0,
|
||||||
FALSE,
|
FALSE,
|
||||||
&DeviceObject);
|
&DeviceObject);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
goto ByeBye;
|
goto ByeBye;
|
||||||
|
@ -635,12 +635,12 @@ VfatVerify (PVFAT_IRP_CONTEXT IrpContext)
|
||||||
|
|
||||||
DeviceToVerify = IrpContext->Stack->Parameters.VerifyVolume.DeviceObject;
|
DeviceToVerify = IrpContext->Stack->Parameters.VerifyVolume.DeviceObject;
|
||||||
Status = VfatBlockDeviceIoControl(DeviceToVerify,
|
Status = VfatBlockDeviceIoControl(DeviceToVerify,
|
||||||
IOCTL_DISK_CHECK_VERIFY,
|
IOCTL_DISK_CHECK_VERIFY,
|
||||||
NULL,
|
NULL,
|
||||||
0,
|
0,
|
||||||
NULL,
|
NULL,
|
||||||
0,
|
0,
|
||||||
TRUE);
|
TRUE);
|
||||||
DeviceToVerify->Flags &= ~DO_VERIFY_VOLUME;
|
DeviceToVerify->Flags &= ~DO_VERIFY_VOLUME;
|
||||||
if (!NT_SUCCESS(Status) && Status != STATUS_VERIFY_REQUIRED)
|
if (!NT_SUCCESS(Status) && Status != STATUS_VERIFY_REQUIRED)
|
||||||
{
|
{
|
||||||
|
@ -660,13 +660,13 @@ VfatVerify (PVFAT_IRP_CONTEXT IrpContext)
|
||||||
* FIXME:
|
* FIXME:
|
||||||
* Preformated floppy disks have very often a serial number of 0000:0000.
|
* Preformated floppy disks have very often a serial number of 0000:0000.
|
||||||
* We should calculate a crc sum over the sectors from the root directory as secondary volume number.
|
* We should calculate a crc sum over the sectors from the root directory as secondary volume number.
|
||||||
* Each write to the root directory must update this crc sum.
|
* Each write to the root directory must update this crc sum.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Status = STATUS_WRONG_VOLUME;
|
Status = STATUS_WRONG_VOLUME;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -733,7 +733,7 @@ VfatGetRetrievalPointers(PVFAT_IRP_CONTEXT IrpContext)
|
||||||
CurrentCluster = FirstCluster = vfatDirEntryGetFirstCluster(DeviceExt, &Fcb->entry);
|
CurrentCluster = FirstCluster = vfatDirEntryGetFirstCluster(DeviceExt, &Fcb->entry);
|
||||||
Status = OffsetToCluster(DeviceExt, FirstCluster,
|
Status = OffsetToCluster(DeviceExt, FirstCluster,
|
||||||
Vcn.u.LowPart * DeviceExt->FatInfo.BytesPerCluster,
|
Vcn.u.LowPart * DeviceExt->FatInfo.BytesPerCluster,
|
||||||
&CurrentCluster, FALSE);
|
&CurrentCluster, FALSE);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
goto ByeBye;
|
goto ByeBye;
|
||||||
|
@ -757,13 +757,13 @@ VfatGetRetrievalPointers(PVFAT_IRP_CONTEXT IrpContext)
|
||||||
|
|
||||||
if (LastCluster + 1 != CurrentCluster)
|
if (LastCluster + 1 != CurrentCluster)
|
||||||
{
|
{
|
||||||
RetrievalPointers->Extents[RetrievalPointers->ExtentCount].NextVcn = Vcn;
|
RetrievalPointers->Extents[RetrievalPointers->ExtentCount].NextVcn = Vcn;
|
||||||
RetrievalPointers->ExtentCount++;
|
RetrievalPointers->ExtentCount++;
|
||||||
if (RetrievalPointers->ExtentCount < MaxExtentCount)
|
if (RetrievalPointers->ExtentCount < MaxExtentCount)
|
||||||
{
|
{
|
||||||
RetrievalPointers->Extents[RetrievalPointers->ExtentCount].Lcn.u.HighPart = 0;
|
RetrievalPointers->Extents[RetrievalPointers->ExtentCount].Lcn.u.HighPart = 0;
|
||||||
RetrievalPointers->Extents[RetrievalPointers->ExtentCount].Lcn.u.LowPart = CurrentCluster - 2;
|
RetrievalPointers->Extents[RetrievalPointers->ExtentCount].Lcn.u.LowPart = CurrentCluster - 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -878,45 +878,45 @@ NTSTATUS VfatFileSystemControl(PVFAT_IRP_CONTEXT IrpContext)
|
||||||
{
|
{
|
||||||
case IRP_MN_USER_FS_REQUEST:
|
case IRP_MN_USER_FS_REQUEST:
|
||||||
switch(IrpContext->Stack->Parameters.DeviceIoControl.IoControlCode)
|
switch(IrpContext->Stack->Parameters.DeviceIoControl.IoControlCode)
|
||||||
{
|
{
|
||||||
case FSCTL_GET_VOLUME_BITMAP:
|
case FSCTL_GET_VOLUME_BITMAP:
|
||||||
Status = VfatGetVolumeBitmap(IrpContext);
|
Status = VfatGetVolumeBitmap(IrpContext);
|
||||||
break;
|
break;
|
||||||
case FSCTL_GET_RETRIEVAL_POINTERS:
|
case FSCTL_GET_RETRIEVAL_POINTERS:
|
||||||
Status = VfatGetRetrievalPointers(IrpContext);
|
Status = VfatGetRetrievalPointers(IrpContext);
|
||||||
break;
|
break;
|
||||||
case FSCTL_MOVE_FILE:
|
case FSCTL_MOVE_FILE:
|
||||||
Status = VfatMoveFile(IrpContext);
|
Status = VfatMoveFile(IrpContext);
|
||||||
break;
|
break;
|
||||||
#ifdef USE_ROS_CC_AND_FS
|
#ifdef USE_ROS_CC_AND_FS
|
||||||
case FSCTL_ROS_QUERY_LCN_MAPPING:
|
case FSCTL_ROS_QUERY_LCN_MAPPING:
|
||||||
Status = VfatRosQueryLcnMapping(IrpContext);
|
Status = VfatRosQueryLcnMapping(IrpContext);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
case FSCTL_IS_VOLUME_DIRTY:
|
case FSCTL_IS_VOLUME_DIRTY:
|
||||||
Status = VfatIsVolumeDirty(IrpContext);
|
Status = VfatIsVolumeDirty(IrpContext);
|
||||||
break;
|
break;
|
||||||
case FSCTL_MARK_VOLUME_DIRTY:
|
case FSCTL_MARK_VOLUME_DIRTY:
|
||||||
Status = VfatMarkVolumeDirty(IrpContext);
|
Status = VfatMarkVolumeDirty(IrpContext);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Status = STATUS_INVALID_DEVICE_REQUEST;
|
Status = STATUS_INVALID_DEVICE_REQUEST;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case IRP_MN_MOUNT_VOLUME:
|
case IRP_MN_MOUNT_VOLUME:
|
||||||
Status = VfatMount(IrpContext);
|
Status = VfatMount(IrpContext);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case IRP_MN_VERIFY_VOLUME:
|
case IRP_MN_VERIFY_VOLUME:
|
||||||
DPRINT("VFATFS: IRP_MN_VERIFY_VOLUME\n");
|
DPRINT("VFATFS: IRP_MN_VERIFY_VOLUME\n");
|
||||||
Status = VfatVerify(IrpContext);
|
Status = VfatVerify(IrpContext);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
DPRINT("VFAT FSC: MinorFunction %d\n", IrpContext->MinorFunction);
|
DPRINT("VFAT FSC: MinorFunction %d\n", IrpContext->MinorFunction);
|
||||||
Status = STATUS_INVALID_DEVICE_REQUEST;
|
Status = STATUS_INVALID_DEVICE_REQUEST;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
IrpContext->Irp->IoStatus.Status = Status;
|
IrpContext->Irp->IoStatus.Status = Status;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue