From dcfb8844fe122d79dd858183c46c2752a6a166f5 Mon Sep 17 00:00:00 2001 From: Bo Branten Date: Sun, 16 Jun 2024 23:20:57 +0200 Subject: [PATCH] fill in VolumeCreationTime --- Ext4Fsd/volinfo.c | 34 ++++++++-------------------------- 1 file changed, 8 insertions(+), 26 deletions(-) diff --git a/Ext4Fsd/volinfo.c b/Ext4Fsd/volinfo.c index 0eaf362..2bbbe94 100644 --- a/Ext4Fsd/volinfo.c +++ b/Ext4Fsd/volinfo.c @@ -22,7 +22,6 @@ extern PEXT2_GLOBAL Ext2Global; #pragma alloc_text(PAGE, Ext2SetVolumeInformation) #endif - NTSTATUS Ext2QueryVolumeInformation (IN PEXT2_IRP_CONTEXT IrpContext) { @@ -96,7 +95,7 @@ Ext2QueryVolumeInformation (IN PEXT2_IRP_CONTEXT IrpContext) } FsVolInfo = (PFILE_FS_VOLUME_INFORMATION) Buffer; - FsVolInfo->VolumeCreationTime.QuadPart = 0; + FsVolInfo->VolumeCreationTime = Ext2NtTime(Vcb->SuperBlock->s_mkfs_time); FsVolInfo->VolumeSerialNumber = Vcb->Vpb->SerialNumber; VolumeLabelLength = Vcb->Vpb->VolumeLabelLength; FsVolInfo->VolumeLabelLength = VolumeLabelLength; @@ -157,10 +156,6 @@ Ext2QueryVolumeInformation (IN PEXT2_IRP_CONTEXT IrpContext) FsDevInfo->DeviceType = Vcb->TargetDeviceObject->DeviceType; - if (FsDevInfo->DeviceType != FILE_DEVICE_DISK) { - DbgBreak(); - } - FsDevInfo->Characteristics = Vcb->TargetDeviceObject->Characteristics; @@ -231,27 +226,15 @@ Ext2QueryVolumeInformation (IN PEXT2_IRP_CONTEXT IrpContext) PFFFSI = (PFILE_FS_FULL_SIZE_INFORMATION) Buffer; - /* - typedef struct _FILE_FS_FULL_SIZE_INFORMATION { - LARGE_INTEGER TotalAllocationUnits; - LARGE_INTEGER CallerAvailableAllocationUnits; - LARGE_INTEGER ActualAvailableAllocationUnits; - ULONG SectorsPerAllocationUnit; - ULONG BytesPerSector; - } FILE_FS_FULL_SIZE_INFORMATION, *PFILE_FS_FULL_SIZE_INFORMATION; - */ + PFFFSI->TotalAllocationUnits.QuadPart = + ext3_blocks_count(SUPER_BLOCK); - { - PFFFSI->TotalAllocationUnits.QuadPart = - ext3_blocks_count(SUPER_BLOCK); - - PFFFSI->CallerAvailableAllocationUnits.QuadPart = - ext3_free_blocks_count(SUPER_BLOCK); + PFFFSI->CallerAvailableAllocationUnits.QuadPart = + ext3_free_blocks_count(SUPER_BLOCK); /* - Vcb->SuperBlock->s_r_blocks_count; */ - PFFFSI->ActualAvailableAllocationUnits.QuadPart = - ext3_free_blocks_count(SUPER_BLOCK); - } + PFFFSI->ActualAvailableAllocationUnits.QuadPart = + ext3_free_blocks_count(SUPER_BLOCK); PFFFSI->SectorsPerAllocationUnit = Vcb->BlockSize / Vcb->DiskGeometry.BytesPerSector; @@ -351,7 +334,6 @@ Ext2SetVolumeInformation (IN PEXT2_IRP_CONTEXT IrpContext) PFILE_FS_LABEL_INFORMATION VolLabelInfo = NULL; ULONG VolLabelLen; UNICODE_STRING LabelName ; - OEM_STRING OemName; VolLabelInfo = (PFILE_FS_LABEL_INFORMATION) Irp->AssociatedIrp.SystemBuffer; @@ -406,4 +388,4 @@ Ext2SetVolumeInformation (IN PEXT2_IRP_CONTEXT IrpContext) } return Status; -} \ No newline at end of file +}