예제 #1
0
        public List <IsoTableEntryInfo> GetEntriesInfo(IList <IsoTableEntry> entries)
        {
            ProgressTotalChanged.NullSafeInvoke(entries.Count);
            List <IsoTableEntryInfo> result = new List <IsoTableEntryInfo>(entries.Count);

            int counter = 0;

            for (int i = 0; i < entries.Count - 1; i++)
            {
                IsoTableEntry entry          = entries[i];
                long          compressedSize = (entries[i + 1].Sector - entry.Sector) * _isoInfo.SectorSize - entry.Left;
                if (compressedSize < 1)
                {
                    ProgressIncrement.NullSafeInvoke(1);
                    continue;
                }

                long offset            = entry.Sector * _isoInfo.SectorSize;
                IsoTableEntryInfo info = new IsoTableEntryInfo(i, counter++, offset, compressedSize, entry.Flags);

                result.Add(info);
                ProgressIncrement.NullSafeInvoke(1);
            }

            return(result);
        }
예제 #2
0
        public List <IsoTableEntry> GetEntries()
        {
            ProgressTotalChanged.NullSafeInvoke(_isoInfo.MaxEntriesCount);
            List <IsoTableEntry> entries = new List <IsoTableEntry>(_isoInfo.MaxEntriesCount);

            using (MemoryMappedViewStream input = _memory.CreateViewStream(_isoInfo.EntryTableOffset, _isoInfo.MaxEntriesCount * 4, MemoryMappedFileAccess.Read))
            {
                for (int i = 0; i < _isoInfo.MaxEntriesCount; i++)
                {
                    ProgressIncrement.NullSafeInvoke(1);

                    IsoTableEntry entry = input.ReadStruct <IsoTableEntry>();
                    if (entry.Sector == 0)
                    {
                        ProgressTotalChanged.NullSafeInvoke(i);
                        break;
                    }

                    entries.Add(entry);
                }
            }

            return(entries);
        }
예제 #3
0
 public void ChangeTotal(long value)
 {
     ProgressTotalChanged.NullSafeInvoke(value);
 }
예제 #4
0
 public void ReadAdditionalEntriesInfo(IList <IsoTableEntryInfo> infos)
 {
     ProgressTotalChanged.NullSafeInvoke(infos.Count);
     Parallel.ForEach(infos, SafeReadAdditionalEntryInfo);
 }