From 7d4f528f6077572379c2671dc10bed744bd2cce4 Mon Sep 17 00:00:00 2001 From: Giannis Adamopoulos Date: Sun, 27 Sep 2015 15:09:28 +0000 Subject: [PATCH] [SHELL32] - Fix for drive free/total space in My Computer. Patch by Barrett Karish. CORE-10264 svn path=/trunk/; revision=69374 --- .../dll/win32/shell32/folders/CDrivesFolder.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/reactos/dll/win32/shell32/folders/CDrivesFolder.cpp b/reactos/dll/win32/shell32/folders/CDrivesFolder.cpp index c7f8e9fdeee..40fe2090300 100644 --- a/reactos/dll/win32/shell32/folders/CDrivesFolder.cpp +++ b/reactos/dll/win32/shell32/folders/CDrivesFolder.cpp @@ -669,21 +669,26 @@ HRESULT WINAPI CDrivesFolder::GetDetailsOf(PCUITEMID_CHILD pidl, UINT iColumn, S switch (iColumn) { case 0: /* name */ - hr = GetDisplayNameOf(pidl, - SHGDN_NORMAL | SHGDN_INFOLDER, &psd->str); + hr = GetDisplayNameOf(pidl, SHGDN_NORMAL | SHGDN_INFOLDER, &psd->str); break; case 1: /* type */ _ILGetFileType(pidl, psd->str.cStr, MAX_PATH); break; case 2: /* total size */ _ILSimpleGetText (pidl, szPath, MAX_PATH); - GetDiskFreeSpaceExA (szPath, NULL, &ulBytes, NULL); - StrFormatByteSize64A (ulBytes.QuadPart, psd->str.cStr, MAX_PATH); + if (GetVolumeInformationA(szPath, NULL, 0, NULL, NULL, NULL, NULL, 0)) + { + GetDiskFreeSpaceExA(szPath, NULL, &ulBytes, NULL); + StrFormatByteSize64A(ulBytes.QuadPart, psd->str.cStr, MAX_PATH); + } break; case 3: /* free size */ _ILSimpleGetText (pidl, szPath, MAX_PATH); - GetDiskFreeSpaceExA (szPath, &ulBytes, NULL, NULL); - StrFormatByteSize64A (ulBytes.QuadPart, psd->str.cStr, MAX_PATH); + if (GetVolumeInformationA(szPath, NULL, 0, NULL, NULL, NULL, NULL, 0)) + { + GetDiskFreeSpaceExA(szPath, &ulBytes, NULL, NULL); + StrFormatByteSize64A(ulBytes.QuadPart, psd->str.cStr, MAX_PATH); + } break; } hr = S_OK;