| 153 | |
| 154 | |
| 155 | static unsigned long int get_subdirectory(disk_t *disk_car,const uint64_t hd_offset,const unsigned long int i) |
| 156 | { |
| 157 | unsigned char buffer[DEFAULT_SECTOR_SIZE]; |
| 158 | const struct msdos_dir_entry *entry1=(const struct msdos_dir_entry *)&buffer[0]; |
| 159 | const struct msdos_dir_entry *entry2=(const struct msdos_dir_entry *)&buffer[0x20]; |
| 160 | if(disk_car->pread(disk_car, &buffer, sizeof(buffer), hd_offset) != sizeof(buffer)) |
| 161 | { |
| 162 | log_error("fat_dir, get_subdirectory(), can't read directory\n"); |
| 163 | return 1; |
| 164 | } |
| 165 | if(!is_fat_directory(buffer)) |
| 166 | return 1; |
| 167 | if(fat_get_cluster_from_entry(entry1) != i) |
| 168 | return 1; |
| 169 | return fat_get_cluster_from_entry(entry2); |
| 170 | } |
| 171 | |
| 172 | #ifdef HAVE_NCURSES |
| 173 | #define INTER_DIR 16 |
no test coverage detected