internal MpqFileStream(string internalPath, MpqArchive parent)
        {
            m_owner = parent;

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

            m_path  = internalPath;
            m_hFile = hFile;
        }
Beispiel #2
0
        public static MpqArchive OpenArchive(string fullPath)
        {
            object o = Instance;

            MpqArchive arch = new MpqArchive(fullPath);

            Instance.m_archives.Add(arch);

            return(arch);
        }
        /// <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;
        }
Beispiel #4
0
        public static void CloseArchive(MpqArchive archive)
        {
            object o = Instance;

            archive.Dispose();
        }