예제 #1
0
        /// <summary>
        /// Sets the current position in a file to the given value.
        /// </summary>
        /// <param name="hf">The handle of an open file.</param>
        /// <param name="dist">The number of bytes to move the pointer.</param>
        /// <param name="seekType">The starting position for the move.  Values are SEEK_CUR, SEEK_END, or SEEK_SET.</param>
        /// <returns>Returns the new file position.  Returns -1 on error.</returns>
        /// <remarks>The File Decompression Interface (FDI) calls this function to position the file pointer.</remarks>
        protected virtual int FileSeek(IntPtr hf, int dist, int seektype)
        {
            Trace.WriteLine(string.Format("FileSeek {0}", hf));
            int err = 0;

            try
            {
                return(CabIO.FileSeek(hf, dist, seektype, ref err, userData));
            }
            finally
            {
                erf.ErrorType = err;
            }
        }
예제 #2
0
 /// <summary>
 /// Sets the current position in a file to the given value.
 /// </summary>
 /// <param name="hf">The handle of an open file.</param>
 /// <param name="dist">The number of bytes to move the pointer.</param>
 /// <param name="seekType">The starting position for the move.  Values are SEEK_CUR, SEEK_END, or SEEK_SET.</param>
 /// <param name="err">Error return value.</param>
 /// <param name="pUserData">User data object.</param>
 /// <returns>Returns the new file position.  Returns -1 on error.</returns>
 /// <remarks>The File Compression Interface (FCI) calls this function to position the file pointer.</remarks>
 protected virtual int FileSeek(IntPtr hf, int dist, int seekType,
                                ref int err, IntPtr pUserData)
 {
     Trace.WriteLine(string.Format("FileSeek {0}", hf));
     return(CabIO.FileSeek(hf, dist, seekType, ref err, ((GCHandle)pUserData).Target));
 }