From 9e959dc0a3cf75effd2f73500f4ee0cfaec1ed38 Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Tue, 2 Jun 2015 12:37:37 +0000 Subject: [PATCH] [CDFS] Add IRP_MJ_QUERY_VOLUME_INFORMATION.FileFsFullSizeInformation to CDFS too. svn path=/trunk/; revision=67999 --- reactos/drivers/filesystems/cdfs/volinfo.c | 40 +++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/reactos/drivers/filesystems/cdfs/volinfo.c b/reactos/drivers/filesystems/cdfs/volinfo.c index b81dfb4cab2..1c2ec77a527 100644 --- a/reactos/drivers/filesystems/cdfs/volinfo.c +++ b/reactos/drivers/filesystems/cdfs/volinfo.c @@ -171,6 +171,38 @@ CdfsGetFsDeviceInformation( } +static +NTSTATUS +CdfsGetFsFullSizeInformation( + PDEVICE_OBJECT DeviceObject, + PFILE_FS_FULL_SIZE_INFORMATION FsSizeInfo, + PULONG BufferLength) +{ + PDEVICE_EXTENSION DeviceExt; + NTSTATUS Status; + + DPRINT("CdfsGetFsFullSizeInformation()\n"); + DPRINT("FsSizeInfo = %p\n", FsSizeInfo); + + if (*BufferLength < sizeof(FILE_FS_FULL_SIZE_INFORMATION)) + return STATUS_BUFFER_OVERFLOW; + + DeviceExt = DeviceObject->DeviceExtension; + + FsSizeInfo->TotalAllocationUnits.QuadPart = DeviceExt->CdInfo.VolumeSpaceSize; + FsSizeInfo->CallerAvailableAllocationUnits.QuadPart = 0; + FsSizeInfo->ActualAvailableAllocationUnits.QuadPart = 0; + FsSizeInfo->SectorsPerAllocationUnit = 1; + FsSizeInfo->BytesPerSector = BLOCKSIZE; + + DPRINT("Finished CdfsGetFsFullSizeInformation()\n"); + if (NT_SUCCESS(Status)) + *BufferLength -= sizeof(FILE_FS_FULL_SIZE_INFORMATION); + + return Status; +} + + NTSTATUS NTAPI CdfsQueryVolumeInformation( @@ -216,7 +248,7 @@ CdfsQueryVolumeInformation( Status = CdfsGetFsSizeInformation(DeviceObject, SystemBuffer, &BufferLength); - break; + break; case FileFsDeviceInformation: Status = CdfsGetFsDeviceInformation(DeviceObject, @@ -224,6 +256,12 @@ CdfsQueryVolumeInformation( &BufferLength); break; + case FileFsFullSizeInformation: + Status = CdfsGetFsFullSizeInformation(DeviceObject, + SystemBuffer, + &BufferLength); + break; + default: Status = STATUS_NOT_SUPPORTED; }