public static extern bool SFileFinishFile(MpqFileSafeHandle hFile);
 public static extern bool SFileSetFileLocale(
     MpqFileSafeHandle hFile,
     uint lcNewLocale
     );
 public static extern bool SFileGetFileName(
     MpqFileSafeHandle hFile,
     [MarshalAs(UnmanagedType.LPStr)] out string szFileName
     );
 public static extern bool SFileWriteFile(
     MpqFileSafeHandle hFile,
     IntPtr pvData,
     uint dwSize,
     uint dwCompression
     );
 public static extern bool SFileCloseFile(MpqFileSafeHandle hFile);
 public static extern bool SFileGetFileInfo(
     MpqFileSafeHandle hMpqOrFile,
     SFileInfoClass InfoClass,
     IntPtr pvFileInfo,
     uint cbFileInfoSize,
     out uint pcbLengthNeeded
     );
 public static extern uint SFileSetFilePointer(
     MpqFileSafeHandle hFile,
     uint lFilePos,
     ref uint plFilePosHigh,
     uint dwMoveMethod
     );
 public static extern bool SFileReadFile(
     MpqFileSafeHandle hFile,
     IntPtr lpBuffer,
     uint dwToRead,
     out uint pdwRead,
     ref System.Threading.NativeOverlapped lpOverlapped
     );
        public static unsafe uint SFileGetFilePointer(
            MpqFileSafeHandle hFile
            )
        {
            if (hFile.IsInvalid || hFile.IsClosed)
                throw new InvalidOperationException();

            IntPtr handle = hFile.DangerousGetHandle();
            _TMPQFileHeader* header = (_TMPQFileHeader*)handle.ToPointer();
            return header->dwFilePos;
        }
 public static extern uint SFileGetFileSize(MpqFileSafeHandle hFile, ref uint pdwFileSizeHigh);
 public static extern bool SFileOpenFileEx(
     MpqArchiveSafeHandle hMpq,
     [MarshalAs(UnmanagedType.LPStr)] string szFileName,
     uint dwSearchScope,
     out MpqFileSafeHandle phFile
     );
 internal MpqFileStream(MpqFileSafeHandle handle, FileAccess accessType, MpqArchive owner)
 {
     _handle = handle;
     _accessType = accessType;
     _owner = owner;
 }
        protected override void Dispose(bool disposing)
        {
            base.Dispose(disposing);

            if (disposing)
            {
                if (_handle != null && !_handle.IsInvalid)
                {
                    _handle.Close();
                    _handle = null;
                }

                if (_owner != null)
                {
                    _owner.RemoveOwnedFile(this);
                    _owner = null;
                }
            }
        }