Author: gadamopoulos
Date: Sun Sep 27 14:27:09 2015
New Revision: 69373
URL:
http://svn.reactos.org/svn/reactos?rev=69373&view=rev
Log:
[SHELL32]
- Don't duplicate the code for getting the name of a drive. CDrivesFolder already does
it (and it does it better). Make the drive properties call it to get the name it needs.
CORE-10258
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/…
==============================================================================
--- trunk/reactos/dll/win32/shell32/dialogs/drive.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/dialogs/drive.cpp [iso-8859-1] Sun Sep 27 14:27:09
2015
@@ -124,7 +124,8 @@
HPROPSHEETPAGE hpsp[MAX_PROPERTY_SHEET_PAGE];
PROPSHEETHEADERW psh;
CComObject<CDrvDefExt> *pDrvDefExt = NULL;
-
+ WCHAR wszName[256];
+
ZeroMemory(&psh, sizeof(PROPSHEETHEADERW));
psh.dwSize = sizeof(PROPSHEETHEADERW);
psh.dwFlags = 0; // FIXME: make it modeless
@@ -132,33 +133,17 @@
psh.nStartPage = 0;
psh.phpage = hpsp;
- WCHAR wszName[256];
- if (GetVolumeInformationW(pwszDrive, wszName, _countof(wszName), NULL, NULL, NULL,
NULL, 0))
+ LPITEMIDLIST completePidl = ILCombine(pidlFolder, apidl[0]);
+ if (!completePidl)
+ return FALSE;
+
+ if (ILGetDisplayNameExW(NULL, completePidl, wszName, ILGDN_NORMAL))
{
psh.pszCaption = wszName;
psh.dwFlags |= PSH_PROPTITLE;
- pwszDrive[2] = 0;
- if (wszName[0] == UNICODE_NULL)
- {
- 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);
- }
+ }
+
+ ILFree(completePidl);
CComPtr<IDataObject> pDataObj;
HRESULT hr = SHCreateDataObject(pidlFolder, 1, apidl, NULL, IID_PPV_ARG(IDataObject,
&pDataObj));