/// <summary>
        /// Opens the archive and throws exceptions or returns OperationResult.DataError if any error occurs.
        /// </summary>
        /// <param name="archiveStream">The IInStream compliant class instance, that is, the input stream.</param>
        /// <param name="openCallback">The ArchiveOpenCallback instance.</param>
        /// <returns>OperationResult.Ok if Open() succeeds.</returns>
        private OperationResult OpenArchiveInner(IInStream archiveStream,
                                                 IArchiveOpenCallback openCallback)
        {
            ulong checkPos = 1 << 15;
            int   res      = _archive.Open(archiveStream, ref checkPos, openCallback);

            return((OperationResult)res);
        }
Пример #2
0
        private void InternalOpen(IArchiveOpenCallback callback, Guid format)
        {
            var    Interface = typeof(IInArchive).GUID;
            object result;

            if (CpuInfo.IsX64)
            {
                SafeNativeMethods.CreateObject_64(ref format, ref Interface, out result);
            }
            else
            {
                SafeNativeMethods.CreateObject_32(ref format, ref Interface, out result);
            }
            if (result == null)
            {
                throw new COMException("Cannot create Archive");
            }
            inArchive = result as IInArchive;

            var sp = (ulong)(1 << 23);

            inArchive.Open(stream, ref sp, callback);
        }
 /// <summary>
 /// Opens the archive and throws exceptions or returns OperationResult.DataError if any error occurs.
 /// </summary>       
 /// <param name="archiveStream">The IInStream compliant class instance, that is, the input stream.</param>
 /// <param name="openCallback">The ArchiveOpenCallback instance.</param>
 /// <returns>OperationResult.Ok if Open() succeeds.</returns>
 private OperationResult OpenArchiveInner(IInStream archiveStream,
     IArchiveOpenCallback openCallback)
 {
     ulong checkPos = 1 << 15;
     int res = _archive.Open(archiveStream, ref checkPos, openCallback);
     return (OperationResult)res;
 }
Пример #4
0
 internal Archive(FileInfo aFile, IArchiveOpenCallback callback, Guid format)
 {
     stream = new SevenZipFileStream(aFile, FileMode.Open, FileAccess.Read);
       InternalOpen(callback, format);
 }
Пример #5
0
        private void InternalOpen(IArchiveOpenCallback callback, Guid format)
        {
            var Interface = typeof(IInArchive).GUID;
              object result;
              if (CpuInfo.IsX64) {
            SafeNativeMethods.CreateObject_64(ref format, ref Interface, out result);
              }
              else {
            SafeNativeMethods.CreateObject_32(ref format, ref Interface, out result);
              }
              if (result == null) {
            throw new COMException("Cannot create Archive");
              }
              inArchive = result as IInArchive;

              var sp = (ulong)(1 << 23);
              inArchive.Open(stream, ref sp, callback);
        }
Пример #6
0
 public void Open(IInStream s, ref UInt64 maxCheckStartPosition, IArchiveOpenCallback openArchiveCallback)
 {
     throw new NotImplementedException();
 }
Пример #7
0
 internal Archive(FileInfo aFile, IArchiveOpenCallback callback, Guid format)
 {
     stream = new SevenZipFileStream(aFile, FileMode.Open, FileAccess.Read);
     InternalOpen(callback, format);
 }
Пример #8
0
 public void Open(IInStream s, ref UInt64 maxCheckStartPosition, IArchiveOpenCallback openArchiveCallback)
 {
     throw new NotImplementedException();
 }
 public int Open(IInStream stream, ulong maxCheckStartPosition, IArchiveOpenCallback openArchiveCallback)
 {
     int num2;
     this.EnterArchiveLock();
     try
     {
         int num = this.Archive.Open(stream, ref maxCheckStartPosition, openArchiveCallback);
         this.Flush();
         num2 = num;
     }
     finally
     {
         Monitor.Exit(this.ArchiveLock);
     }
     return num2;
 }