Changeset 9975 in vbox for trunk/src/VBox/Frontends/VBoxManage
- Timestamp:
- Jun 26, 2008 6:26:34 PM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 32413
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxInternalManage.cpp
r9891 r9975 568 568 pCP->uEndSector = p[6] & 0x3f; 569 569 uint32_t uStartOffset = RT_MAKE_U32_FROM_U8(p[8], p[9], p[10], p[11]); 570 if (!uStartOffset) 571 { 572 RTPrintf("Invalid partition start offset. Aborting\n"); 573 return VERR_INVALID_PARAMETER; 574 } 570 575 pCP->uStart = uStart + uOffset + uStartOffset; 571 576 pCP->uSize = RT_MAKE_U32_FROM_U8(p[12], p[13], p[14], p[15]); 572 577 /* Fill out partitioning location info for EBR. */ 573 578 pCP->uPartDataStart = uStart + uOffset; 574 pCP->cPartDataSectors = RT_MIN(uStartOffset, 63);579 pCP->cPartDataSectors = uStartOffset; 575 580 p += 16; 576 581 if (p[4] == 0) … … 589 594 } 590 595 591 /* Sort partitions in ascending order of start sector. Also do a lot of 592 * consistency checking. */ 593 uint64_t uPrevEnd = 0; 596 /* Sort partitions in ascending order of start sector, plus a trivial 597 * bit of consistency checking. */ 594 598 for (unsigned i = 0; i < pPart->cPartitions-1; i++) 595 599 { … … 623 627 &pPart->aPartitions[pPart->cPartitions], sizeof(HOSTPARTITION)); 624 628 } 629 } 630 631 /* Now do a lot of consistency checking. */ 632 uint64_t uPrevEnd = 0; 633 for (unsigned i = 0; i < pPart->cPartitions-1; i++) 634 { 625 635 if (pPart->aPartitions[i].cPartDataSectors) 626 636 { … … 643 653 /* Fill out partitioning location info for MBR. */ 644 654 pPart->aPartitions[0].uPartDataStart = 0; 645 pPart->aPartitions[0].cPartDataSectors = RT_MIN(pPart->aPartitions[0].uStart, 63);655 pPart->aPartitions[0].cPartDataSectors = pPart->aPartitions[0].uStart; 646 656 647 657 return VINF_SUCCESS;
Note:
See TracChangeset
for help on using the changeset viewer.