mirror of
https://github.com/winfsp/winfsp.git
synced 2025-04-22 08:23:05 -05:00
tst: ntptfs: WslFeatures
This commit is contained in:
parent
13810e94fc
commit
f28902dd7b
@ -124,6 +124,8 @@ static NTSTATUS SvcStart(FSP_SERVICE *Service, ULONG argc, PWSTR *argv)
|
|||||||
FsAttributeMask |= PtfsExtendedAttributes;
|
FsAttributeMask |= PtfsExtendedAttributes;
|
||||||
else if (0 == _wcsicmp(L"FlushAndPurgeOnCleanup", OptionString))
|
else if (0 == _wcsicmp(L"FlushAndPurgeOnCleanup", OptionString))
|
||||||
FsAttributeMask |= PtfsFlushAndPurgeOnCleanup;
|
FsAttributeMask |= PtfsFlushAndPurgeOnCleanup;
|
||||||
|
else if (0 == _wcsicmp(L"WslFeatures", OptionString))
|
||||||
|
FsAttributeMask |= PtfsWslFeatures;
|
||||||
else
|
else
|
||||||
goto usage;
|
goto usage;
|
||||||
break;
|
break;
|
||||||
@ -243,6 +245,7 @@ usage:
|
|||||||
" -o ReparsePoints\n"
|
" -o ReparsePoints\n"
|
||||||
" -o NamedStreams\n"
|
" -o NamedStreams\n"
|
||||||
" -o ExtendedAttributes\n"
|
" -o ExtendedAttributes\n"
|
||||||
|
" -o WslFeatures\n"
|
||||||
" -o FlushAndPurgeOnCleanup\n"
|
" -o FlushAndPurgeOnCleanup\n"
|
||||||
" -u \\Server\\Share [UNC prefix (single backslash)]\n"
|
" -u \\Server\\Share [UNC prefix (single backslash)]\n"
|
||||||
" -p Directory [directory to expose as pass through file system]\n"
|
" -p Directory [directory to expose as pass through file system]\n"
|
||||||
|
@ -153,13 +153,6 @@ static NTSTATUS CreateEx(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
UINT32 MaximumAccess = IsDirectory ? GrantedAccess : MAXIMUM_ALLOWED;
|
UINT32 MaximumAccess = IsDirectory ? GrantedAccess : MAXIMUM_ALLOWED;
|
||||||
NTSTATUS Result;
|
NTSTATUS Result;
|
||||||
|
|
||||||
if (ExtraBufferIsReparsePoint)
|
|
||||||
{
|
|
||||||
/* no support for WSL */
|
|
||||||
Result = STATUS_INVALID_PARAMETER;
|
|
||||||
goto exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
CreateOptions &=
|
CreateOptions &=
|
||||||
FILE_DIRECTORY_FILE |
|
FILE_DIRECTORY_FILE |
|
||||||
FILE_NON_DIRECTORY_FILE |
|
FILE_NON_DIRECTORY_FILE |
|
||||||
@ -198,6 +191,21 @@ static NTSTATUS CreateEx(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
if (!NT_SUCCESS(Result))
|
if (!NT_SUCCESS(Result))
|
||||||
goto exit;
|
goto exit;
|
||||||
|
|
||||||
|
if (ExtraBufferIsReparsePoint)
|
||||||
|
{
|
||||||
|
/* this can happen on a WSL mount */
|
||||||
|
Result = LfsFsControlFile(
|
||||||
|
Handle,
|
||||||
|
FSCTL_SET_REPARSE_POINT,
|
||||||
|
ExtraBuffer,
|
||||||
|
(ULONG)ExtraLength,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
&ExtraLength);
|
||||||
|
if (!NT_SUCCESS(Result))
|
||||||
|
goto exit;
|
||||||
|
}
|
||||||
|
|
||||||
Result = LfsGetFileInfo(Handle, Ptfs->RootPrefixLength, FileInfo);
|
Result = LfsGetFileInfo(Handle, Ptfs->RootPrefixLength, FileInfo);
|
||||||
if (!NT_SUCCESS(Result))
|
if (!NT_SUCCESS(Result))
|
||||||
goto exit;
|
goto exit;
|
||||||
@ -1154,6 +1162,8 @@ NTSTATUS PtfsCreate(
|
|||||||
VolumeParams.PassQueryDirectoryPattern = 1;
|
VolumeParams.PassQueryDirectoryPattern = 1;
|
||||||
VolumeParams.FlushAndPurgeOnCleanup = (FsAttributeMask & PtfsFlushAndPurgeOnCleanup) ?
|
VolumeParams.FlushAndPurgeOnCleanup = (FsAttributeMask & PtfsFlushAndPurgeOnCleanup) ?
|
||||||
1 : 0;
|
1 : 0;
|
||||||
|
VolumeParams.WslFeatures = (FsAttributeMask & PtfsWslFeatures) ?
|
||||||
|
1 : 0;
|
||||||
VolumeParams.AllowOpenInKernelMode = 1;
|
VolumeParams.AllowOpenInKernelMode = 1;
|
||||||
VolumeParams.RejectIrpPriorToTransact0 = 1;
|
VolumeParams.RejectIrpPriorToTransact0 = 1;
|
||||||
VolumeParams.UmFileContextIsUserContext2 = 1;
|
VolumeParams.UmFileContextIsUserContext2 = 1;
|
||||||
|
@ -42,11 +42,13 @@ enum
|
|||||||
PtfsNamedStreams = 0x00000040,
|
PtfsNamedStreams = 0x00000040,
|
||||||
PtfsExtendedAttributes = 0x00000100,
|
PtfsExtendedAttributes = 0x00000100,
|
||||||
PtfsFlushAndPurgeOnCleanup = 0x00004000,
|
PtfsFlushAndPurgeOnCleanup = 0x00004000,
|
||||||
|
PtfsWslFeatures = 0x04000000,
|
||||||
PtfsAttributesMask =
|
PtfsAttributesMask =
|
||||||
PtfsReparsePoints |
|
PtfsReparsePoints |
|
||||||
PtfsNamedStreams |
|
PtfsNamedStreams |
|
||||||
PtfsExtendedAttributes |
|
PtfsExtendedAttributes |
|
||||||
PtfsFlushAndPurgeOnCleanup,
|
PtfsFlushAndPurgeOnCleanup |
|
||||||
|
PtfsWslFeatures,
|
||||||
};
|
};
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user