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

Function Ext2RefreshVLVI

Ext2Mgr/enumDisk.cpp:3672–3736  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3670}
3671
3672VOID
3673Ext2RefreshVLVI(
3674 CListCtrl *List,
3675 PEXT2_VOLUME chain,
3676 int nItem
3677 )
3678{
3679 ULONGLONG totalSize, usedSize;
3680 CString sSize, sUnit, s;
3681
3682 PEXT2_LETTER first = NULL;
3683 CString Letters = Ext2QueryVolumeLetterStrings(
3684 chain->DrvLetters, &first);
3685
3686 List->SetItem( nItem, 1, LVIF_TEXT, (LPCSTR)Letters, 0, 0, 0,0);
3687
3688 if (chain->bDynamic) {
3689 s.LoadString(IDS_DISK_TYPE_DYN);
3690 } else {
3691 s.LoadString(IDS_DISK_TYPE_BASIC);
3692 }
3693 List->SetItem(nItem, 2, LVIF_TEXT, (LPCSTR)s, 0, 0, 0,0);
3694 List->SetItem(nItem, 3, LVIF_TEXT, (LPCSTR)chain->FileSystem, 0, 0, 0,0);
3695
3696 totalSize = chain->FssInfo.TotalAllocationUnits.QuadPart;
3697 usedSize = totalSize - chain->FssInfo.AvailableAllocationUnits.QuadPart;
3698 totalSize = totalSize * chain->FssInfo.BytesPerSector *
3699 chain->FssInfo.SectorsPerAllocationUnit;
3700 usedSize = usedSize * chain->FssInfo.BytesPerSector *
3701 chain->FssInfo.SectorsPerAllocationUnit;
3702
3703 if (totalSize > (ULONGLONG) 10 * 1024 * 1024 * 1024) {
3704 totalSize = totalSize / ((ULONG)1024 * 1024 * 1024);
3705 usedSize = usedSize / ((ULONG)1024 * 1024 * 1024);
3706 sUnit = " GB";
3707 } else if (totalSize > 10 * 1024 * 1024){
3708 totalSize = totalSize / (1024 * 1024);
3709 usedSize = usedSize / (1024 * 1024);
3710 sUnit = " MB";
3711 } else if (totalSize > 10 * 1024){
3712 totalSize = totalSize / (1024);
3713 usedSize = usedSize / (1024);
3714 sUnit = " KB";
3715 } else {
3716 sUnit = " B";
3717 }
3718
3719 sSize.Format("%I64u", totalSize);
3720 sSize += sUnit;
3721 List->SetItem(nItem, 4, LVIF_TEXT, (LPCSTR)sSize, 0, 0, 0,0);
3722
3723 if (chain->bRecognized) {
3724 sSize.Format("%I64u", usedSize);
3725 sSize += sUnit;
3726 }
3727 List->SetItem(nItem, 5, LVIF_TEXT, (LPCSTR)sSize, 0, 0, 0,0);
3728
3729 List->SetItem(nItem, 6, LVIF_TEXT, (LPCSTR)chain->EVP.Codepage, 0, 0, 0,0);

Callers 2

Ext2InsertVolumeFunction · 0.85
UpdateVolumeMethod · 0.85

Calls 1

Tested by

no test coverage detected