Comment 25 for bug 207137

Revision history for this message
Agostino Russo (ago) wrote :

Could it be that in some cases the use of GetDiskFreeSpaceEx is not appropriate?

mTotalBytes = getDiskSize(driveLetter);
double getDiskSize(string driveLetter)
{
 ULARGE_INTEGER TotalBytes;
 string diskPath = driveLetter + ":\\";
 BOOL result = GetDiskFreeSpaceEx(diskPath.c_str(), NULL, &TotalBytes, NULL);
 if(result == 0) return 0;
 return TotalBytes.QuadPart;
}

The use of a max buflen of 8192 might also help.