internal MpqFileStream(string internalPath, MpqArchive parent) { m_owner = parent; IntPtr hFile = LateBoundStormDllApi.SFileOpenFileEx(parent.Handle, internalPath, SearchType.CurrentOnly); m_path = internalPath; m_hFile = hFile; }
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; }
/// <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; }
internal static void NotifyArchiveDisposed(MpqArchive archive) { if (Instance.m_archives.Contains(archive)) Instance.m_archives.Remove(archive); }
public static MpqArchive OpenArchive(string fullPath) { object o = Instance; MpqArchive arch = new MpqArchive(fullPath); Instance.m_archives.Add(arch); return arch; }
public static void CloseArchive(MpqArchive archive) { object o = Instance; archive.Dispose(); }