[FORMATTING]

Fix indentation and coding style. No code changes!

svn path=/trunk/; revision=61143
This commit is contained in:
Eric Kohl 2013-11-29 11:03:34 +00:00
parent 2f7e31bc07
commit 932bee1e8a

View file

@ -14,11 +14,15 @@
/* FUNCTIONS ****************************************************************/
static NTSTATUS
FsdGetFsVolumeInformation(PDEVICE_OBJECT DeviceObject,
static
NTSTATUS
FsdGetFsVolumeInformation(
PDEVICE_OBJECT DeviceObject,
PFILE_FS_VOLUME_INFORMATION FsVolumeInfo,
PULONG BufferLength)
{
PDEVICE_EXTENSION DeviceExt;
DPRINT("FsdGetFsVolumeInformation()\n");
DPRINT("FsVolumeInfo = %p\n", FsVolumeInfo);
DPRINT("BufferLength %lu\n", *BufferLength);
@ -33,6 +37,8 @@ FsdGetFsVolumeInformation(PDEVICE_OBJECT DeviceObject,
if (*BufferLength < (sizeof(FILE_FS_VOLUME_INFORMATION) + DeviceObject->Vpb->VolumeLabelLength))
return STATUS_BUFFER_OVERFLOW;
DeviceExt = DeviceObject->DeviceExtension;
/* valid entries */
FsVolumeInfo->VolumeSerialNumber = DeviceObject->Vpb->SerialNumber;
FsVolumeInfo->VolumeLabelLength = DeviceObject->Vpb->VolumeLabelLength;
@ -48,12 +54,14 @@ FsdGetFsVolumeInformation(PDEVICE_OBJECT DeviceObject,
DPRINT("BufferLength %lu\n", *BufferLength);
return(STATUS_SUCCESS);
return STATUS_SUCCESS;
}
static NTSTATUS
FsdGetFsAttributeInformation(PDEVICE_EXTENSION DeviceExt,
static
NTSTATUS
FsdGetFsAttributeInformation(
PDEVICE_EXTENSION DeviceExt,
PFILE_FS_ATTRIBUTE_INFORMATION FsAttributeInfo,
PULONG BufferLength)
{
@ -88,19 +96,21 @@ FsdGetFsAttributeInformation(PDEVICE_EXTENSION DeviceExt,
FsAttributeInfo->FileSystemNameLength = Length;
RtlCopyMemory(FsAttributeInfo->FileSystemName, pName, Length );
RtlCopyMemory(FsAttributeInfo->FileSystemName, pName, Length);
DPRINT("Finished FsdGetFsAttributeInformation()\n");
*BufferLength -= (sizeof(FILE_FS_ATTRIBUTE_INFORMATION) + Length);
DPRINT("BufferLength %lu\n", *BufferLength);
return(STATUS_SUCCESS);
return STATUS_SUCCESS;
}
static NTSTATUS
FsdGetFsSizeInformation(PDEVICE_OBJECT DeviceObject,
static
NTSTATUS
FsdGetFsSizeInformation(
PDEVICE_OBJECT DeviceObject,
PFILE_FS_SIZE_INFORMATION FsSizeInfo,
PULONG BufferLength)
{
@ -111,7 +121,7 @@ FsdGetFsSizeInformation(PDEVICE_OBJECT DeviceObject,
DPRINT("FsSizeInfo = %p\n", FsSizeInfo);
if (*BufferLength < sizeof(FILE_FS_SIZE_INFORMATION))
return(STATUS_BUFFER_OVERFLOW);
return STATUS_BUFFER_OVERFLOW;
DeviceExt = DeviceObject->DeviceExtension;
Status = CountAvailableClusters(DeviceExt, &FsSizeInfo->AvailableAllocationUnits);
@ -124,17 +134,16 @@ FsdGetFsSizeInformation(PDEVICE_OBJECT DeviceObject,
if (NT_SUCCESS(Status))
*BufferLength -= sizeof(FILE_FS_SIZE_INFORMATION);
return(Status);
return Status;
}
static NTSTATUS
FsdGetFsDeviceInformation
(
static
NTSTATUS
FsdGetFsDeviceInformation(
PDEVICE_OBJECT DeviceObject,
PFILE_FS_DEVICE_INFORMATION FsDeviceInfo,
PULONG BufferLength
)
PULONG BufferLength)
{
DPRINT("FsdGetFsDeviceInformation()\n");
DPRINT("FsDeviceInfo = %p\n", FsDeviceInfo);
@ -142,7 +151,7 @@ FsdGetFsDeviceInformation
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_DISK;
FsDeviceInfo->Characteristics = DeviceObject->Characteristics;
@ -152,12 +161,14 @@ FsdGetFsDeviceInformation
*BufferLength -= sizeof(FILE_FS_DEVICE_INFORMATION);
DPRINT("BufferLength %lu\n", *BufferLength);
return(STATUS_SUCCESS);
return STATUS_SUCCESS;
}
static NTSTATUS
FsdSetFsLabelInformation(PDEVICE_OBJECT DeviceObject,
static
NTSTATUS
FsdSetFsLabelInformation(
PDEVICE_OBJECT DeviceObject,
PFILE_FS_LABEL_INFORMATION FsLabelInfo)
{
PDEVICE_EXTENSION DeviceExt;
@ -190,6 +201,7 @@ FsdSetFsLabelInformation(PDEVICE_OBJECT DeviceObject,
{
if (FsLabelInfo->VolumeLabelLength / sizeof(WCHAR) > 42)
return STATUS_NAME_TOO_LONG;
SizeDirEntry = sizeof(FATX_DIR_ENTRY);
EntriesPerPage = FATX_ENTRIES_PER_PAGE;
}
@ -197,6 +209,7 @@ FsdSetFsLabelInformation(PDEVICE_OBJECT DeviceObject,
{
if (FsLabelInfo->VolumeLabelLength / sizeof(WCHAR) > 11)
return STATUS_NAME_TOO_LONG;
SizeDirEntry = sizeof(FAT_DIR_ENTRY);
EntriesPerPage = FAT_ENTRIES_PER_PAGE;
}
@ -212,6 +225,7 @@ FsdSetFsLabelInformation(PDEVICE_OBJECT DeviceObject,
Status = RtlUnicodeStringToOemString(&StringO, &StringW, FALSE);
if (!NT_SUCCESS(Status))
return Status;
if (DeviceExt->Flags & VCB_IS_FATX)
{
RtlCopyMemory(VolumeLabelDirEntry.FatX.Filename, cString, LabelLen);
@ -250,10 +264,12 @@ FsdSetFsLabelInformation(PDEVICE_OBJECT DeviceObject,
Status = STATUS_SUCCESS;
break;
}
if (ENTRY_END(DeviceExt, Entry))
{
break;
}
DirIndex++;
Entry = (PDIR_ENTRY)((ULONG_PTR)Entry + SizeDirEntry);
if ((DirIndex % EntriesPerPage) == 0)
@ -267,11 +283,13 @@ FsdSetFsLabelInformation(PDEVICE_OBJECT DeviceObject,
}
}
}
if (Context)
{
CcUnpinData(Context);
}
}
if (!LabelFound)
{
/* Add new entry for label */
@ -310,7 +328,9 @@ FsdSetFsLabelInformation(PDEVICE_OBJECT DeviceObject,
}
NTSTATUS VfatQueryVolumeInformation(PVFAT_IRP_CONTEXT IrpContext)
NTSTATUS
VfatQueryVolumeInformation(
PVFAT_IRP_CONTEXT IrpContext)
/*
* FUNCTION: Retrieve the specified volume information
*/
@ -328,7 +348,7 @@ NTSTATUS VfatQueryVolumeInformation(PVFAT_IRP_CONTEXT IrpContext)
if (!ExAcquireResourceSharedLite(&((PDEVICE_EXTENSION)IrpContext->DeviceObject->DeviceExtension)->DirResource,
(BOOLEAN)(IrpContext->Flags & IRPCONTEXT_CANWAIT)))
{
return VfatQueueRequest (IrpContext);
return VfatQueueRequest(IrpContext);
}
/* INITIALIZATION */
@ -336,9 +356,8 @@ NTSTATUS VfatQueryVolumeInformation(PVFAT_IRP_CONTEXT IrpContext)
BufferLength = IrpContext->Stack->Parameters.QueryVolume.Length;
SystemBuffer = IrpContext->Irp->AssociatedIrp.SystemBuffer;
DPRINT ("FsInformationClass %d\n", FsInformationClass);
DPRINT ("SystemBuffer %p\n", SystemBuffer);
DPRINT("FsInformationClass %d\n", FsInformationClass);
DPRINT("SystemBuffer %p\n", SystemBuffer);
switch (FsInformationClass)
{
@ -384,7 +403,9 @@ NTSTATUS VfatQueryVolumeInformation(PVFAT_IRP_CONTEXT IrpContext)
}
NTSTATUS VfatSetVolumeInformation(PVFAT_IRP_CONTEXT IrpContext)
NTSTATUS
VfatSetVolumeInformation(
PVFAT_IRP_CONTEXT IrpContext)
/*
* FUNCTION: Set the specified volume information
*/
@ -398,23 +419,23 @@ NTSTATUS VfatSetVolumeInformation(PVFAT_IRP_CONTEXT IrpContext)
/* PRECONDITION */
ASSERT(IrpContext);
DPRINT ("VfatSetVolumeInformation(IrpContext %p)\n", IrpContext);
DPRINT("VfatSetVolumeInformation(IrpContext %p)\n", IrpContext);
if (!ExAcquireResourceExclusiveLite(&((PDEVICE_EXTENSION)IrpContext->DeviceObject->DeviceExtension)->DirResource,
(BOOLEAN)(IrpContext->Flags & IRPCONTEXT_CANWAIT)))
{
return VfatQueueRequest (IrpContext);
return VfatQueueRequest(IrpContext);
}
FsInformationClass = Stack->Parameters.SetVolume.FsInformationClass;
BufferLength = Stack->Parameters.SetVolume.Length;
SystemBuffer = IrpContext->Irp->AssociatedIrp.SystemBuffer;
DPRINT ("FsInformationClass %d\n", FsInformationClass);
DPRINT ("BufferLength %u\n", BufferLength);
DPRINT ("SystemBuffer %p\n", SystemBuffer);
DPRINT("FsInformationClass %d\n", FsInformationClass);
DPRINT("BufferLength %u\n", BufferLength);
DPRINT("SystemBuffer %p\n", SystemBuffer);
switch(FsInformationClass)
switch (FsInformationClass)
{
case FileFsLabelInformation:
Status = FsdSetFsLabelInformation(IrpContext->DeviceObject,
@ -431,7 +452,7 @@ NTSTATUS VfatSetVolumeInformation(PVFAT_IRP_CONTEXT IrpContext)
IoCompleteRequest(IrpContext->Irp, IO_NO_INCREMENT);
VfatFreeIrpContext(IrpContext);
return(Status);
return Status;
}
/* EOF */