mirror of
https://github.com/winfsp/winfsp.git
synced 2025-04-22 16:33:02 -05:00
fsctl.h: FSP_FSCTL_VOLUME_INFO changes
This commit is contained in:
parent
a01e119ec3
commit
a889451345
@ -46,8 +46,8 @@ extern const __declspec(selectany) GUID FspFsvrtDeviceClassGuid =
|
||||
/* volume/file metadata */
|
||||
typedef struct
|
||||
{
|
||||
UINT64 TotalAllocationUnits;
|
||||
UINT64 AvailableAllocationUnits;
|
||||
UINT64 TotalSize;
|
||||
UINT64 FreeSize;
|
||||
UINT64 VolumeCreationTime;
|
||||
UINT16 VolumeLabelLength;
|
||||
WCHAR VolumeLabel[32];
|
||||
|
@ -123,10 +123,12 @@ static NTSTATUS FspFsvolQueryFsFullSizeInformation(
|
||||
|
||||
FSP_FSVOL_DEVICE_EXTENSION *FsvolDeviceExtension = FspFsvolDeviceExtension(FsvolDeviceObject);
|
||||
PFILE_FS_FULL_SIZE_INFORMATION Info = (PFILE_FS_FULL_SIZE_INFORMATION)*PBuffer;
|
||||
UINT64 AllocationUnit = FsvolDeviceExtension->VolumeParams.SectorSize *
|
||||
FsvolDeviceExtension->VolumeParams.SectorsPerAllocationUnit;
|
||||
|
||||
Info->TotalAllocationUnits.QuadPart = VolumeInfo->TotalAllocationUnits;
|
||||
Info->CallerAvailableAllocationUnits.QuadPart = VolumeInfo->AvailableAllocationUnits;
|
||||
Info->ActualAvailableAllocationUnits.QuadPart = VolumeInfo->AvailableAllocationUnits;
|
||||
Info->TotalAllocationUnits.QuadPart = VolumeInfo->TotalSize / AllocationUnit;
|
||||
Info->CallerAvailableAllocationUnits.QuadPart =
|
||||
Info->ActualAvailableAllocationUnits.QuadPart = VolumeInfo->FreeSize / AllocationUnit;
|
||||
Info->SectorsPerAllocationUnit = FsvolDeviceExtension->VolumeParams.SectorsPerAllocationUnit;
|
||||
Info->BytesPerSector = FsvolDeviceExtension->VolumeParams.SectorSize;
|
||||
|
||||
@ -148,9 +150,11 @@ static NTSTATUS FspFsvolQueryFsSizeInformation(
|
||||
|
||||
FSP_FSVOL_DEVICE_EXTENSION *FsvolDeviceExtension = FspFsvolDeviceExtension(FsvolDeviceObject);
|
||||
PFILE_FS_SIZE_INFORMATION Info = (PFILE_FS_SIZE_INFORMATION)*PBuffer;
|
||||
UINT64 AllocationUnit = FsvolDeviceExtension->VolumeParams.SectorSize *
|
||||
FsvolDeviceExtension->VolumeParams.SectorsPerAllocationUnit;
|
||||
|
||||
Info->TotalAllocationUnits.QuadPart = VolumeInfo->TotalAllocationUnits;
|
||||
Info->AvailableAllocationUnits.QuadPart = VolumeInfo->AvailableAllocationUnits;
|
||||
Info->TotalAllocationUnits.QuadPart = VolumeInfo->TotalSize / AllocationUnit;
|
||||
Info->AvailableAllocationUnits.QuadPart = VolumeInfo->FreeSize / AllocationUnit;
|
||||
Info->SectorsPerAllocationUnit = FsvolDeviceExtension->VolumeParams.SectorsPerAllocationUnit;
|
||||
Info->BytesPerSector = FsvolDeviceExtension->VolumeParams.SectorSize;
|
||||
|
||||
|
@ -194,15 +194,14 @@ static NTSTATUS GetVolumeInfo(FSP_FILE_SYSTEM *FileSystem,
|
||||
{
|
||||
MEMFS *Memfs = (MEMFS *)FileSystem->UserContext;
|
||||
MEMFS_FILE_NODE *RootNode;
|
||||
ULONG AllocationUnits = Memfs->MaxFileSize / (MEMFS_SECTOR_SIZE * MEMFS_SECTORS_PER_ALLOCATION_UNIT);
|
||||
|
||||
RootNode = MemfsFileNodeMapGet(Memfs->FileNodeMap, L"");
|
||||
if (0 == RootNode)
|
||||
return STATUS_DISK_CORRUPT_ERROR;
|
||||
|
||||
VolumeInfo->TotalAllocationUnits = Memfs->MaxFileNodes * AllocationUnits;
|
||||
VolumeInfo->AvailableAllocationUnits =
|
||||
(Memfs->MaxFileNodes - MemfsFileNodeMapCount(Memfs->FileNodeMap)) * AllocationUnits;
|
||||
VolumeInfo->TotalSize = Memfs->MaxFileNodes * Memfs->MaxFileSize;
|
||||
VolumeInfo->FreeSize =
|
||||
(Memfs->MaxFileNodes - MemfsFileNodeMapCount(Memfs->FileNodeMap)) * Memfs->MaxFileSize;
|
||||
VolumeInfo->VolumeCreationTime = RootNode->FileInfo.CreationTime;
|
||||
VolumeInfo->VolumeLabelLength = sizeof L"MEMFS" - sizeof(WCHAR);
|
||||
memcpy(VolumeInfo->VolumeLabel, L"MEMFS", VolumeInfo->VolumeLabelLength);
|
||||
|
Loading…
x
Reference in New Issue
Block a user