| 858 | } |
| 859 | |
| 860 | static TMPQHash * TranslateHashTable( |
| 861 | TMPQArchive * ha, |
| 862 | ULONGLONG * pcbTableSize) |
| 863 | { |
| 864 | TMPQHash * pHashTable; |
| 865 | size_t HashTableSize; |
| 866 | |
| 867 | // Allocate copy of the hash table |
| 868 | pHashTable = STORM_ALLOC(TMPQHash, ha->pHeader->dwHashTableSize); |
| 869 | if(pHashTable != NULL) |
| 870 | { |
| 871 | // Copy the hash table |
| 872 | HashTableSize = sizeof(TMPQHash) * ha->pHeader->dwHashTableSize; |
| 873 | memcpy(pHashTable, ha->pHashTable, HashTableSize); |
| 874 | |
| 875 | // Give the size to the caller |
| 876 | if(pcbTableSize != NULL) |
| 877 | { |
| 878 | *pcbTableSize = (ULONGLONG)HashTableSize; |
| 879 | } |
| 880 | } |
| 881 | |
| 882 | return pHashTable; |
| 883 | } |
| 884 | |
| 885 | // Also used in SFileGetFileInfo |
| 886 | TMPQBlock * TranslateBlockTable( |