Author: gadamopoulos
Date: Sat Apr 30 12:52:17 2016
New Revision: 71212

URL: http://svn.reactos.org/svn/reactos?rev=71212&view=rev
Log:
[SHELL32]
- Accept parsing paths like "C:". Also simplify CDrivesFolder::ParseDisplayName 
a bit.
Note: trying to run "c:" from the run dialog doesn't have the right result due 
to a bug in ShellExecute.

Modified:
    trunk/reactos/dll/win32/shell32/folders/CDrivesFolder.cpp

Modified: trunk/reactos/dll/win32/shell32/folders/CDrivesFolder.cpp
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folders/CDrivesFolder.cpp?rev=71212&r1=71211&r2=71212&view=diff
==============================================================================
--- trunk/reactos/dll/win32/shell32/folders/CDrivesFolder.cpp   [iso-8859-1] 
(original)
+++ trunk/reactos/dll/win32/shell32/folders/CDrivesFolder.cpp   [iso-8859-1] 
Sat Apr 30 12:52:17 2016
@@ -206,7 +206,6 @@
 {
     HRESULT hr = E_INVALIDARG;
     LPCWSTR szNext = NULL;
-    WCHAR szElement[MAX_PATH];
     LPITEMIDLIST pidlTemp = NULL;
 
     TRACE("(%p)->(HWND=%p,%p,%p=%s,%p,pidl=%p,%p)\n", this,
@@ -219,17 +218,18 @@
 
     /* handle CLSID paths */
     if (lpszDisplayName[0] == ':' && lpszDisplayName[1] == ':')
-    {
         return SH_ParseGuidDisplayName(this, hwndOwner, pbc, lpszDisplayName, 
pchEaten, ppidl, pdwAttributes);
-    }
-    /* do we have an absolute path name ? */
-    else if (PathGetDriveNumberW (lpszDisplayName) >= 0 &&
-             lpszDisplayName[2] == (WCHAR) '\\')
-    {
-        szNext = GetNextElementW (lpszDisplayName, szElement, MAX_PATH);
-        /* make drive letter uppercase to enable PIDL comparison */
-        szElement[0] = toupper(szElement[0]);
-        pidlTemp = _ILCreateDrive (szElement);
+
+    if (PathGetDriveNumberW(lpszDisplayName) < 0)
+        return E_INVALIDARG;
+
+    pidlTemp = _ILCreateDrive(lpszDisplayName);
+    if (!pidlTemp)
+        return E_OUTOFMEMORY;
+
+    if (lpszDisplayName[2] == L'\\')
+    {
+        szNext = &lpszDisplayName[3];
     }
 
     if (szNext && *szNext)


Reply via email to