diff --git a/inc/winfsp/fsctl.h b/inc/winfsp/fsctl.h index fcf705db..5042a4fa 100644 --- a/inc/winfsp/fsctl.h +++ b/inc/winfsp/fsctl.h @@ -48,28 +48,6 @@ extern const __declspec(selectany) GUID FspFsvrtDeviceClassGuid = #define FSP_FSCTL_TRANSACT_BATCH_BUFFER_SIZEMIN 16384 #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 */ #pragma warning(push) #pragma warning(disable:4200) /* zero-sized array in struct/union */ @@ -106,7 +84,7 @@ enum FspFsctlIrpTimeoutMinimum = 60000, FspFsctlIrpTimeoutMaximum = 600000, FspFsctlIrpTimeoutDefault = 300000, - FspFsctlIrpTimeoutDebug = 142, /* special value for IRP timeout testing; debug driver only */ + FspFsctlIrpTimeoutDebug = 142, /* special value for IRP timeout testing */ FspFsctlIrpCapacityMinimum = 100, FspFsctlIrpCapacityMaximum = 1000, FspFsctlIrpCapacityDefault = 1000, @@ -118,6 +96,7 @@ typedef struct UINT16 SectorSize; UINT16 SectorsPerAllocationUnit; UINT16 MaxComponentLength; /* maximum file name component length (bytes) */ + UINT64 VolumeCreationTime; UINT32 VolumeSerialNumber; /* I/O timeouts, capacity, etc. */ 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) */ } FSP_FSCTL_VOLUME_PARAMS; 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 Size; diff --git a/src/sys/volinfo.c b/src/sys/volinfo.c index 5adcd1cf..64d4002f 100644 --- a/src/sys/volinfo.c +++ b/src/sys/volinfo.c @@ -180,7 +180,7 @@ static NTSTATUS FspFsvolQueryFsVolumeInformation( PUINT8 Buffer = (PUINT8)Info->VolumeLabel; ULONG CopyLength; - Info->VolumeCreationTime.QuadPart = VolumeInfo->VolumeCreationTime; + Info->VolumeCreationTime.QuadPart = FsvolDeviceExtension->VolumeParams.VolumeCreationTime; Info->VolumeSerialNumber = FsvolDeviceExtension->VolumeParams.VolumeSerialNumber; Info->VolumeLabelLength = VolumeInfo->VolumeLabelLength; Info->SupportsObjects = FALSE; diff --git a/tst/winfsp-tests/memfs.cpp b/tst/winfsp-tests/memfs.cpp index 8569de80..7322b431 100644 --- a/tst/winfsp-tests/memfs.cpp +++ b/tst/winfsp-tests/memfs.cpp @@ -205,7 +205,6 @@ static NTSTATUS GetVolumeInfo(FSP_FILE_SYSTEM *FileSystem, 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); @@ -601,6 +600,7 @@ NTSTATUS MemfsCreate(ULONG Flags, ULONG FileInfoTimeout, memset(&VolumeParams, 0, sizeof VolumeParams); VolumeParams.SectorSize = MEMFS_SECTOR_SIZE; VolumeParams.SectorsPerAllocationUnit = MEMFS_SECTORS_PER_ALLOCATION_UNIT; + VolumeParams.VolumeCreationTime = MemfsGetSystemTime(); VolumeParams.VolumeSerialNumber = (UINT32)(MemfsGetSystemTime() / (10000 * 1000)); VolumeParams.FileInfoTimeout = FileInfoTimeout; VolumeParams.CaseSensitiveSearch = 1;