| 1380 | } |
| 1381 | |
| 1382 | const UCHAR* mvol_write_block(BurpGlobals* tdgbl, const UCHAR* ptr, ULONG count) |
| 1383 | { |
| 1384 | // To handle tape drives & Multi-volume boundaries, use the normal |
| 1385 | // write function, instead of doing a more optimal bulk write. |
| 1386 | |
| 1387 | while (count) |
| 1388 | { |
| 1389 | // If buffer full, dump it |
| 1390 | if (tdgbl->blk_io_cnt <= 0) |
| 1391 | { |
| 1392 | mvol_write(*ptr++, &tdgbl->blk_io_cnt, &tdgbl->blk_io_ptr); |
| 1393 | |
| 1394 | // One byte was written by mvol_write |
| 1395 | count--; |
| 1396 | } |
| 1397 | |
| 1398 | const ULONG n = MIN(count, (ULONG) tdgbl->blk_io_cnt); |
| 1399 | |
| 1400 | // Copy data to the IO buffer |
| 1401 | |
| 1402 | memcpy(tdgbl->blk_io_ptr, ptr, n); |
| 1403 | ptr += n; |
| 1404 | |
| 1405 | // Skip ahead in current buffer |
| 1406 | |
| 1407 | count -= n; |
| 1408 | tdgbl->blk_io_cnt -= n; |
| 1409 | tdgbl->blk_io_ptr += n; |
| 1410 | |
| 1411 | } |
| 1412 | return ptr; |
| 1413 | } |
| 1414 | |
| 1415 | |
| 1416 | //____________________________________________________________ |
no test coverage detected