Current News Archived News Search News Discussion Forum Old Forum Install Programs More Downloads... Troubleshooting Source Code Format Specs. Misc. Information Non-SF Stuff Links Small banner for links to this site: |
diff --git a/SFmpqapi.cpp b/SFmpqapi.cpp
--- a/SFmpqapi.cpp
+++ b/SFmpqapi.cpp
@@ -375,7 +375,7 @@ BOOL WINAPI MpqOpenArchiveEx(LPCSTR lpFileName, DWORD dwPriority, DWORD dwFlags,
}
memcpy(&mpqOpenArc->MpqHeader.dwMPQID,ID_MPQ,4);
mpqOpenArc->MpqHeader.dwHeaderSize = sizeof(MPQHEADER);
- mpqOpenArc->MpqHeader.wUnused0C = 0;
+ mpqOpenArc->MpqHeader.wVersion = 0;
if (dwBlockSize & 0xFFFF0000)
mpqOpenArc->MpqHeader.wBlockSize = DEFAULT_BLOCK_SIZE;
else
diff --git a/SFmpqapi.h b/SFmpqapi.h
--- a/SFmpqapi.h
+++ b/SFmpqapi.h
struct MPQARCHIVE;
struct MPQFILE;
struct MPQHEADER;
+struct MPQHEADER_EX;
struct BLOCKTABLEENTRY;
struct HASHTABLEENTRY;
DWORD dwMPQID; //"MPQ\x1A" for mpq's, "BN3\x1A" for bncache.dat
DWORD dwHeaderSize; // Size of this header
DWORD dwMPQSize; //The size of the mpq archive
- WORD wUnused0C; // Seems to always be 0
+ WORD wVersion; // 0 for original format, 1 for large archive
WORD wBlockSize; // Size of blocks in files equals 512 << wBlockSize
DWORD dwHashTableOffset; // Offset to hash table
DWORD dwBlockTableOffset; // Offset to block table
DWORD dwBlockTableSize; // Number of entries in block table
};
+// Large archive format only
+struct MPQHEADER_EX {
+ UINT64 qwExtendedBlockOffsetTable; // Offset to table containing upper 16 bits of block offsets
+ WORD wHashTableOffsetHigh; // High 16 bits of the hash table offset for large archives
+ WORD wBlockTableOffsetHigh; // High 16 bits of the block table offset for large archives
+};
+
#include <poppack.h>
//Archive handles may be typecasted to this struct so you can access
DWORD dwFlags; //The only flags that should be changed are MOAU_MAINTAIN_LISTFILE and MOAU_MAINTAIN_ATTRIBUTES, changing any others can have unpredictable effects
LPSTR lpFileName;
DWORD dwExtraFlags;
+ MPQHEADER_EX MpqHeader_Ex;
+ WORD * lpFileOffsetsHigh;
};
//Handles to files in the archive may be typecasted to this struct
// Extra struct members used by SFmpq
HASHTABLEENTRY *lpHashEntry;
LPSTR lpFileName;
+ WORD wFileOffsetHigh;
};
#include <pshpack1.h>
|