| 503 | } |
| 504 | |
| 505 | static PCASC_FIND_DATA GetNextFindData(PCASC_FIND_DATA_ARRAY pFiles) |
| 506 | { |
| 507 | TLogHelper * pLogHelper = pFiles->pLogHelper; |
| 508 | DWORD ItemIndex; |
| 509 | |
| 510 | // Atomically increment the value in the file array |
| 511 | ItemIndex = CascInterlockedIncrement(&pFiles->ItemIndex) - 1; |
| 512 | if(ItemIndex < pFiles->ItemCount) |
| 513 | { |
| 514 | if(pLogHelper->TimeElapsed(1000)) |
| 515 | pLogHelper->PrintProgress("Extracting file %u of %u", ItemIndex, pFiles->ItemCount); |
| 516 | return &pFiles->cf[ItemIndex]; |
| 517 | } |
| 518 | |
| 519 | // If we overflowed the total number of files, it means that we are done |
| 520 | return NULL; |
| 521 | } |
| 522 | |
| 523 | static DWORD WINAPI Worker_ExtractFiles(PCASC_FIND_DATA_ARRAY pFiles) |
| 524 | { |
no test coverage detected