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;
|
||||
else if (0 == _wcsicmp(L"FlushAndPurgeOnCleanup", OptionString))
|
||||
FsAttributeMask |= PtfsFlushAndPurgeOnCleanup;
|
||||
else if (0 == _wcsicmp(L"WslFeatures", OptionString))
|
||||
FsAttributeMask |= PtfsWslFeatures;
|
||||
else
|
||||
goto usage;
|
||||
break;
|
||||
@ -243,6 +245,7 @@ usage:
|
||||
" -o ReparsePoints\n"
|
||||
" -o NamedStreams\n"
|
||||
" -o ExtendedAttributes\n"
|
||||
" -o WslFeatures\n"
|
||||
" -o FlushAndPurgeOnCleanup\n"
|
||||
" -u \\Server\\Share [UNC prefix (single backslash)]\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;
|
||||
NTSTATUS Result;
|
||||
|
||||
if (ExtraBufferIsReparsePoint)
|
||||
{
|
||||
/* no support for WSL */
|
||||
Result = STATUS_INVALID_PARAMETER;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
CreateOptions &=
|
||||
FILE_DIRECTORY_FILE |
|
||||
FILE_NON_DIRECTORY_FILE |
|
||||
@ -198,6 +191,21 @@ static NTSTATUS CreateEx(FSP_FILE_SYSTEM *FileSystem,
|
||||
if (!NT_SUCCESS(Result))
|
||||
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);
|
||||
if (!NT_SUCCESS(Result))
|
||||
goto exit;
|
||||
@ -1154,6 +1162,8 @@ NTSTATUS PtfsCreate(
|
||||
VolumeParams.PassQueryDirectoryPattern = 1;
|
||||
VolumeParams.FlushAndPurgeOnCleanup = (FsAttributeMask & PtfsFlushAndPurgeOnCleanup) ?
|
||||
1 : 0;
|
||||
VolumeParams.WslFeatures = (FsAttributeMask & PtfsWslFeatures) ?
|
||||
1 : 0;
|
||||
VolumeParams.AllowOpenInKernelMode = 1;
|
||||
VolumeParams.RejectIrpPriorToTransact0 = 1;
|
||||
VolumeParams.UmFileContextIsUserContext2 = 1;
|
||||
|
@ -42,11 +42,13 @@ enum
|
||||
PtfsNamedStreams = 0x00000040,
|
||||
PtfsExtendedAttributes = 0x00000100,
|
||||
PtfsFlushAndPurgeOnCleanup = 0x00004000,
|
||||
PtfsWslFeatures = 0x04000000,
|
||||
PtfsAttributesMask =
|
||||
PtfsReparsePoints |
|
||||
PtfsNamedStreams |
|
||||
PtfsExtendedAttributes |
|
||||
PtfsFlushAndPurgeOnCleanup,
|
||||
PtfsFlushAndPurgeOnCleanup |
|
||||
PtfsWslFeatures,
|
||||
};
|
||||
typedef struct
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user