[FASTFAT]
authorEric Kohl <eric.kohl@reactos.org>
Tue, 2 Jun 2015 09:08:33 +0000 (09:08 +0000)
committerEric Kohl <eric.kohl@reactos.org>
Tue, 2 Jun 2015 09:08:33 +0000 (09:08 +0000)
Add IRP_MJ_QUERY_VOLUME_INFORMATION.FileFsFullSizeInformation. This fixes a number of ntdll winetests.

svn path=/trunk/; revision=67998

reactos/drivers/filesystems/fastfat/volume.c

index a0a297b..3d591b5 100644 (file)
@@ -180,6 +180,38 @@ FsdGetFsDeviceInformation(
 }
 
 
+static
+NTSTATUS
+FsdGetFsFullSizeInformation(
+    PDEVICE_OBJECT DeviceObject,
+    PFILE_FS_FULL_SIZE_INFORMATION FsSizeInfo,
+    PULONG BufferLength)
+{
+    PDEVICE_EXTENSION DeviceExt;
+    NTSTATUS Status;
+
+    DPRINT("FsdGetFsFullSizeInformation()\n");
+    DPRINT("FsSizeInfo = %p\n", FsSizeInfo);
+
+    if (*BufferLength < sizeof(FILE_FS_FULL_SIZE_INFORMATION))
+        return STATUS_BUFFER_OVERFLOW;
+
+    DeviceExt = DeviceObject->DeviceExtension;
+    Status = CountAvailableClusters(DeviceExt, &FsSizeInfo->CallerAvailableAllocationUnits);
+
+    FsSizeInfo->TotalAllocationUnits.QuadPart = DeviceExt->FatInfo.NumberOfClusters;
+    FsSizeInfo->ActualAvailableAllocationUnits.QuadPart = FsSizeInfo->CallerAvailableAllocationUnits.QuadPart;
+    FsSizeInfo->SectorsPerAllocationUnit = DeviceExt->FatInfo.SectorsPerCluster;
+    FsSizeInfo->BytesPerSector = DeviceExt->FatInfo.BytesPerSector;
+
+    DPRINT("Finished FsdGetFsFullSizeInformation()\n");
+    if (NT_SUCCESS(Status))
+        *BufferLength -= sizeof(FILE_FS_FULL_SIZE_INFORMATION);
+
+    return Status;
+}
+
+
 static
 NTSTATUS
 FsdSetFsLabelInformation(
@@ -401,6 +433,12 @@ VfatQueryVolumeInformation(
                                            &BufferLength);
             break;
 
+        case FileFsFullSizeInformation:
+            RC = FsdGetFsFullSizeInformation(IrpContext->DeviceObject,
+                                             SystemBuffer,
+                                             &BufferLength);
+            break;
+
         default:
             RC = STATUS_NOT_SUPPORTED;
     }