aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/SBaseFileTable.cpp6
-rw-r--r--src/SFileGetFileInfo.cpp11
-rw-r--r--src/StormLib.h1
3 files changed, 15 insertions, 3 deletions
diff --git a/src/SBaseFileTable.cpp b/src/SBaseFileTable.cpp
index d822dc7..47bbf0e 100644
--- a/src/SBaseFileTable.cpp
+++ b/src/SBaseFileTable.cpp
@@ -771,9 +771,6 @@ static int BuildFileTableFromBlockTable(
pHashTableEnd = ha->pHashTable + pHeader->dwHashTableSize;
for(pHash = ha->pHashTable; pHash < pHashTableEnd; pHash++)
{
- DWORD dwBlockIndex = pHash->dwBlockIndex;
- DWORD dwNewIndex = pHash->dwBlockIndex;
-
// We need to mask out the upper 4 bits of the block table index.
// This is because it gets shifted out when calculating block table offset
// BlockTableOffset = pHash->dwBlockIndex * 0x10
@@ -792,6 +789,9 @@ static int BuildFileTableFromBlockTable(
if(IsValidHashEntry1(ha, pHash, pBlockTable))
{
+ DWORD dwBlockIndex = pHash->dwBlockIndex;
+ DWORD dwNewIndex = pHash->dwBlockIndex;
+
// Determine the new block index
if(DefragmentTable != NULL)
{
diff --git a/src/SFileGetFileInfo.cpp b/src/SFileGetFileInfo.cpp
index 9874793..365dce5 100644
--- a/src/SFileGetFileInfo.cpp
+++ b/src/SFileGetFileInfo.cpp
@@ -773,6 +773,17 @@ bool WINAPI SFileGetFileInfo(
}
break;
+ case SFileInfoCRC32:
+ hf = IsValidFileHandle(hMpqOrFile);
+ if(hf != NULL && hf->pFileEntry != NULL)
+ {
+ dwInt32Value = hf->pFileEntry->dwCrc32;
+ pvSrcFileInfo = &dwInt32Value;
+ cbSrcFileInfo = sizeof(DWORD);
+ nInfoType = SFILE_INFO_TYPE_DIRECT_POINTER;
+ }
+ break;
+
default: // Invalid info class
SetLastError(ERROR_INVALID_PARAMETER);
return false;
diff --git a/src/StormLib.h b/src/StormLib.h
index 8c3f6f9..22658bd 100644
--- a/src/StormLib.h
+++ b/src/StormLib.h
@@ -435,6 +435,7 @@ typedef enum _SFileInfoClass
SFileInfoFlags, // File flags from (DWORD)
SFileInfoEncryptionKey, // File encryption key
SFileInfoEncryptionKeyRaw, // Unfixed value of the file key
+ SFileInfoCRC32, // CRC32 of the file
} SFileInfoClass;
//-----------------------------------------------------------------------------