diff options
| author | Ladislav Zezula <E:\Ladik\Mail> | 2016-03-13 16:17:00 +0100 | 
|---|---|---|
| committer | Ladislav Zezula <E:\Ladik\Mail> | 2016-03-13 16:17:00 +0100 | 
| commit | b5b9acbaf081034e148f41af28a59ca5e29af282 (patch) | |
| tree | 85789b305a0d3d76088a34febe91e3c6861fb535 /src | |
| parent | f764c5a96294514559b17c3561be08cf1d304522 (diff) | |
+ Updates
Diffstat (limited to 'src')
| -rw-r--r-- | src/SBaseFileTable.cpp | 6 | ||||
| -rw-r--r-- | src/SFileGetFileInfo.cpp | 11 | ||||
| -rw-r--r-- | src/StormLib.h | 1 | 
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;  //----------------------------------------------------------------------------- | 
