mirror of
https://github.com/winfsp/winfsp.git
synced 2025-06-14 15:52:47 -05:00
tst: FlushAndPurgeOnCleanup: testing
This commit is contained in:
@ -39,8 +39,8 @@ NTSTATUS SvcStart(FSP_SERVICE *Service, ULONG argc, PWSTR *argv)
|
||||
wchar_t **argp, **arge;
|
||||
ULONG DebugFlags = 0;
|
||||
PWSTR DebugLogFile = 0;
|
||||
ULONG CaseInsensitiveFlags = 0;
|
||||
ULONG Flags = MemfsDisk;
|
||||
ULONG OtherFlags = 0;
|
||||
ULONG FileInfoTimeout = INFINITE;
|
||||
ULONG MaxFileNodes = 1024;
|
||||
ULONG MaxFileSize = 16 * 1024 * 1024;
|
||||
@ -69,11 +69,14 @@ NTSTATUS SvcStart(FSP_SERVICE *Service, ULONG argc, PWSTR *argv)
|
||||
case L'D':
|
||||
argtos(DebugLogFile);
|
||||
break;
|
||||
case L'f':
|
||||
OtherFlags = MemfsFlushAndPurgeOnCleanup;
|
||||
break;
|
||||
case L'F':
|
||||
argtos(FileSystemName);
|
||||
break;
|
||||
case L'i':
|
||||
CaseInsensitiveFlags = MemfsCaseInsensitive;
|
||||
OtherFlags = MemfsCaseInsensitive;
|
||||
break;
|
||||
case L'm':
|
||||
argtos(MountPoint);
|
||||
@ -138,7 +141,7 @@ NTSTATUS SvcStart(FSP_SERVICE *Service, ULONG argc, PWSTR *argv)
|
||||
}
|
||||
|
||||
Result = MemfsCreateFunnel(
|
||||
CaseInsensitiveFlags | Flags,
|
||||
Flags | OtherFlags,
|
||||
FileInfoTimeout,
|
||||
MaxFileNodes,
|
||||
MaxFileSize,
|
||||
@ -201,6 +204,7 @@ usage:
|
||||
" -d DebugFlags [-1: enable all debug logs]\n"
|
||||
" -D DebugLogFile [file path; use - for stderr]\n"
|
||||
" -i [case insensitive file system]\n"
|
||||
" -f [flush and purge cache on cleanup]\n"
|
||||
" -t FileInfoTimeout [millis]\n"
|
||||
" -n MaxFileNodes\n"
|
||||
" -s MaxFileSize [bytes]\n"
|
||||
|
@ -1959,7 +1959,8 @@ NTSTATUS MemfsCreateFunnel(
|
||||
NTSTATUS Result;
|
||||
FSP_FSCTL_VOLUME_PARAMS VolumeParams;
|
||||
BOOLEAN CaseInsensitive = !!(Flags & MemfsCaseInsensitive);
|
||||
PWSTR DevicePath = (Flags & MemfsNet) ?
|
||||
BOOLEAN FlushAndPurgeOnCleanup = !!(Flags & MemfsFlushAndPurgeOnCleanup);
|
||||
PWSTR DevicePath = MemfsNet == (Flags & MemfsDeviceMask) ?
|
||||
L"" FSP_FSCTL_NET_DEVICE_NAME : L"" FSP_FSCTL_DISK_DEVICE_NAME;
|
||||
UINT64 AllocationUnit;
|
||||
MEMFS *Memfs;
|
||||
@ -2025,6 +2026,7 @@ NTSTATUS MemfsCreateFunnel(
|
||||
#if defined(MEMFS_DIRINFO_BY_NAME)
|
||||
VolumeParams.PassQueryDirectoryFileName = 1;
|
||||
#endif
|
||||
VolumeParams.FlushAndPurgeOnCleanup = FlushAndPurgeOnCleanup;
|
||||
if (0 != VolumePrefix)
|
||||
wcscpy_s(VolumeParams.Prefix, sizeof VolumeParams.Prefix / sizeof(WCHAR), VolumePrefix);
|
||||
wcscpy_s(VolumeParams.FileSystemName, sizeof VolumeParams.FileSystemName / sizeof(WCHAR),
|
||||
|
@ -28,9 +28,11 @@ typedef struct _MEMFS MEMFS;
|
||||
|
||||
enum
|
||||
{
|
||||
MemfsDisk = 0x00,
|
||||
MemfsNet = 0x01,
|
||||
MemfsCaseInsensitive = 0x80,
|
||||
MemfsDisk = 0x00000000,
|
||||
MemfsNet = 0x00000001,
|
||||
MemfsDeviceMask = 0x0000000f,
|
||||
MemfsCaseInsensitive = 0x80000000,
|
||||
MemfsFlushAndPurgeOnCleanup = 0x40000000,
|
||||
};
|
||||
|
||||
#define MemfsCreate(Flags, FileInfoTimeout, MaxFileNodes, MaxFileSize, VolumePrefix, RootSddl, PMemfs)\
|
||||
|
Reference in New Issue
Block a user