From 449d7c1d6430492f3d276a98f1e3a24505a71af5 Mon Sep 17 00:00:00 2001 From: "cbiesinger%web.de" Date: Mon, 2 Feb 2004 16:47:05 +0000 Subject: [PATCH] install reports there is zero space free on my drive and quits (NT 3.51) bug 202505 r=dveditz sr=roc --- xpinstall/wizard/windows/setup/extra.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/xpinstall/wizard/windows/setup/extra.c b/xpinstall/wizard/windows/setup/extra.c index 1b910c04afb..d3272a85784 100644 --- a/xpinstall/wizard/windows/setup/extra.c +++ b/xpinstall/wizard/windows/setup/extra.c @@ -4842,17 +4842,7 @@ ULONGLONG GetDiskSpaceAvailable(LPSTR szPath) DWORD dwNumberOfFreeClusters; DWORD dwTotalNumberOfClusters; - if((gSystemInfo.dwOSType & OS_WIN95_DEBUTE) && (NS_GetDiskFreeSpace != NULL)) - { - ParsePath(szPath, szTempPath, MAX_BUF, FALSE, PP_ROOT_ONLY); - NS_GetDiskFreeSpace(szTempPath, - &dwSectorsPerCluster, - &dwBytesPerSector, - &dwNumberOfFreeClusters, - &dwTotalNumberOfClusters); - ullReturn = ((ULONGLONG)dwBytesPerSector * (ULONGLONG)dwSectorsPerCluster * (ULONGLONG)dwNumberOfFreeClusters); - } - else if(NS_GetDiskFreeSpaceEx != NULL) + if(NS_GetDiskFreeSpaceEx != NULL) { LocateExistingPath(szPath, szExistingPath, sizeof(szExistingPath)); AppendBackSlash(szExistingPath, sizeof(szExistingPath)); @@ -4882,6 +4872,17 @@ ULONGLONG GetDiskSpaceAvailable(LPSTR szPath) } ullReturn = uliFreeBytesAvailableToCaller.QuadPart; } + else if(NS_GetDiskFreeSpace != NULL) + { + ParsePath(szPath, szTempPath, MAX_BUF, FALSE, PP_ROOT_ONLY); + NS_GetDiskFreeSpace(szTempPath, + &dwSectorsPerCluster, + &dwBytesPerSector, + &dwNumberOfFreeClusters, + &dwTotalNumberOfClusters); + ullReturn = ((ULONGLONG)dwBytesPerSector * (ULONGLONG)dwSectorsPerCluster * (ULONGLONG)dwNumberOfFreeClusters); + } + if(ullReturn > 1024) ullReturn /= 1024;