Lines Matching refs:buf

173 volume_init(int fd, uint8* buf,
193 if ((buf[0x1fe] != 0x55 || buf[0x1ff] != 0xaa) && buf[0x15] == 0xf8)
196 if (!memcmp(buf + 3, "NTFS ", 8) || !memcmp(buf + 3, "HPFS ", 8)) {
197 dprintf("dosfs error: %4.4s, not FAT\n", buf + 3);
202 vol->bytes_per_sector = read16(buf, 0xb);
210 vol->sectors_per_cluster = i = buf[0xd];
217 vol->reserved_sectors = read16(buf, 0xe);
219 vol->fat_count = buf[0x10];
226 vol->media_descriptor = buf[0x15];
228 if (buf[0x15] != 0xf0 && buf[0x15] < 0xf8) {
237 vol->sectors_per_fat = read16(buf, 0x16);
241 vol->sectors_per_fat = read32(buf, 0x24);
242 vol->total_sectors = read32(buf, 0x20);
244 vol->fsinfo_sector = read16(buf, 0x30);
252 vol->fat_mirrored = !(buf[0x28] & 0x80);
253 vol->active_fat = !vol->fat_mirrored ? (buf[0x28] & 0xf) : 0;
260 vol->root_vnode.cluster = read32(buf, 0x2c);
267 if (dosfs_read_label(true, buf, vol->vol_label))
277 vol->root_entries_count = read16(buf, 0x11);
284 vol->total_sectors = read16(buf, 0x13); // partition size
286 vol->total_sectors = read32(buf, 0x20);
300 if (memcmp(buf + 0x0b, bogus_zip_data, sizeof(bogus_zip_data)) == 0
330 if (dosfs_read_label(false, buf, vol->vol_label))
484 uint8 buf[512];
561 if ((err = read_pos(fd, 0, (void *)buf, 512)) != 512) {
566 vol = volume_init(fd, buf, vol_flags, fs_flags, &geo);
672 uint8 buf[512];
682 if (read_pos(fd, 0, buf, 512) != 512)
687 if ((buf[0x1fe] != 0x55 || buf[0x1ff] != 0xaa) && buf[0x15] == 0xf8)
689 if (!memcmp(buf + 3, "NTFS ", 8) || !memcmp(buf + 3, "HPFS ", 8))
693 bytes_per_sector = read16(buf, 0xb);
700 i = buf[0xd];
705 fatCount = buf[0x10];
710 if (buf[0x15] != 0xf0 && buf[0x15] < 0xf8)
714 sectors_per_fat = read16(buf, 0x16);
716 total_sectors = read32(buf, 0x20);
717 dosfs_read_label(true, buf, name);
719 total_sectors = read16(buf, 0x13);
722 total_sectors = read32(buf, 0x20);
724 dosfs_read_label(false, buf, name);
730 vol = volume_init(fd, buf, 0, 0, NULL);
1102 void *buf, size_t len)