____________________________________________________________ Write a chunk of data to the IO buffer. Return a pointer to the first position NOT written from.
| 1345 | // Return a pointer to the first position NOT written from. |
| 1346 | // |
| 1347 | const UCHAR* MVOL_write_block(BurpGlobals* tdgbl, const UCHAR* ptr, ULONG count) |
| 1348 | { |
| 1349 | while (count) |
| 1350 | { |
| 1351 | // If buffer full, write it |
| 1352 | if (tdgbl->gbl_io_cnt <= 0) |
| 1353 | { |
| 1354 | if (!tdgbl->master) |
| 1355 | { |
| 1356 | BackupRelationTask::renewBuffer(tdgbl); |
| 1357 | } |
| 1358 | else |
| 1359 | { |
| 1360 | zip_write_block(tdgbl, tdgbl->gbl_compress_buffer, tdgbl->gbl_io_ptr - tdgbl->gbl_compress_buffer, false); |
| 1361 | |
| 1362 | tdgbl->gbl_io_ptr = tdgbl->gbl_compress_buffer; |
| 1363 | tdgbl->gbl_io_cnt = ZC_BUFSIZE; |
| 1364 | } |
| 1365 | } |
| 1366 | |
| 1367 | const ULONG n = MIN(count, (ULONG) tdgbl->gbl_io_cnt); |
| 1368 | |
| 1369 | // Copy data to the IO buffer |
| 1370 | memcpy(tdgbl->gbl_io_ptr, ptr, n); |
| 1371 | ptr += n; |
| 1372 | count -= n; |
| 1373 | |
| 1374 | // Skip ahead in current buffer |
| 1375 | tdgbl->gbl_io_cnt -= n; |
| 1376 | tdgbl->gbl_io_ptr += n; |
| 1377 | } |
| 1378 | |
| 1379 | return ptr; |
| 1380 | } |
| 1381 | |
| 1382 | const UCHAR* mvol_write_block(BurpGlobals* tdgbl, const UCHAR* ptr, ULONG count) |
| 1383 | { |
no test coverage detected