Example #1
0
 private void EnsureState(ZLibNative.ZLibStreamHandle.State requiredState)
 {
     if (this.InitializationState != requiredState)
     {
         throw new InvalidOperationException("InitializationState != " + requiredState.ToString());
     }
 }
Example #2
0
 public ZLibStreamHandle()
     : base(true)
 {
     this.zStream             = new ZLibNative.ZStream();
     this.zStream.zalloc      = ZLibNative.ZNullPtr;
     this.zStream.zfree       = ZLibNative.ZNullPtr;
     this.zStream.opaque      = ZLibNative.ZNullPtr;
     this.initializationState = ZLibNative.ZLibStreamHandle.State.NotInitialized;
     this.handle = IntPtr.Zero;
 }
Example #3
0
 public ZLibNative.ErrorCode InflateEnd()
 {
     this.EnsureNotDisposed();
     this.EnsureState(ZLibNative.ZLibStreamHandle.State.InitializedForInflate);
     RuntimeHelpers.PrepareConstrainedRegions();
     ZLibNative.ErrorCode errorCode;
     try
     {
     }
     finally
     {
         errorCode = ZLibNative.ZLibStreamHandle.NativeZLibDLLStub.inflateEndDelegate(ref this.zStream);
         this.initializationState = ZLibNative.ZLibStreamHandle.State.Disposed;
         ZLibNative.ZLibStreamHandle.zlibLibraryHandle.DangerousRelease();
     }
     return(errorCode);
 }
Example #4
0
            public ZLibNative.ErrorCode InflateInit2_(int windowBits)
            {
                this.EnsureNotDisposed();
                this.EnsureState(ZLibNative.ZLibStreamHandle.State.NotInitialized);
                bool success = false;

                RuntimeHelpers.PrepareConstrainedRegions();
                ZLibNative.ErrorCode errorCode;
                try
                {
                }
                finally
                {
                    errorCode = ZLibNative.ZLibStreamHandle.NativeZLibDLLStub.inflateInit2_Delegate(ref this.zStream, windowBits, "1.2.3", Marshal.SizeOf((object)this.zStream));
                    this.initializationState = ZLibNative.ZLibStreamHandle.State.InitializedForInflate;
                    ZLibNative.ZLibStreamHandle.zlibLibraryHandle.DangerousAddRef(ref success);
                }
                return(errorCode);
            }