Author: akhaldi
Date: Wed Apr 22 22:16:58 2015
New Revision: 67358

URL: http://svn.reactos.org/svn/reactos?rev=67358&view=rev
Log:
[SHELL32] Fix improperly formatted or missing disk letter in disk Properties. 
By Barrett Karish. CORE-9532

Modified:
    trunk/reactos/dll/win32/shell32/dialogs/drive.cpp

Modified: trunk/reactos/dll/win32/shell32/dialogs/drive.cpp
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/dialogs/drive.cpp?rev=67358&r1=67357&r2=67358&view=diff
==============================================================================
--- trunk/reactos/dll/win32/shell32/dialogs/drive.cpp   [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/dialogs/drive.cpp   [iso-8859-1] Wed Apr 22 
22:16:58 2015
@@ -137,12 +137,27 @@
     {
         psh.pszCaption = wszName;
         psh.dwFlags |= PSH_PROPTITLE;
+        pwszDrive[2] = 0;
         if (wszName[0] == UNICODE_NULL)
         {
-            /* FIXME: check if disk is a really a local hdd */
-            UINT i = LoadStringW(shell32_hInstance, IDS_DRIVE_FIXED, wszName, 
sizeof(wszName) / sizeof(WCHAR) - 6);
-            StringCchPrintf(wszName + i, sizeof(wszName) / sizeof(WCHAR) - i, 
L" (%s)", pwszDrive);
-        }
+            UINT len;
+            switch (GetDriveTypeW(pwszDrive))
+            {
+                case DRIVE_CDROM:
+                    len = LoadStringW(shell32_hInstance, IDS_DRIVE_CDROM, 
wszName, _countof(wszName));
+                    break;
+                case DRIVE_REMOTE:
+                    len = LoadStringW(shell32_hInstance, IDS_DRIVE_NETWORK, 
wszName, _countof(wszName));
+                    break;
+                case DRIVE_FIXED:
+                default:
+                    len = LoadStringW(shell32_hInstance, IDS_DRIVE_FIXED, 
wszName, _countof(wszName));
+                    break;
+            }
+            StringCchPrintf(wszName + len, _countof(wszName) - len, L" (%s)", 
pwszDrive);
+        }
+        else
+            StringCchPrintf(wszName + wcslen(wszName), _countof(wszName) - 
wcslen(wszName), L" (%s)", pwszDrive);
     }
 
     CComPtr<IDataObject> pDataObj;


Reply via email to