| 1511 | } |
| 1512 | |
| 1513 | CString |
| 1514 | Ext2PartInformation(PEXT2_PARTITION part) |
| 1515 | { |
| 1516 | CString s, ret=""; |
| 1517 | |
| 1518 | s.Format("\r\n Partition No: %d\r\n\r\n", part->Number); |
| 1519 | if (!part->Entry) { |
| 1520 | return ret; |
| 1521 | } |
| 1522 | |
| 1523 | s = " Partition Type: "; |
| 1524 | if (part->Entry->PartitionStyle == PARTITION_STYLE_MBR) { |
| 1525 | s += PartitionString(part->Entry->Mbr.PartitionType); |
| 1526 | } else if (part->Entry->PartitionStyle == PARTITION_STYLE_GPT){ |
| 1527 | s += "GPT"; |
| 1528 | if (part->Entry->Gpt.Name && wcslen(part->Entry->Gpt.Name)) { |
| 1529 | s += ":"; |
| 1530 | for (size_t i = 0; i < wcslen(part->Entry->Gpt.Name); i++) |
| 1531 | s += (CHAR)part->Entry->Gpt.Name[i]; |
| 1532 | } |
| 1533 | } else { |
| 1534 | s += "GPT"; |
| 1535 | } |
| 1536 | ret += s; |
| 1537 | ret += "\r\n"; |
| 1538 | |
| 1539 | s.Format(" StartingOffset: %I64u\r\n", part->Entry->StartingOffset.QuadPart); |
| 1540 | ret += s; |
| 1541 | |
| 1542 | s.Format(" PartitionLength: %I64u\r\n", part->Entry->PartitionLength.QuadPart); |
| 1543 | ret += s; |
| 1544 | |
| 1545 | /* mount points */ |
| 1546 | ret += " MountPoints: "; |
| 1547 | ret += Ext2QueryVolumeLetterStrings(part->DrvLetters, NULL); |
| 1548 | ret += "\r\n"; |
| 1549 | |
| 1550 | if (!part->Volume) { |
| 1551 | return ret; |
| 1552 | } |
| 1553 | |
| 1554 | if (part->Volume->bRecognized) { |
| 1555 | |
| 1556 | ULONGLONG totalSize, freeSize; |
| 1557 | |
| 1558 | s.Format(" Filesystem: %s\r\n", part->Volume->FileSystem); |
| 1559 | ret += s; |
| 1560 | |
| 1561 | if ((part->Volume->EVP.bExt2 || part->Volume->EVP.bExt3)) { |
| 1562 | s = " codepage:"; |
| 1563 | s += part->Volume->EVP.Codepage; |
| 1564 | if (part->Volume->EVP.bReadonly) { |
| 1565 | s += ",Readonly"; |
| 1566 | } |
| 1567 | } |
| 1568 | ret += s; |
| 1569 | ret += "\r\n"; |
| 1570 |
no test coverage detected