Exemplo n.º 1
0
        /// <summary>
        /// Gets the reparse point data associated with a file or directory.
        /// </summary>
        /// <param name="path">The file to query</param>
        /// <returns>The reparse point information</returns>
        public ReparsePoint GetReparsePoint(string path)
        {
            DirectoryEntry dirEntry = GetEntry(path);

            ShortResourceHeader hdr = _file.LocateResource(dirEntry.Hash);

            if (hdr == null)
            {
                throw new IOException("No reparse point");
            }

            using (Stream s = _file.OpenResourceStream(hdr))
            {
                byte[] buffer = new byte[s.Length];
                s.Read(buffer, 0, buffer.Length);
                return(new ReparsePoint((int)dirEntry.ReparseTag, buffer));
            }
        }
Exemplo n.º 2
0
        internal WimFileSystem(WimFile file, int index)
        {
            _file = file;

            ShortResourceHeader metaDataFileInfo = _file.LocateImage(index);
            if (metaDataFileInfo == null)
            {
                throw new ArgumentException("No such image: " + index, "index");
            }

            _metaDataStream = _file.OpenResourceStream(metaDataFileInfo);
            ReadSecurityDescriptors();

            _dirCache = new ObjectCache<long, List<DirectoryEntry>>();
        }
Exemplo n.º 3
0
        internal WimFileSystem(WimFile file, int index)
        {
            _file = file;

            ShortResourceHeader metaDataFileInfo = _file.LocateImage(index);

            if (metaDataFileInfo == null)
            {
                throw new ArgumentException("No such image: " + index, "index");
            }

            _metaDataStream = _file.OpenResourceStream(metaDataFileInfo);
            ReadSecurityDescriptors();

            _dirCache = new ObjectCache <long, List <DirectoryEntry> >();
        }