MCPcopy Create free account
hub / github.com/bobranten/Ext4Fsd / Ext2VolumeInformation

Function Ext2VolumeInformation

Ext2Mgr/enumDisk.cpp:1776–1834  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1774}
1775
1776CString
1777Ext2VolumeInformation(PEXT2_VOLUME vol)
1778{
1779 CString s, ret = "";
1780
1781 s.Format("\r\nVolume: %s:\r\n\r\n", vol->Name);
1782 ret += s;
1783
1784 ret += " Filesystem: ";
1785 ret += vol->FileSystem;
1786 ret += "\r\n";
1787
1788 /* mount points */
1789 ret += " Mountpoints: ";
1790 ret += Ext2QueryVolumeLetterStrings(vol->DrvLetters, NULL);
1791 ret += "\r\n";
1792
1793 /* set volume status */
1794 s = " Volume status: Online";
1795 if (vol->bRecognized && (vol->EVP.bExt2 || vol->EVP.bExt3)) {
1796 s += ",codepage:";
1797 s += vol->EVP.Codepage;
1798 if (vol->EVP.bReadonly) {
1799 s += ",Readonly";
1800 }
1801 }
1802 ret += s;
1803 ret += "\r\n";
1804
1805 {
1806 ULONGLONG totalSize, freeSize;
1807 totalSize = vol->FssInfo.TotalAllocationUnits.QuadPart;
1808 freeSize = vol->FssInfo.AvailableAllocationUnits.QuadPart;
1809 totalSize = totalSize * vol->FssInfo.BytesPerSector *
1810 vol->FssInfo.SectorsPerAllocationUnit;
1811 freeSize = freeSize * vol->FssInfo.BytesPerSector *
1812 vol->FssInfo.SectorsPerAllocationUnit;
1813 s.Format(" size: %I64u\r\n", totalSize);
1814 ret += s;
1815
1816 s.Format(" free space: %I64u\r\n", freeSize);
1817 ret += s;
1818 }
1819
1820 if (vol->Extent) {
1821 for (DWORD i=0; i < vol->Extent->NumberOfDiskExtents; i++) {
1822 s.Format(" Extent: %d\r\n", i);
1823 ret += s;
1824 s.Format(" DiskNumber: %d\r\n", vol->Extent->Extents[i].DiskNumber);
1825 ret += s;
1826 s.Format(" StartingOffset: %I64u\r\n", vol->Extent->Extents[i].StartingOffset.QuadPart);
1827 ret += s;
1828 s.Format(" ExtentLength: %I64u\r\n", vol->Extent->Extents[i].ExtentLength.QuadPart);
1829 ret += s;
1830 }
1831 }
1832
1833 return ret;

Callers 1

Ext2SysInformationFunction · 0.85

Calls 1

Tested by

no test coverage detected