| 478 | } |
| 479 | |
| 480 | static DWORD ProcessLocalIndexFiles(TCascStorage * hs, EKEY_ENTRY_CALLBACK PfnEKeyEntry, DWORD dwIndexCount) |
| 481 | { |
| 482 | DWORD dwErrCode = ERROR_SUCCESS; |
| 483 | |
| 484 | // Load each index file |
| 485 | for(DWORD i = 0; i < dwIndexCount; i++) |
| 486 | { |
| 487 | CASC_INDEX & IndexFile = hs->IndexFiles[i]; |
| 488 | |
| 489 | // Inform the user about what we are doing |
| 490 | if(InvokeProgressCallback(hs, "Loading index files", NULL, i, dwIndexCount)) |
| 491 | { |
| 492 | dwErrCode = ERROR_CANCELLED; |
| 493 | break; |
| 494 | } |
| 495 | |
| 496 | // Load the index file |
| 497 | if((dwErrCode = LoadIndexFile(hs, PfnEKeyEntry, IndexFile.FileData.pbData, IndexFile.FileData.cbData, i)) != ERROR_SUCCESS) |
| 498 | break; |
| 499 | } |
| 500 | |
| 501 | // Swallow the "done parsing" error |
| 502 | if(dwErrCode == ERROR_INDEX_PARSING_DONE) |
| 503 | dwErrCode = ERROR_SUCCESS; |
| 504 | |
| 505 | // Remember the number of files that are present locally |
| 506 | hs->LocalFiles = hs->CKeyArray.ItemCount(); |
| 507 | return dwErrCode; |
| 508 | } |
| 509 | |
| 510 | static DWORD LoadLocalIndexFiles(TCascStorage * hs) |
| 511 | { |
no test coverage detected