Lines Matching refs:buff

709 static void rescue_sector(void *fd, u32 bytes_per_sector, off_t pos, void *buff)
723 if (read_all(fd, buff, bytes_per_sector) == -1) {
726 memset(buff, '?', bytes_per_sector);
727 memmove(buff, badsector_magic, sizeof(badsector_magic));
735 static void read_rescue(void *fd, char *buff, u32 csize, u32 bytes_per_sector,
740 if (read_all(fd, buff, csize) == -1) {
750 rescue_pos + i, buff + i);
760 char *buff;
777 buff = (char*)ntfs_malloc(csize);
778 if (!buff)
791 if (read_all(fd, buff, csize) == -1) {
803 rescue_pos + i, buff + i);
821 bs = (NTFS_BOOT_SECTOR*)buff;
827 bs = (NTFS_BOOT_SECTOR*)(buff
851 && (write_all(&fd_out, buff, csize) == -1)) {
865 free(buff);
913 char buff[1 + sizeof(count)];
915 buff[0] = CMD_GAP;
917 memcpy(buff + 1, &count_buf, sizeof(count_buf));
919 if (write_all(&fd_out, buff, sizeof(buff)) == -1)
1003 char *buff;
1005 buff = (char*)ntfs_malloc(csize);
1006 if (!buff)
1009 memset(buff, 0, csize);
1012 if (write_all(&fd_out, buff, csize) == -1)
1016 free(buff);
1472 static void write_set(char *buff, u32 csize, s64 *current_lcn,
1484 || (write_all(&fd_out, &buff[k*csize], csize) == -1))
1505 char *buff;
1539 buff = (char*)ntfs_malloc(buff_size);
1540 if (!buff)
1550 read_rescue(fd, &buff[k*csize], csize, bytes_per_sector,
1560 if (!strncmp(&buff[r*mft_record_size],"FILE",4))
1561 wipe_mft(&buff[r*mft_record_size],
1565 write_set(buff, csize, &current_lcn,
1575 free(buff);
1588 char *buff;
1621 buff = (char*)ntfs_malloc(buff_size);
1622 if (!buff)
1631 read_rescue(fd, &buff[k*csize], csize, bytes_per_sector,
1643 if (!strncmp(&buff[r*indx_record_size],"INDX",4))
1644 wipe_indx(&buff[r*indx_record_size],
1647 write_set(buff, csize, &current_lcn,
1657 free(buff);