| 648 | } |
| 649 | |
| 650 | static DWORD LoadArchiveIndexPage(TCascStorage * hs, CASC_ARCINDEX_FOOTER & InFooter, LPBYTE pbIndexPage, LPBYTE pbIndexPageEnd, size_t nArchive) |
| 651 | { |
| 652 | CASC_EKEY_ENTRY EKeyEntry; |
| 653 | DWORD dwErrCode; |
| 654 | |
| 655 | while (pbIndexPage <= pbIndexPageEnd) |
| 656 | { |
| 657 | // Capture the index entry |
| 658 | dwErrCode = CaptureIndexEntry(InFooter, EKeyEntry, pbIndexPage, pbIndexPageEnd, nArchive); |
| 659 | if(dwErrCode != ERROR_SUCCESS) |
| 660 | break; |
| 661 | |
| 662 | // Insert a new entry to the index array |
| 663 | if((hs->IndexArray.Insert(&EKeyEntry, 1)) == NULL) |
| 664 | return ERROR_NOT_ENOUGH_MEMORY; |
| 665 | |
| 666 | // Move to the next entry |
| 667 | pbIndexPage += InFooter.ItemLength; |
| 668 | } |
| 669 | |
| 670 | return ERROR_SUCCESS; |
| 671 | } |
| 672 | |
| 673 | static DWORD LoadArchiveIndexFile(TCascStorage * hs, LPBYTE pbIndexFile, size_t cbIndexFile, size_t nArchive) |
| 674 | { |
no test coverage detected