private bool Open(string file, uint Prio, OpenArchiveFlags Flags) { bool r = StormLib.SFileOpenArchive(file, Prio, Flags, out handle); if (r) { OpenPatch(file); } return(r); }
private unsafe bool Open(string file, uint Prio, OpenArchiveFlags Flags) { IntPtr h; IntPtr hp = (IntPtr)(&h); bool r = StormLib.SFileOpenArchive(file, Prio, Flags, hp); if (r) { handle = h; OpenPatch(file); } return(r); }
private MpqArchive(string filePath, MpqArchiveVersion version, MpqFileStreamAttributes listfileAttributes, MpqFileStreamAttributes attributesFileAttributes, int maxFileCount) : this() { if (maxFileCount < 0) { throw new ArgumentException("maxFileCount"); } OpenArchiveFlags flags = OpenArchiveFlags.TypeIsFile | OpenArchiveFlags.AccessReadWriteShare; flags |= (OpenArchiveFlags)version; if (!NativeMethods.SFileCreateArchive(filePath, (uint)flags, int.MaxValue, out _handle)) { throw new Win32Exception(); } }
public MpqArchive(string filePath, FileAccess accessType, OpenArchiveFlags dwflags = OpenArchiveFlags.None) : this() { FilePath = filePath; _accessType = accessType; OpenArchiveFlags flags = OpenArchiveFlags.TypeIsFile; if (accessType == FileAccess.Read) { flags |= OpenArchiveFlags.AccessReadOnly; } else { flags |= OpenArchiveFlags.AccessReadWriteShare; } flags |= dwflags; // constant 2 = SFILE_OPEN_HARD_DISK_FILE if (!NativeMethods.SFileOpenArchive(filePath, 2, flags, out _handle)) { throw new Win32Exception(); // Implicitly calls GetLastError } }
private bool Open(string file, uint Prio, OpenArchiveFlags Flags) { bool r = StormLib.SFileOpenArchive(file, Prio, Flags, out handle); if (r) OpenPatch(file); return r; }
public MpqArchive(string file, uint Prio, OpenArchiveFlags Flags) { bool r = Open(file, Prio, Flags); }
public static extern bool OpenArchive([In] [MarshalAs(UnmanagedType.LPStr)] string fileName, uint priority, OpenArchiveFlags flags, out IntPtr archiveHandle);
public static extern bool SFileOpenPatchArchive(MpqArchiveSafeHandle hMpq, [MarshalAs(UnmanagedType.LPTStr)] string szPatchMpqName, [MarshalAs(UnmanagedType.LPStr)] string szPatchPathPrefix, OpenArchiveFlags dwFlags);
public static extern bool SFileOpenArchive([MarshalAs(UnmanagedType.LPTStr)] string szMpqName, uint dwPriority, OpenArchiveFlags dwFlags, out MpqArchiveSafeHandle phMpq);
public static extern bool OpenArchive([In][MarshalAs(UnmanagedType.LPStr)] string fileName, uint priority, OpenArchiveFlags flags, out IntPtr archiveHandle);
private unsafe bool Open(string file, uint Prio, OpenArchiveFlags Flags) { IntPtr h; IntPtr hp = (IntPtr)(&h); bool r = StormLib.SFileOpenArchive(file, Prio, Flags, hp); if (r) { handle = h; OpenPatch(file); } return r; }
public static extern bool SFileOpenArchive( [MarshalAs(UnmanagedType.LPStr)] string mpqFileName, uint priority, [MarshalAs(UnmanagedType.U4)] OpenArchiveFlags flags, out IntPtr archiveHandle);
public static extern bool SFileOpenArchive( [MarshalAs(UnmanagedType.LPStr)] string szMpqName, uint dwPriority, [MarshalAs(UnmanagedType.U4)] OpenArchiveFlags dwFlags, out IntPtr phMpq);
public MpqArchive(string file, uint Prio, OpenArchiveFlags Flags) { bool r = Open(file, Prio, Flags); }