From 22e0b9172b634b97842c2581007e90b830d48082 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Mon, 21 Feb 2011 07:37:49 +0000 Subject: [PATCH] - client: fix disk-space accounting bug when user quotas in use (Windows) svn path=/trunk/boinc/; revision=23079 --- checkin_notes | 7 +++++++ lib/filesys.cpp | 6 +++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/checkin_notes b/checkin_notes index 60400fa4d0..e090d0c811 100644 --- a/checkin_notes +++ b/checkin_notes @@ -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 diff --git a/lib/filesys.cpp b/lib/filesys.cpp index ee7b4d137e..094b682cd0 100644 --- a/lib/filesys.cpp +++ b/lib/filesys.cpp @@ -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;