From ccf58122a2145c3d64d073c559ab99cf8f3b4a20 Mon Sep 17 00:00:00 2001 From: Bill Zissimopoulos Date: Mon, 12 Sep 2016 15:27:31 -0700 Subject: [PATCH] sys: FspFsvolFileSystemControlReparsePoint: comments --- src/sys/fsctl.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/sys/fsctl.c b/src/sys/fsctl.c index 1ac8adaa..ebd6f732 100644 --- a/src/sys/fsctl.c +++ b/src/sys/fsctl.c @@ -159,23 +159,29 @@ static NTSTATUS FspFsvolFileSystemControlReparsePoint( TargetObjectName.Length = TargetObjectName.MaximumLength = ReparseTargetPathLength; TargetObjectName.Buffer = ReparseTargetPath; + /* get a pointer to the target device */ Result = FspGetDeviceObjectPointer(&TargetObjectName, FILE_READ_DATA, &TargetFileNameIndex, &TargetFileObject, &TargetDeviceObject); if (!NT_SUCCESS(Result)) goto target_check_exit; + /* is the target device the same as ours? */ if (TargetFileNameIndex < ReparseTargetPathLength && IoGetRelatedDeviceObject(FileObject) == TargetDeviceObject) { if (0 == FsvolDeviceExtension->VolumePrefix.Length) + /* not going thru MUP: DONE! */ TargetOnFileSystem = (UINT16)TargetFileNameIndex; else { + /* going thru MUP cases: \Device\Volume{GUID} and \??\UNC\{VolumePrefix} */ ProviderInfoSize = sizeof ProviderInfo; Result = FsRtlMupGetProviderInfoFromFileObject(TargetFileObject, 1, &ProviderInfo, &ProviderInfoSize); if (NT_SUCCESS(Result)) { + /* case \Device\Volume{GUID}: is the targer provider id same as ours? */ + TargetProviderId = ProviderInfo.ProviderId; ProviderInfoSize = sizeof ProviderInfo; @@ -189,6 +195,8 @@ static NTSTATUS FspFsvolFileSystemControlReparsePoint( } else { + /* case \??\UNC\{VolumePrefix}: is the target volume prefix same as ours? */ + TargetObjectName.Length = TargetObjectName.MaximumLength = FsvolDeviceExtension->VolumePrefix.Length; TargetObjectName.Buffer = ReparseTargetPath +