| 1450 | } |
| 1451 | |
| 1452 | static DWORD PartStream_CheckFile(TBlockStream * pStream) |
| 1453 | { |
| 1454 | PPART_FILE_MAP_ENTRY FileBitmap = (PPART_FILE_MAP_ENTRY)pStream->FileBitmap; |
| 1455 | DWORD dwBlockCount; |
| 1456 | |
| 1457 | // Get the number of blocks |
| 1458 | dwBlockCount = (DWORD)((pStream->StreamSize + pStream->BlockSize - 1) / pStream->BlockSize); |
| 1459 | |
| 1460 | // Check all blocks |
| 1461 | for(DWORD i = 0; i < dwBlockCount; i++, FileBitmap++) |
| 1462 | { |
| 1463 | // Few sanity checks |
| 1464 | assert(FileBitmap->LargeValueHi == 0); |
| 1465 | assert(FileBitmap->LargeValueLo == 0); |
| 1466 | assert(FileBitmap->Flags == 0 || FileBitmap->Flags == 3); |
| 1467 | |
| 1468 | // Check if this block is present |
| 1469 | if(FileBitmap->Flags != 3) |
| 1470 | return 0; |
| 1471 | } |
| 1472 | |
| 1473 | // Yes, the file is complete |
| 1474 | return 1; |
| 1475 | } |
| 1476 | |
| 1477 | static bool PartStream_LoadBitmap(TBlockStream * pStream) |
| 1478 | { |
no outgoing calls
no test coverage detected