- client: fix disk-space accounting bug when user quotas in use

(Windows)


svn path=/trunk/boinc/; revision=23079
This commit is contained in:
David Anderson 2011-02-21 07:37:49 +00:00
parent faddad7bbb
commit 22e0b9172b
2 changed files with 10 additions and 3 deletions

View File

@ -969,3 +969,10 @@ David 20 Feb 2011
samples/wrapper/
wrapper.cpp
David 20 Feb 2011
- client: fix disk-space accounting bug when user quotas in use
(Windows)
lib/
filesys.cpp

View File

@ -750,13 +750,13 @@ int get_filesystem_info(double &total_space, double &free_space, char*) {
if (pGetDiskFreeSpaceEx) {
ULARGE_INTEGER TotalNumberOfFreeBytes;
ULARGE_INTEGER TotalNumberOfBytes;
ULARGE_INTEGER TotalNumberOfBytesFreeToCaller;
ULARGE_INTEGER FreeBytesAvailable;
pGetDiskFreeSpaceEx(
buf, &TotalNumberOfBytesFreeToCaller, &TotalNumberOfBytes,
buf, &FreeBytesAvailable, &TotalNumberOfBytes,
&TotalNumberOfFreeBytes
);
signed __int64 uMB;
uMB = TotalNumberOfFreeBytes.QuadPart / (1024 * 1024);
uMB = FreeBytesAvailable.QuadPart / (1024 * 1024);
free_space = uMB * 1024.0 * 1024.0;
uMB = TotalNumberOfBytes.QuadPart / (1024 * 1024);
total_space = uMB * 1024.0 * 1024.0;