| 923 | } |
| 924 | |
| 925 | static USHORT * TranslateHiBlockTable( |
| 926 | TMPQArchive * ha, |
| 927 | ULONGLONG * pcbTableSize) |
| 928 | { |
| 929 | TFileEntry * pFileEntry = ha->pFileTable; |
| 930 | USHORT * pHiBlockTable; |
| 931 | USHORT * pHiBlock; |
| 932 | DWORD dwBlockTableSize = ha->pHeader->dwBlockTableSize; |
| 933 | |
| 934 | // Allocate copy of the hash table |
| 935 | pHiBlockTable = pHiBlock = STORM_ALLOC(USHORT, dwBlockTableSize); |
| 936 | if(pHiBlockTable != NULL) |
| 937 | { |
| 938 | // Copy the block table |
| 939 | for(DWORD i = 0; i < dwBlockTableSize; i++) |
| 940 | pHiBlock[i] = (USHORT)(pFileEntry[i].ByteOffset >> 0x20); |
| 941 | |
| 942 | // Give the size to the caller |
| 943 | if(pcbTableSize != NULL) |
| 944 | *pcbTableSize = (ULONGLONG)dwBlockTableSize * sizeof(USHORT); |
| 945 | } |
| 946 | |
| 947 | return pHiBlockTable; |
| 948 | } |
| 949 | |
| 950 | //----------------------------------------------------------------------------- |
| 951 | // General EXT table functions |