From 383e1572eecafdfe4f92ddad7a4bece069e12f38 Mon Sep 17 00:00:00 2001 From: Ladislav Zezula Date: Sun, 13 Dec 2020 12:32:25 +0100 Subject: Added support for amternative MPQ markers --- src/SBaseCommon.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/SBaseCommon.cpp') diff --git a/src/SBaseCommon.cpp b/src/SBaseCommon.cpp index 9003960..700c4a7 100644 --- a/src/SBaseCommon.cpp +++ b/src/SBaseCommon.cpp @@ -20,7 +20,10 @@ char StormLibCopyright[] = "StormLib v " STORMLIB_VERSION_STRING " Copyright Lad //----------------------------------------------------------------------------- // Local variables -LCID lcFileLocale = LANG_NEUTRAL; // File locale +DWORD g_dwMpqSignature = ID_MPQ; // Marker for MPQ header +DWORD g_dwHashTableKey = MPQ_KEY_HASH_TABLE; // Key for hash table +DWORD g_dwBlockTableKey = MPQ_KEY_BLOCK_TABLE; // Key for block table +LCID g_lcFileLocale = LANG_NEUTRAL; // File locale USHORT wPlatform = 0; // File platform //----------------------------------------------------------------------------- @@ -630,7 +633,7 @@ TMPQArchive * IsValidMpqHandle(HANDLE hMpq) { TMPQArchive * ha = (TMPQArchive *)hMpq; - return (ha != NULL && ha->pHeader != NULL && ha->pHeader->dwID == ID_MPQ) ? ha : NULL; + return (ha != NULL && ha->pHeader != NULL && ha->pHeader->dwID == g_dwMpqSignature) ? ha : NULL; } TMPQFile * IsValidFileHandle(HANDLE hFile) -- cgit v1.2.3