Exemplo n.º 1
0
        /// <inheritdoc />
        public void GetChainOfReparsePoints(SafeFileHandle handle, string sourcePath, IList <string> chainOfReparsePoints)
        {
            Contract.Requires(!string.IsNullOrWhiteSpace(sourcePath));
            Contract.Requires(chainOfReparsePoints != null);

            do
            {
                chainOfReparsePoints.Add(sourcePath);

                var possibleReparsePointType = TryGetReparsePointType(sourcePath);
                if (!possibleReparsePointType.Succeeded || !possibleReparsePointType.Result.IsActionable())
                {
                    return;
                }

                var possibleTarget = TryGetReparsePointTarget(handle, sourcePath);
                if (!possibleTarget.Succeeded)
                {
                    return;
                }

                sourcePath = FileUtilities.ConvertReparsePointTargetPathToAbsolutePath(sourcePath, possibleTarget.Result);
            } while (true);
        }