Bugfixing... Part 6/X:
- Properly return the size of the NTFS volume (and not a buggy size)
- Properly return the characteristics of the NTFS volume

svn path=/trunk/; revision=64829
This commit is contained in:
Pierre Schweitzer 2014-10-19 17:43:37 +00:00
parent aa15945793
commit 064ac54c96

View file

@ -32,6 +32,14 @@
/* FUNCTIONS ****************************************************************/
static
ULONGLONG
NtfsGetFreeClusters(PDEVICE_EXTENSION DeviceExt)
{
UNIMPLEMENTED;
return 0;
}
static
NTSTATUS
NtfsGetFsVolumeInformation(PDEVICE_OBJECT DeviceObject,
@ -130,8 +138,8 @@ NtfsGetFsSizeInformation(PDEVICE_OBJECT DeviceObject,
DeviceExt = DeviceObject->DeviceExtension;
FsSizeInfo->AvailableAllocationUnits.QuadPart = 0;
FsSizeInfo->TotalAllocationUnits.QuadPart = DeviceExt->NtfsInfo.SectorCount; /* ?? */
FsSizeInfo->AvailableAllocationUnits.QuadPart = NtfsGetFreeClusters(DeviceExt);
FsSizeInfo->TotalAllocationUnits.QuadPart = DeviceExt->NtfsInfo.SectorCount / DeviceExt->NtfsInfo.SectorsPerCluster;
FsSizeInfo->SectorsPerAllocationUnit = DeviceExt->NtfsInfo.SectorsPerCluster;
FsSizeInfo->BytesPerSector = DeviceExt->NtfsInfo.BytesPerSector;
@ -145,7 +153,8 @@ NtfsGetFsSizeInformation(PDEVICE_OBJECT DeviceObject,
static
NTSTATUS
NtfsGetFsDeviceInformation(PFILE_FS_DEVICE_INFORMATION FsDeviceInfo,
NtfsGetFsDeviceInformation(PDEVICE_OBJECT DeviceObject,
PFILE_FS_DEVICE_INFORMATION FsDeviceInfo,
PULONG BufferLength)
{
DPRINT("NtfsGetFsDeviceInformation()\n");
@ -157,7 +166,7 @@ NtfsGetFsDeviceInformation(PFILE_FS_DEVICE_INFORMATION FsDeviceInfo,
return STATUS_BUFFER_OVERFLOW;
FsDeviceInfo->DeviceType = FILE_DEVICE_DISK;
FsDeviceInfo->Characteristics = 0; /* FIXME: fix this !! */
FsDeviceInfo->Characteristics = DeviceObject->Characteristics;
DPRINT("NtfsGetFsDeviceInformation() finished.\n");
@ -215,7 +224,8 @@ NtfsQueryVolumeInformation(PNTFS_IRP_CONTEXT IrpContext)
break;
case FileFsDeviceInformation:
Status = NtfsGetFsDeviceInformation(SystemBuffer,
Status = NtfsGetFsDeviceInformation(DeviceObject,
SystemBuffer,
&BufferLength);
break;