MCPcopy Create free account
hub / github.com/cgsecurity/testdisk / test_MBR_data

Function test_MBR_data

src/parti386.c:595–648  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

593}
594
595static void test_MBR_data(const list_part_t *list_part)
596{
597 const list_part_t *element;
598 unsigned int nb_dos=0, nb_hidden=0, nb_mb=0, nb_ext=0, nb_boot=0;
599 for(element=list_part;element!=NULL;element=element->next)
600 {
601 const partition_t *partition=element->part;
602 switch(partition->status)
603 {
604 case STATUS_PRIM:
605 case STATUS_PRIM_BOOT:
606 if(partition->status == STATUS_PRIM_BOOT)
607 nb_boot++;
608 switch(partition->part_type_i386)
609 {
610 case P_12FAT:
611 case P_16FAT:
612 case P_16FATBD:
613 nb_dos++;
614 break;
615 case P_16FATBDH:
616 case P_16FATH:
617 case P_NTFSH:
618 nb_hidden++;
619 break;
620 case P_OS2MB:
621 nb_mb++;
622 break;
623 }
624 break;
625 case STATUS_EXT:
626 nb_ext++;
627 break;
628 default:
629 log_critical("test_MBR_data: severe error\n");
630 break;
631 }
632 }
633 if(nb_dos>1)
634 screen_buffer_add(msg_ONLY_ONE_DOS);
635 if(nb_ext>1)
636 screen_buffer_add(msg_ONLY_ONE_EXT);
637 /* S'il y a des partitions caches, il faut un MB */
638 /* Obsolete
639 if(nb_hidden>0 && nb_mb==0)
640 screen_buffer_add(msg_NO_OS2MB);
641 */
642 /* Nombre de partition bootable */
643 if(nb_boot==0)
644 screen_buffer_add(msg_NO_BOOTABLE);
645 else
646 if(nb_boot>1)
647 screen_buffer_add(msg_ONLY1MUSTBOOT);
648}
649
650static partition_t *get_ext_partition_i386(const list_part_t *list_part)
651{

Callers 1

read_part_i386Function · 0.85

Calls 1

screen_buffer_addFunction · 0.85

Tested by

no test coverage detected