Skip to content

Commit

Permalink
fix ;
Browse files Browse the repository at this point in the history
  • Loading branch information
CyberGreg05 committed Mar 7, 2024
1 parent 5889b39 commit bf68dc2
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions al-khaser/AntiVM/Generic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -572,13 +572,13 @@ BOOL disk_size_wmi()
hRes = pEnumerator->Next(WBEM_INFINITE, 1, &pclsObj, &uReturn);
if (0 == uReturn)
break;

// Don`t check removable disk, network drive CD-ROM and RAM disk
if (checkDriveType(pclsObj)) {
pclsObj->Release();
continue;
}

// Get the value of the Name property
hRes = pclsObj->Get(_T("Size"), 0, &vtProp, NULL, 0);
if (SUCCEEDED(hRes)) {
Expand All @@ -594,32 +594,32 @@ BOOL disk_size_wmi()
if (diskSizeBytes < minHardDiskSize) { // Less than 80GB
bFound = TRUE;
}

// release the current result object
VariantClear(&vtProp);

// release the current result object
VariantClear(&vtProp);
}
}
}

// release class object
pclsObj->Release();
// release class object
pclsObj->Release();

// break from while
if (bFound)
break;
}
// break from while
if (bFound)
break;
}

// Cleanup
pEnumerator->Release();
pSvc->Release();
pLoc->Release();
CoUninitialize();
// Cleanup
pEnumerator->Release();
pSvc->Release();
pLoc->Release();
CoUninitialize();
}
}
}

return bFound;
return bFound;
}
}


/*
DeviceIoControl works with disks directly rather than partitions (GetDiskFreeSpaceEx)
We can send IOCTL_DISK_GET_LENGTH_INFO code to get the raw byte size of the physical disk
Expand Down

0 comments on commit bf68dc2

Please sign in to comment.