| 705 | } |
| 706 | |
| 707 | static DWORD BuildMapOfArchiveIndices(TCascStorage * hs) |
| 708 | { |
| 709 | PCASC_EKEY_ENTRY pEKeyEntry; |
| 710 | size_t nItemCount = hs->IndexArray.ItemCount(); |
| 711 | DWORD dwErrCode; |
| 712 | |
| 713 | // Create the map |
| 714 | dwErrCode = hs->IndexMap.Create(nItemCount, MD5_HASH_SIZE, FIELD_OFFSET(CASC_EKEY_ENTRY, EKey)); |
| 715 | if(dwErrCode != ERROR_SUCCESS) |
| 716 | return dwErrCode; |
| 717 | |
| 718 | // Insert all items |
| 719 | for(size_t i = 0; i < nItemCount; i++) |
| 720 | { |
| 721 | pEKeyEntry = (PCASC_EKEY_ENTRY)hs->IndexArray.ItemAt(i); |
| 722 | if(pEKeyEntry != NULL) |
| 723 | { |
| 724 | if(!hs->IndexMap.InsertObject(pEKeyEntry, pEKeyEntry->EKey)) |
| 725 | { |
| 726 | return ERROR_NOT_ENOUGH_MEMORY; |
| 727 | } |
| 728 | } |
| 729 | } |
| 730 | |
| 731 | return dwErrCode; |
| 732 | } |
| 733 | |
| 734 | static DWORD LoadArchiveIndexFiles(TCascStorage * hs) |
| 735 | { |
no test coverage detected