Author: ekohl
Date: Mon Jun 1 15:00:51 2015
New Revision: 67990
URL:
http://svn.reactos.org/svn/reactos?rev=67990&view=rev
Log:
[CDFS]
Fix indentation and coding style. No code changes!
Modified:
trunk/reactos/drivers/filesystems/cdfs/fsctl.c
trunk/reactos/drivers/filesystems/cdfs/volinfo.c
Modified: trunk/reactos/drivers/filesystems/cdfs/fsctl.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/cdfs/f…
==============================================================================
--- trunk/reactos/drivers/filesystems/cdfs/fsctl.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/cdfs/fsctl.c [iso-8859-1] Mon Jun 1 15:00:51 2015
@@ -19,7 +19,7 @@
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
-* FILE: drivers/fs/cdfs/fsctl.c
+* FILE: drivers/filesystems/cdfs/fsctl.c
* PURPOSE: CDROM (ISO 9660) filesystem driver
* PROGRAMMER: Art Yerkes
* Eric Kohl
@@ -41,9 +41,11 @@
}
-static VOID
-CdfsGetPVDData(PUCHAR Buffer,
- PCDINFO CdInfo)
+static
+VOID
+CdfsGetPVDData(
+ PUCHAR Buffer,
+ PCDINFO CdInfo)
{
PPVD Pvd;
USHORT i;
@@ -150,9 +152,11 @@
}
-static VOID
-CdfsGetSVDData(PUCHAR Buffer,
- PCDINFO CdInfo)
+static
+VOID
+CdfsGetSVDData(
+ PUCHAR Buffer,
+ PCDINFO CdInfo)
{
PSVD Svd;
ULONG JolietLevel = 0;
@@ -190,9 +194,11 @@
}
-static NTSTATUS
-CdfsGetVolumeData(PDEVICE_OBJECT DeviceObject,
- PCDINFO CdInfo)
+static
+NTSTATUS
+CdfsGetVolumeData(
+ PDEVICE_OBJECT DeviceObject,
+ PCDINFO CdInfo)
{
PUCHAR Buffer;
NTSTATUS Status;
@@ -210,12 +216,12 @@
Size = sizeof(Toc);
Status = CdfsDeviceIoControl(DeviceObject,
- IOCTL_CDROM_READ_TOC,
- NULL,
- 0,
- &Toc,
- &Size,
- TRUE);
+ IOCTL_CDROM_READ_TOC,
+ NULL,
+ 0,
+ &Toc,
+ &Size,
+ TRUE);
if (!NT_SUCCESS(Status))
{
ExFreePoolWithTag(Buffer, CDFS_TAG);
@@ -223,7 +229,7 @@
}
DPRINT("FirstTrack %u, LastTrack %u, TrackNumber %u\n",
- Toc.FirstTrack, Toc.LastTrack, Toc.TrackData[0].TrackNumber);
+ Toc.FirstTrack, Toc.LastTrack, Toc.TrackData[0].TrackNumber);
Offset = Toc.TrackData[0].Address[1] * 60 * 75;
Offset += Toc.TrackData[0].Address[2] * 75;
@@ -245,11 +251,11 @@
for (Sector = CDFS_PRIMARY_DESCRIPTOR_LOCATION; Sector < 100 && Buffer[0]
!= 255; Sector++)
{
/* Read the Primary Volume Descriptor (PVD) */
- Status = CdfsReadSectors (DeviceObject,
- Sector + Offset,
- 1,
- Buffer,
- TRUE);
+ Status = CdfsReadSectors(DeviceObject,
+ Sector + Offset,
+ 1,
+ Buffer,
+ TRUE);
if (!NT_SUCCESS(Status))
{
ExFreePoolWithTag(Buffer, CDFS_TAG);
@@ -270,43 +276,45 @@
switch (VdHeader->VdType)
{
- case 0:
- DPRINT("BootVolumeDescriptor found!\n");
- break;
-
- case 1:
- DPRINT("PrimaryVolumeDescriptor found!\n");
- CdfsGetPVDData(Buffer, CdInfo);
- break;
-
- case 2:
- DPRINT("SupplementaryVolumeDescriptor found!\n");
- CdfsGetSVDData(Buffer, CdInfo);
- break;
-
- case 3:
- DPRINT("VolumePartitionDescriptor found!\n");
- break;
-
- case 255:
- DPRINT("VolumeDescriptorSetTerminator found!\n");
- break;
-
- default:
- DPRINT1("Unknown volume descriptor type %u found!\n",
VdHeader->VdType);
- break;
+ case 0:
+ DPRINT("BootVolumeDescriptor found!\n");
+ break;
+
+ case 1:
+ DPRINT("PrimaryVolumeDescriptor found!\n");
+ CdfsGetPVDData(Buffer, CdInfo);
+ break;
+
+ case 2:
+ DPRINT("SupplementaryVolumeDescriptor found!\n");
+ CdfsGetSVDData(Buffer, CdInfo);
+ break;
+
+ case 3:
+ DPRINT("VolumePartitionDescriptor found!\n");
+ break;
+
+ case 255:
+ DPRINT("VolumeDescriptorSetTerminator found!\n");
+ break;
+
+ default:
+ DPRINT1("Unknown volume descriptor type %u found!\n",
VdHeader->VdType);
+ break;
}
}
ExFreePoolWithTag(Buffer, CDFS_TAG);
- return(STATUS_SUCCESS);
-}
-
-
-static NTSTATUS
-CdfsMountVolume(PDEVICE_OBJECT DeviceObject,
- PIRP Irp)
+ return STATUS_SUCCESS;
+}
+
+
+static
+NTSTATUS
+CdfsMountVolume(
+ PDEVICE_OBJECT DeviceObject,
+ PIRP Irp)
{
PDEVICE_EXTENSION DeviceExt = NULL;
PDEVICE_OBJECT NewDeviceObject = NULL;
@@ -337,12 +345,12 @@
}
Status = IoCreateDevice(CdfsGlobalData->DriverObject,
- sizeof(DEVICE_EXTENSION),
- NULL,
- FILE_DEVICE_CD_ROM_FILE_SYSTEM,
- DeviceToMount->Characteristics,
- FALSE,
- &NewDeviceObject);
+ sizeof(DEVICE_EXTENSION),
+ NULL,
+ FILE_DEVICE_CD_ROM_FILE_SYSTEM,
+ DeviceToMount->Characteristics,
+ FALSE,
+ &NewDeviceObject);
if (!NT_SUCCESS(Status))
goto ByeBye;
@@ -350,7 +358,7 @@
NewDeviceObject->Flags &= ~DO_VERIFY_VOLUME;
DeviceExt = (PVOID)NewDeviceObject->DeviceExtension;
RtlZeroMemory(DeviceExt,
- sizeof(DEVICE_EXTENSION));
+ sizeof(DEVICE_EXTENSION));
Vpb->SerialNumber = CdInfo.SerialNumber;
Vpb->VolumeLabelLength = CdInfo.VolumeLabelLength;
@@ -373,7 +381,7 @@
ExInitializeResourceLite(&DeviceExt->DirResource);
DeviceExt->StreamFileObject = IoCreateStreamFileObject(NULL,
- DeviceExt->StorageDevice);
+ DeviceExt->StorageDevice);
Fcb = CdfsCreateFCB(NULL);
if (Fcb == NULL)
@@ -388,8 +396,9 @@
Status = STATUS_INSUFFICIENT_RESOURCES;
goto ByeBye;
}
+
RtlZeroMemory(Ccb,
- sizeof(CCB));
+ sizeof(CCB));
DeviceExt->StreamFileObject->ReadAccess = TRUE;
DeviceExt->StreamFileObject->WriteAccess = FALSE;
@@ -414,10 +423,10 @@
_SEH2_TRY
{
CcInitializeCacheMap(DeviceExt->StreamFileObject,
- (PCC_FILE_SIZES)(&Fcb->RFCB.AllocationSize),
- TRUE,
- &(CdfsGlobalData->CacheMgrCallbacks),
- Fcb);
+ (PCC_FILE_SIZES)(&Fcb->RFCB.AllocationSize),
+ TRUE,
+ &(CdfsGlobalData->CacheMgrCallbacks),
+ Fcb);
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{
@@ -450,13 +459,15 @@
DPRINT("CdfsMountVolume() done (Status: %lx)\n", Status);
- return(Status);
-}
-
-
-static NTSTATUS
-CdfsVerifyVolume(PDEVICE_OBJECT DeviceObject,
- PIRP Irp)
+ return Status;
+}
+
+
+static
+NTSTATUS
+CdfsVerifyVolume(
+ PDEVICE_OBJECT DeviceObject,
+ PIRP Irp)
{
PDEVICE_EXTENSION DeviceExt;
PIO_STACK_LOCATION Stack;
@@ -466,7 +477,7 @@
PFCB Fcb;
PVPB VpbToVerify;
- DPRINT1 ("CdfsVerifyVolume() called\n");
+ DPRINT("CdfsVerifyVolume() called\n");
DeviceExt = DeviceObject->DeviceExtension;
@@ -474,12 +485,12 @@
VpbToVerify = Stack->Parameters.VerifyVolume.Vpb;
FsRtlEnterFileSystem();
- ExAcquireResourceExclusiveLite (&DeviceExt->VcbResource,
- TRUE);
+ ExAcquireResourceExclusiveLite(&DeviceExt->VcbResource,
+ TRUE);
if (!(VpbToVerify->RealDevice->Flags & DO_VERIFY_VOLUME))
{
- DPRINT1 ("Volume has been verified!\n");
+ DPRINT1("Volume has been verified!\n");
ExReleaseResourceLite (&DeviceExt->VcbResource);
FsRtlExitFileSystem();
return STATUS_SUCCESS;
@@ -488,13 +499,13 @@
DPRINT1("Device object %p Device to verify %p\n", DeviceObject,
VpbToVerify->RealDevice);
Status = CdfsGetVolumeData(VpbToVerify->RealDevice,
- &CdInfo);
+ &CdInfo);
if (NT_SUCCESS(Status) &&
CdInfo.SerialNumber == VpbToVerify->SerialNumber &&
CdInfo.VolumeLabelLength == VpbToVerify->VolumeLabelLength &&
!wcsncmp(CdInfo.VolumeLabel, VpbToVerify->VolumeLabel,
CdInfo.VolumeLabelLength))
{
- DPRINT1 ("Same volume!\n");
+ DPRINT1("Same volume!\n");
/* FIXME: Flush and purge metadata */
@@ -502,7 +513,7 @@
}
else
{
- DPRINT1 ("Different volume!\n");
+ DPRINT1("Different volume!\n");
/* FIXME: force volume dismount */
Entry = DeviceExt->FcbListHead.Flink;
@@ -519,17 +530,18 @@
VpbToVerify->RealDevice->Flags &= ~DO_VERIFY_VOLUME;
- ExReleaseResourceLite (&DeviceExt->VcbResource);
+ ExReleaseResourceLite(&DeviceExt->VcbResource);
FsRtlExitFileSystem();
return Status;
}
-NTSTATUS NTAPI
+NTSTATUS
+NTAPI
CdfsSetCompression(
- IN PDEVICE_OBJECT DeviceObject,
- IN PIRP Irp)
+ IN PDEVICE_OBJECT DeviceObject,
+ IN PIRP Irp)
{
PIO_STACK_LOCATION Stack;
USHORT CompressionState;
@@ -549,7 +561,8 @@
}
-NTSTATUS NTAPI
+NTSTATUS
+NTAPI
CdfsFileSystemControl(
PCDFS_IRP_CONTEXT IrpContext)
{
@@ -570,39 +583,39 @@
switch (IrpContext->MinorFunction)
{
- case IRP_MN_KERNEL_CALL:
- case IRP_MN_USER_FS_REQUEST:
- switch (Stack->Parameters.DeviceIoControl.IoControlCode)
- {
- case FSCTL_SET_COMPRESSION:
- DPRINT("CDFS: IRP_MN_USER_FS_REQUEST / FSCTL_SET_COMPRESSION\n");
- Status = CdfsSetCompression(DeviceObject, Irp);
+ case IRP_MN_KERNEL_CALL:
+ case IRP_MN_USER_FS_REQUEST:
+ switch (Stack->Parameters.DeviceIoControl.IoControlCode)
+ {
+ case FSCTL_SET_COMPRESSION:
+ DPRINT("CDFS: IRP_MN_USER_FS_REQUEST /
FSCTL_SET_COMPRESSION\n");
+ Status = CdfsSetCompression(DeviceObject, Irp);
+ break;
+
+ default:
+ DPRINT1("CDFS: IRP_MN_USER_FS_REQUEST / Unknown IoControlCode
0x%x\n",
+ Stack->Parameters.DeviceIoControl.IoControlCode);
+ Status = STATUS_INVALID_DEVICE_REQUEST;
+ }
break;
+ case IRP_MN_MOUNT_VOLUME:
+ DPRINT("CDFS: IRP_MN_MOUNT_VOLUME\n");
+ Status = CdfsMountVolume(DeviceObject, Irp);
+ break;
+
+ case IRP_MN_VERIFY_VOLUME:
+ DPRINT1("CDFS: IRP_MN_VERIFY_VOLUME\n");
+ Status = CdfsVerifyVolume(DeviceObject, Irp);
+ break;
+
default:
- DPRINT1("CDFS: IRP_MN_USER_FS_REQUEST / Unknown IoControlCode
0x%x\n",
- Stack->Parameters.DeviceIoControl.IoControlCode);
+ DPRINT1("CDFS FSC: MinorFunction %u\n", Stack->MinorFunction);
Status = STATUS_INVALID_DEVICE_REQUEST;
- }
- break;
-
- case IRP_MN_MOUNT_VOLUME:
- DPRINT("CDFS: IRP_MN_MOUNT_VOLUME\n");
- Status = CdfsMountVolume(DeviceObject, Irp);
- break;
-
- case IRP_MN_VERIFY_VOLUME:
- DPRINT1("CDFS: IRP_MN_VERIFY_VOLUME\n");
- Status = CdfsVerifyVolume(DeviceObject, Irp);
- break;
-
- default:
- DPRINT1("CDFS FSC: MinorFunction %u\n", Stack->MinorFunction);
- Status = STATUS_INVALID_DEVICE_REQUEST;
- break;
- }
-
- return(Status);
+ break;
+ }
+
+ return Status;
}
/* EOF */
Modified: trunk/reactos/drivers/filesystems/cdfs/volinfo.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/cdfs/v…
==============================================================================
--- trunk/reactos/drivers/filesystems/cdfs/volinfo.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/cdfs/volinfo.c [iso-8859-1] Mon Jun 1 15:00:51
2015
@@ -19,7 +19,7 @@
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
- * FILE: services/fs/vfat/volume.c
+ * FILE: drivers/filesystems/cdfs/volume.c
* PURPOSE: CDROM (ISO 9660) filesystem driver
* PROGRAMMER: Art Yerkes
* Eric Kohl
@@ -34,10 +34,12 @@
/* FUNCTIONS ****************************************************************/
-static NTSTATUS
-CdfsGetFsVolumeInformation(PDEVICE_OBJECT DeviceObject,
- PFILE_FS_VOLUME_INFORMATION FsVolumeInfo,
- PULONG BufferLength)
+static
+NTSTATUS
+CdfsGetFsVolumeInformation(
+ PDEVICE_OBJECT DeviceObject,
+ PFILE_FS_VOLUME_INFORMATION FsVolumeInfo,
+ PULONG BufferLength)
{
DPRINT("CdfsGetFsVolumeInformation() called\n");
DPRINT("FsVolumeInfo = %p\n", FsVolumeInfo);
@@ -59,8 +61,8 @@
FsVolumeInfo->VolumeSerialNumber = DeviceObject->Vpb->SerialNumber;
FsVolumeInfo->VolumeLabelLength = DeviceObject->Vpb->VolumeLabelLength;
memcpy(FsVolumeInfo->VolumeLabel,
- DeviceObject->Vpb->VolumeLabel,
- DeviceObject->Vpb->VolumeLabelLength);
+ DeviceObject->Vpb->VolumeLabel,
+ DeviceObject->Vpb->VolumeLabelLength);
/* dummy entries */
FsVolumeInfo->VolumeCreationTime.QuadPart = 0;
@@ -72,14 +74,16 @@
DPRINT("BufferLength %lu\n", *BufferLength);
- return(STATUS_SUCCESS);
-}
-
-
-static NTSTATUS
-CdfsGetFsAttributeInformation(PDEVICE_EXTENSION DeviceExt,
- PFILE_FS_ATTRIBUTE_INFORMATION FsAttributeInfo,
- PULONG BufferLength)
+ return STATUS_SUCCESS;
+}
+
+
+static
+NTSTATUS
+CdfsGetFsAttributeInformation(
+ PDEVICE_EXTENSION DeviceExt,
+ PFILE_FS_ATTRIBUTE_INFORMATION FsAttributeInfo,
+ PULONG BufferLength)
{
DPRINT("CdfsGetFsAttributeInformation()\n");
DPRINT("FsAttributeInfo = %p\n", FsAttributeInfo);
@@ -106,14 +110,15 @@
*BufferLength -= (sizeof(FILE_FS_ATTRIBUTE_INFORMATION) + 8);
DPRINT("BufferLength %lu\n", *BufferLength);
- return(STATUS_SUCCESS);
+ return STATUS_SUCCESS;
}
static NTSTATUS
-CdfsGetFsSizeInformation(PDEVICE_OBJECT DeviceObject,
- PFILE_FS_SIZE_INFORMATION FsSizeInfo,
- PULONG BufferLength)
+CdfsGetFsSizeInformation(
+ PDEVICE_OBJECT DeviceObject,
+ PFILE_FS_SIZE_INFORMATION FsSizeInfo,
+ PULONG BufferLength)
{
PDEVICE_EXTENSION DeviceExt;
NTSTATUS Status = STATUS_SUCCESS;
@@ -122,7 +127,7 @@
DPRINT("FsSizeInfo = %p\n", FsSizeInfo);
if (*BufferLength < sizeof(FILE_FS_SIZE_INFORMATION))
- return(STATUS_BUFFER_OVERFLOW);
+ return STATUS_BUFFER_OVERFLOW;
DeviceExt = DeviceObject->DeviceExtension;
@@ -135,17 +140,16 @@
if (NT_SUCCESS(Status))
*BufferLength -= sizeof(FILE_FS_SIZE_INFORMATION);
- return(Status);
-}
-
-
-static NTSTATUS
-CdfsGetFsDeviceInformation
-(
+ return Status;
+}
+
+
+static
+NTSTATUS
+CdfsGetFsDeviceInformation(
PDEVICE_OBJECT DeviceObject,
PFILE_FS_DEVICE_INFORMATION FsDeviceInfo,
- PULONG BufferLength
-)
+ PULONG BufferLength)
{
DPRINT("CdfsGetFsDeviceInformation()\n");
DPRINT("FsDeviceInfo = %p\n", FsDeviceInfo);
@@ -153,7 +157,7 @@
DPRINT("Required length %lu\n", sizeof(FILE_FS_DEVICE_INFORMATION));
if (*BufferLength < sizeof(FILE_FS_DEVICE_INFORMATION))
- return(STATUS_BUFFER_OVERFLOW);
+ return STATUS_BUFFER_OVERFLOW;
FsDeviceInfo->DeviceType = FILE_DEVICE_CD_ROM;
FsDeviceInfo->Characteristics = DeviceObject->Characteristics;
@@ -163,11 +167,12 @@
*BufferLength -= sizeof(FILE_FS_DEVICE_INFORMATION);
DPRINT("BufferLength %lu\n", *BufferLength);
- return(STATUS_SUCCESS);
-}
-
-
-NTSTATUS NTAPI
+ return STATUS_SUCCESS;
+}
+
+
+NTSTATUS
+NTAPI
CdfsQueryVolumeInformation(
PCDFS_IRP_CONTEXT IrpContext)
{
@@ -195,32 +200,32 @@
switch (FsInformationClass)
{
- case FileFsVolumeInformation:
- Status = CdfsGetFsVolumeInformation(DeviceObject,
- SystemBuffer,
- &BufferLength);
+ case FileFsVolumeInformation:
+ Status = CdfsGetFsVolumeInformation(DeviceObject,
+ SystemBuffer,
+ &BufferLength);
+ break;
+
+ case FileFsAttributeInformation:
+ Status = CdfsGetFsAttributeInformation(DeviceObject->DeviceExtension,
+ SystemBuffer,
+ &BufferLength);
+ break;
+
+ case FileFsSizeInformation:
+ Status = CdfsGetFsSizeInformation(DeviceObject,
+ SystemBuffer,
+ &BufferLength);
break;
- case FileFsAttributeInformation:
- Status = CdfsGetFsAttributeInformation(DeviceObject->DeviceExtension,
- SystemBuffer,
- &BufferLength);
- break;
-
- case FileFsSizeInformation:
- Status = CdfsGetFsSizeInformation(DeviceObject,
- SystemBuffer,
- &BufferLength);
- break;
-
- case FileFsDeviceInformation:
- Status = CdfsGetFsDeviceInformation(DeviceObject,
- SystemBuffer,
- &BufferLength);
- break;
-
- default:
- Status = STATUS_NOT_SUPPORTED;
+ case FileFsDeviceInformation:
+ Status = CdfsGetFsDeviceInformation(DeviceObject,
+ SystemBuffer,
+ &BufferLength);
+ break;
+
+ default:
+ Status = STATUS_NOT_SUPPORTED;
}
Irp->IoStatus.Status = Status;
@@ -230,11 +235,12 @@
else
Irp->IoStatus.Information = 0;
- return(Status);
-}
-
-
-NTSTATUS NTAPI
+ return Status;
+}
+
+
+NTSTATUS
+NTAPI
CdfsSetVolumeInformation(
PCDFS_IRP_CONTEXT IrpContext)
{
@@ -248,7 +254,7 @@
Irp->IoStatus.Status = STATUS_NOT_SUPPORTED;
Irp->IoStatus.Information = 0;
- return(STATUS_NOT_SUPPORTED);
+ return STATUS_NOT_SUPPORTED;
}
/* EOF */