コード例 #1
0
        /// <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
ファイル: Archive.cs プロジェクト: bra1nb3am3r/unrarit
        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);
        }
コード例 #3
0
 /// <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
ファイル: Archive.cs プロジェクト: vaginessa/unrarit
 internal Archive(FileInfo aFile, IArchiveOpenCallback callback, Guid format)
 {
     stream = new SevenZipFileStream(aFile, FileMode.Open, FileAccess.Read);
       InternalOpen(callback, format);
 }
コード例 #5
0
ファイル: Archive.cs プロジェクト: vaginessa/unrarit
        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
ファイル: Archive.cs プロジェクト: vaginessa/unrarit
 public void Open(IInStream s, ref UInt64 maxCheckStartPosition, IArchiveOpenCallback openArchiveCallback)
 {
     throw new NotImplementedException();
 }
コード例 #7
0
ファイル: Archive.cs プロジェクト: bra1nb3am3r/unrarit
 internal Archive(FileInfo aFile, IArchiveOpenCallback callback, Guid format)
 {
     stream = new SevenZipFileStream(aFile, FileMode.Open, FileAccess.Read);
     InternalOpen(callback, format);
 }
コード例 #8
0
ファイル: Archive.cs プロジェクト: bra1nb3am3r/unrarit
 public void Open(IInStream s, ref UInt64 maxCheckStartPosition, IArchiveOpenCallback openArchiveCallback)
 {
     throw new NotImplementedException();
 }
コード例 #9
0
 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;
 }