mirror of
https://github.com/winfsp/winfsp.git
synced 2025-04-23 08:53:01 -05:00
fsctl: move VolumeCreationTime from FSP_FSCTL_VOLUME_INFO to FSP_FSCTL_VOLUME_PARAMS
This commit is contained in:
parent
1b533512d3
commit
003e9a6d91
@ -48,28 +48,6 @@ extern const __declspec(selectany) GUID FspFsvrtDeviceClassGuid =
|
|||||||
#define FSP_FSCTL_TRANSACT_BATCH_BUFFER_SIZEMIN 16384
|
#define FSP_FSCTL_TRANSACT_BATCH_BUFFER_SIZEMIN 16384
|
||||||
#define FSP_FSCTL_TRANSACT_BUFFER_SIZEMIN FSP_FSCTL_TRANSACT_REQ_SIZEMAX
|
#define FSP_FSCTL_TRANSACT_BUFFER_SIZEMIN FSP_FSCTL_TRANSACT_REQ_SIZEMAX
|
||||||
|
|
||||||
/* volume/file metadata */
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
UINT64 TotalSize;
|
|
||||||
UINT64 FreeSize;
|
|
||||||
UINT64 VolumeCreationTime;
|
|
||||||
UINT16 VolumeLabelLength;
|
|
||||||
WCHAR VolumeLabel[32];
|
|
||||||
} FSP_FSCTL_VOLUME_INFO;
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
UINT32 FileAttributes;
|
|
||||||
UINT32 ReparseTag;
|
|
||||||
UINT64 AllocationSize;
|
|
||||||
UINT64 FileSize;
|
|
||||||
UINT64 CreationTime;
|
|
||||||
UINT64 LastAccessTime;
|
|
||||||
UINT64 LastWriteTime;
|
|
||||||
UINT64 ChangeTime;
|
|
||||||
UINT64 IndexNumber;
|
|
||||||
} FSP_FSCTL_FILE_INFO;
|
|
||||||
|
|
||||||
/* marshalling */
|
/* marshalling */
|
||||||
#pragma warning(push)
|
#pragma warning(push)
|
||||||
#pragma warning(disable:4200) /* zero-sized array in struct/union */
|
#pragma warning(disable:4200) /* zero-sized array in struct/union */
|
||||||
@ -106,7 +84,7 @@ enum
|
|||||||
FspFsctlIrpTimeoutMinimum = 60000,
|
FspFsctlIrpTimeoutMinimum = 60000,
|
||||||
FspFsctlIrpTimeoutMaximum = 600000,
|
FspFsctlIrpTimeoutMaximum = 600000,
|
||||||
FspFsctlIrpTimeoutDefault = 300000,
|
FspFsctlIrpTimeoutDefault = 300000,
|
||||||
FspFsctlIrpTimeoutDebug = 142, /* special value for IRP timeout testing; debug driver only */
|
FspFsctlIrpTimeoutDebug = 142, /* special value for IRP timeout testing */
|
||||||
FspFsctlIrpCapacityMinimum = 100,
|
FspFsctlIrpCapacityMinimum = 100,
|
||||||
FspFsctlIrpCapacityMaximum = 1000,
|
FspFsctlIrpCapacityMaximum = 1000,
|
||||||
FspFsctlIrpCapacityDefault = 1000,
|
FspFsctlIrpCapacityDefault = 1000,
|
||||||
@ -118,6 +96,7 @@ typedef struct
|
|||||||
UINT16 SectorSize;
|
UINT16 SectorSize;
|
||||||
UINT16 SectorsPerAllocationUnit;
|
UINT16 SectorsPerAllocationUnit;
|
||||||
UINT16 MaxComponentLength; /* maximum file name component length (bytes) */
|
UINT16 MaxComponentLength; /* maximum file name component length (bytes) */
|
||||||
|
UINT64 VolumeCreationTime;
|
||||||
UINT32 VolumeSerialNumber;
|
UINT32 VolumeSerialNumber;
|
||||||
/* I/O timeouts, capacity, etc. */
|
/* I/O timeouts, capacity, etc. */
|
||||||
UINT32 TransactTimeout; /* FSP_FSCTL_TRANSACT timeout (millis; 1 sec - 10 sec) */
|
UINT32 TransactTimeout; /* FSP_FSCTL_TRANSACT timeout (millis; 1 sec - 10 sec) */
|
||||||
@ -137,6 +116,25 @@ typedef struct
|
|||||||
WCHAR Prefix[64]; /* UNC prefix to recognize (\\server\path format, 0-term) */
|
WCHAR Prefix[64]; /* UNC prefix to recognize (\\server\path format, 0-term) */
|
||||||
} FSP_FSCTL_VOLUME_PARAMS;
|
} FSP_FSCTL_VOLUME_PARAMS;
|
||||||
typedef struct
|
typedef struct
|
||||||
|
{
|
||||||
|
UINT64 TotalSize;
|
||||||
|
UINT64 FreeSize;
|
||||||
|
UINT16 VolumeLabelLength;
|
||||||
|
WCHAR VolumeLabel[32];
|
||||||
|
} FSP_FSCTL_VOLUME_INFO;
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
UINT32 FileAttributes;
|
||||||
|
UINT32 ReparseTag;
|
||||||
|
UINT64 AllocationSize;
|
||||||
|
UINT64 FileSize;
|
||||||
|
UINT64 CreationTime;
|
||||||
|
UINT64 LastAccessTime;
|
||||||
|
UINT64 LastWriteTime;
|
||||||
|
UINT64 ChangeTime;
|
||||||
|
UINT64 IndexNumber;
|
||||||
|
} FSP_FSCTL_FILE_INFO;
|
||||||
|
typedef struct
|
||||||
{
|
{
|
||||||
UINT16 Offset;
|
UINT16 Offset;
|
||||||
UINT16 Size;
|
UINT16 Size;
|
||||||
|
@ -180,7 +180,7 @@ static NTSTATUS FspFsvolQueryFsVolumeInformation(
|
|||||||
PUINT8 Buffer = (PUINT8)Info->VolumeLabel;
|
PUINT8 Buffer = (PUINT8)Info->VolumeLabel;
|
||||||
ULONG CopyLength;
|
ULONG CopyLength;
|
||||||
|
|
||||||
Info->VolumeCreationTime.QuadPart = VolumeInfo->VolumeCreationTime;
|
Info->VolumeCreationTime.QuadPart = FsvolDeviceExtension->VolumeParams.VolumeCreationTime;
|
||||||
Info->VolumeSerialNumber = FsvolDeviceExtension->VolumeParams.VolumeSerialNumber;
|
Info->VolumeSerialNumber = FsvolDeviceExtension->VolumeParams.VolumeSerialNumber;
|
||||||
Info->VolumeLabelLength = VolumeInfo->VolumeLabelLength;
|
Info->VolumeLabelLength = VolumeInfo->VolumeLabelLength;
|
||||||
Info->SupportsObjects = FALSE;
|
Info->SupportsObjects = FALSE;
|
||||||
|
@ -205,7 +205,6 @@ static NTSTATUS GetVolumeInfo(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
VolumeInfo->TotalSize = Memfs->MaxFileNodes * Memfs->MaxFileSize;
|
VolumeInfo->TotalSize = Memfs->MaxFileNodes * Memfs->MaxFileSize;
|
||||||
VolumeInfo->FreeSize =
|
VolumeInfo->FreeSize =
|
||||||
(Memfs->MaxFileNodes - MemfsFileNodeMapCount(Memfs->FileNodeMap)) * Memfs->MaxFileSize;
|
(Memfs->MaxFileNodes - MemfsFileNodeMapCount(Memfs->FileNodeMap)) * Memfs->MaxFileSize;
|
||||||
VolumeInfo->VolumeCreationTime = RootNode->FileInfo.CreationTime;
|
|
||||||
VolumeInfo->VolumeLabelLength = sizeof L"MEMFS" - sizeof(WCHAR);
|
VolumeInfo->VolumeLabelLength = sizeof L"MEMFS" - sizeof(WCHAR);
|
||||||
memcpy(VolumeInfo->VolumeLabel, L"MEMFS", VolumeInfo->VolumeLabelLength);
|
memcpy(VolumeInfo->VolumeLabel, L"MEMFS", VolumeInfo->VolumeLabelLength);
|
||||||
|
|
||||||
@ -601,6 +600,7 @@ NTSTATUS MemfsCreate(ULONG Flags, ULONG FileInfoTimeout,
|
|||||||
memset(&VolumeParams, 0, sizeof VolumeParams);
|
memset(&VolumeParams, 0, sizeof VolumeParams);
|
||||||
VolumeParams.SectorSize = MEMFS_SECTOR_SIZE;
|
VolumeParams.SectorSize = MEMFS_SECTOR_SIZE;
|
||||||
VolumeParams.SectorsPerAllocationUnit = MEMFS_SECTORS_PER_ALLOCATION_UNIT;
|
VolumeParams.SectorsPerAllocationUnit = MEMFS_SECTORS_PER_ALLOCATION_UNIT;
|
||||||
|
VolumeParams.VolumeCreationTime = MemfsGetSystemTime();
|
||||||
VolumeParams.VolumeSerialNumber = (UINT32)(MemfsGetSystemTime() / (10000 * 1000));
|
VolumeParams.VolumeSerialNumber = (UINT32)(MemfsGetSystemTime() / (10000 * 1000));
|
||||||
VolumeParams.FileInfoTimeout = FileInfoTimeout;
|
VolumeParams.FileInfoTimeout = FileInfoTimeout;
|
||||||
VolumeParams.CaseSensitiveSearch = 1;
|
VolumeParams.CaseSensitiveSearch = 1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user