All pastes #1403691 Raw Edit

erwan

public text v1 · immutable
#1403691 ·published 2009-04-26 19:59 UTC
rendered paste body
diff --git a/com32/hdt/hdt-cli-disk.c b/com32/hdt/hdt-cli-disk.cindex 9bd4b1f..c72d8a5 100644--- a/com32/hdt/hdt-cli-disk.c+++ b/com32/hdt/hdt-cli-disk.c@@ -110,7 +110,7 @@ static void process_ebr(struct driveinfo *drive_info, struct part_entry *ptab_ro 	int error; 	char *error_buffer; 	int offset;-+	printf("0 "); 	/* The ebr is located at the first sector of the extended partition */ 	char* ebr = read_sectors(drive_info, ptab_root->start_lba, 1, &error); 	if (!ebr) {@@ -123,16 +123,27 @@ static void process_ebr(struct driveinfo *drive_info, struct part_entry *ptab_ro  	struct part_entry *ptab_child = (struct part_entry *)(ebr + PARTITION_TABLES_OFFSET); +	printf("1 "); 	if (!ptab_child->length) 		return;  	offset = ptab_child->start_lba + ptab_root->start_lba; +	printf("2 ");+	printf("offset=%d + length =%d <= start_lba=%d \n", offset, ptab_child->length, ptab_root->start_lba);+	printf("offset=%d >= start_lba=%d + ptab_root->length=%d\n", offset, ptab_root->start_lba,ptab_root->length); 	if ( offset + ptab_child->length <= ptab_root->start_lba || 	     offset >= ptab_root->start_lba + ptab_root->length ) 		return;-	else+	else {+		printf("##=%X\n",ptab_child->ostype );+		/* 3 types for extended partitions */+		if ( ptab_child->ostype == 0x05 ||+		     ptab_child->ostype == 0x0f ||+		     ptab_child->ostype == 0x85)+			process_ebr(drive_info, ptab_child, ebr_seen + 1); 		return process_br(drive_info, ptab_child, ebr_seen, ptab_root);+	} }  /**@@ -152,6 +163,7 @@ static void process_br(struct driveinfo *drive_info, struct part_entry *ptab, 						   ptab_root, 						   drive_info); +		printf("#=%X\n",ptab[i].ostype ); 			/* 3 types for extended partitions */ 			if ( ptab[i].ostype == 0x05 || 			     ptab[i].ostype == 0x0f ||