Ejemplo n.º 1
0
        internal MpqFileStream(string internalPath, MpqArchive parent)
        {
            m_owner = parent;

            IntPtr hFile = LateBoundStormDllApi.SFileOpenFileEx(parent.Handle, internalPath, SearchType.CurrentOnly);

            m_path = internalPath;
            m_hFile = hFile;
        }
Ejemplo n.º 2
0
        internal MpqFileStream(string internalPath, MpqArchive parent)
        {
            m_owner = parent;

            IntPtr hFile = LateBoundStormDllApi.SFileOpenFileEx(parent.Handle, internalPath, SearchType.CurrentOnly);

            m_path  = internalPath;
            m_hFile = hFile;
        }
Ejemplo n.º 3
0
        public static MpqArchive OpenArchive(string fullPath)
        {
            object o = Instance;

            MpqArchive arch = new MpqArchive(fullPath);

            Instance.m_archives.Add(arch);

            return(arch);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Cleans up unmanaged resources in use.
        /// </summary>
        /// <param name="disposing"><c>true</c> if the object is being disposed; <c>false</c> if it is being finalized.</param>
        protected override void Dispose(bool disposing)
        {
            if (m_disposed)
            {
                return;
            }

            if (m_hFile != IntPtr.Zero)
            {
                LateBoundStormDllApi.SFileCloseFile(m_hFile);
                m_hFile = IntPtr.Zero;

                m_owner.FileIsDisposed(this);
                m_owner = null;
                m_path  = null;
            }

            m_disposed = true;
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Cleans up unmanaged resources in use.
        /// </summary>
        /// <param name="disposing"><c>true</c> if the object is being disposed; <c>false</c> if it is being finalized.</param>
        protected override void Dispose(bool disposing)
        {
            if (m_disposed) return;

            if (m_hFile != IntPtr.Zero)
            {
                LateBoundStormDllApi.SFileCloseFile(m_hFile);
                m_hFile = IntPtr.Zero;

                m_owner.FileIsDisposed(this);
                m_owner = null;
                m_path = null;
            }

            m_disposed = true;
        }
Ejemplo n.º 6
0
 internal static void NotifyArchiveDisposed(MpqArchive archive)
 {
     if (Instance.m_archives.Contains(archive))
         Instance.m_archives.Remove(archive);
 }
Ejemplo n.º 7
0
        public static MpqArchive OpenArchive(string fullPath)
        {
            object o = Instance;

            MpqArchive arch = new MpqArchive(fullPath);
            Instance.m_archives.Add(arch);

            return arch;
        }
Ejemplo n.º 8
0
        public static void CloseArchive(MpqArchive archive)
        {
            object o = Instance;

            archive.Dispose();
        }
Ejemplo n.º 9
0
        public static void CloseArchive(MpqArchive archive)
        {
            object o = Instance;

            archive.Dispose();
        }