| 1585 | } |
| 1586 | |
| 1587 | CString |
| 1588 | Ext2DiskInformation(PEXT2_DISK disk) |
| 1589 | { |
| 1590 | CString s, ret=""; |
| 1591 | |
| 1592 | s.Format("\r\nDisk %d: %s\r\n\r\n", disk->OrderNo, disk->Name); |
| 1593 | ret += s; |
| 1594 | |
| 1595 | if (disk->SDD.VendorIdOffset) { |
| 1596 | ret += "\r\n VendorId: "; |
| 1597 | ret += (PCHAR)&disk->SDD + disk->SDD.VendorIdOffset; |
| 1598 | ret += "\r\n"; |
| 1599 | } |
| 1600 | |
| 1601 | if (disk->SDD.ProductIdOffset) { |
| 1602 | ret += " ProductId: "; |
| 1603 | ret += (PCHAR)&disk->SDD + disk->SDD.ProductIdOffset; |
| 1604 | ret += "\r\n"; |
| 1605 | } |
| 1606 | |
| 1607 | if (disk->SDD.SerialNumberOffset) { |
| 1608 | ret += " SerialNumber: "; |
| 1609 | ret += (PCHAR)&disk->SDD + disk->SDD.SerialNumberOffset; |
| 1610 | ret += "\r\n"; |
| 1611 | } |
| 1612 | |
| 1613 | ret += " BusType: "; |
| 1614 | ret += BusTypeString(disk->SDD.BusType); |
| 1615 | ret += "\r\n"; |
| 1616 | |
| 1617 | ret += " Media Type: "; |
| 1618 | if (disk->SDD.RemovableMedia) { |
| 1619 | ret += " Removable\r\n"; |
| 1620 | } else { |
| 1621 | s = "RAW"; |
| 1622 | if (disk->Layout) { |
| 1623 | if (disk->Layout->PartitionStyle == PARTITION_STYLE_MBR) { |
| 1624 | if (disk->Layout->PartitionEntry->Mbr.PartitionType |
| 1625 | == PARTITION_LDM) { |
| 1626 | s.LoadString(IDS_DISK_TYPE_DYN); |
| 1627 | } else { |
| 1628 | s.LoadString(IDS_DISK_TYPE_BASIC); |
| 1629 | } |
| 1630 | } else if (disk->Layout->PartitionStyle == PARTITION_STYLE_GPT) { |
| 1631 | s = "GPT"; |
| 1632 | } |
| 1633 | } |
| 1634 | s += "\r\n"; |
| 1635 | ret += s; |
| 1636 | } |
| 1637 | |
| 1638 | if (disk->bEjected) { |
| 1639 | ret += " No media\r\n"; |
| 1640 | } else { |
| 1641 | /* geometry information */ |
| 1642 | ret += " DiskGeometry Layout:\r\n"; |
| 1643 | s.Format(" BytesPerSector = %u\r\n", disk->DiskGeometry.BytesPerSector); |
| 1644 | ret += s; |
no test coverage detected