| 1491 | } |
| 1492 | |
| 1493 | static DWORD PartStream_CheckFile(TBlockStream * pStream) |
| 1494 | { |
| 1495 | PPART_FILE_MAP_ENTRY FileBitmap = (PPART_FILE_MAP_ENTRY)pStream->FileBitmap; |
| 1496 | DWORD dwBlockCount; |
| 1497 | |
| 1498 | // Get the number of blocks |
| 1499 | dwBlockCount = (DWORD)((pStream->StreamSize + pStream->BlockSize - 1) / pStream->BlockSize); |
| 1500 | |
| 1501 | // Check all blocks |
| 1502 | for(DWORD i = 0; i < dwBlockCount; i++, FileBitmap++) |
| 1503 | { |
| 1504 | // Few sanity checks |
| 1505 | assert(FileBitmap->LargeValueHi == 0); |
| 1506 | assert(FileBitmap->LargeValueLo == 0); |
| 1507 | assert(FileBitmap->Flags == 0 || FileBitmap->Flags == 3); |
| 1508 | |
| 1509 | // Check if this block is present |
| 1510 | if(FileBitmap->Flags != 3) |
| 1511 | return 0; |
| 1512 | } |
| 1513 | |
| 1514 | // Yes, the file is complete |
| 1515 | return 1; |
| 1516 | } |
| 1517 | |
| 1518 | static bool PartStream_LoadBitmap(TBlockStream * pStream) |
| 1519 | { |
no outgoing calls
no test coverage detected