[ros-diffs] [janderwald] 37067: - Improve error checking - Remove extensions which should be hidden (*.lnk) - CID 82

janderwald at svn.reactos.org janderwald at svn.reactos.org
Wed Oct 29 17:19:09 CET 2008


Author: janderwald
Date: Wed Oct 29 11:19:09 2008
New Revision: 37067

URL: http://svn.reactos.org/svn/reactos?rev=37067&view=rev
Log:
- Improve error checking
- Remove extensions which should be hidden (*.lnk)
- CID 82

Modified:
    trunk/reactos/dll/win32/shell32/shfldr_admintools.c

Modified: trunk/reactos/dll/win32/shell32/shfldr_admintools.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shfldr_admintools.c?rev=37067&r1=37066&r2=37067&view=diff
==============================================================================
--- trunk/reactos/dll/win32/shell32/shfldr_admintools.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/shfldr_admintools.c [iso-8859-1] Wed Oct 29 11:19:09 2008
@@ -424,8 +424,8 @@
         if ((GET_SHGDN_RELATION (dwFlags) == SHGDN_NORMAL) &&
             (GET_SHGDN_FOR (dwFlags) & SHGDN_FORPARSING))
             wcscpy(pszPath, This->szTarget);
-        else
-            HCR_GetClassNameW(&CLSID_AdminFolderShortcut, pszPath, MAX_PATH);
+        else if (!HCR_GetClassNameW(&CLSID_AdminFolderShortcut, pszPath, MAX_PATH))
+            hr = E_FAIL;
     }
     else if (_ILIsPidlSimple(pidl))
     {
@@ -436,12 +436,23 @@
             wcscpy(pszPath, This->szTarget);
             pOffset = PathAddBackslashW(pszPath);
             if (pOffset)
-                _ILSimpleGetTextW(pidl, pOffset, MAX_PATH + 1 - (pOffset - pszPath));
+            {
+                if (!_ILSimpleGetTextW(pidl, pOffset, MAX_PATH + 1 - (pOffset - pszPath)))
+                    hr = E_FAIL;
+            }
+            else
+                hr = E_FAIL;
         }
         else
-       {
-           _ILSimpleGetTextW(pidl, pszPath, MAX_PATH + 1);
-       }
+        {
+            if (_ILSimpleGetTextW(pidl, pszPath, MAX_PATH + 1))
+            {
+                if (SHELL_FS_HideExtension(pszPath))
+                    PathRemoveExtensionW(pszPath);
+            }
+            else
+                hr = E_FAIL;
+        }
     }
     else if (_ILIsSpecialFolder(pidl)) 
     {
@@ -449,10 +460,10 @@
 
         if (bSimplePidl) 
         {
-            _ILSimpleGetTextW(pidl, pszPath, MAX_PATH);
-        } 
-
-        if ((dwFlags & SHGDN_FORPARSING) && !bSimplePidl) 
+            if (!_ILSimpleGetTextW(pidl, pszPath, MAX_PATH))
+                hr = E_FAIL;
+        }
+        else if ((dwFlags & SHGDN_FORPARSING) && !bSimplePidl) 
         {
             int len = 0;
 
@@ -473,11 +484,11 @@
     {
         strRet->uType = STRRET_WSTR;
         strRet->u.pOleStr = pszPath;
+        TRACE ("-- (%p)->(%s,0x%08x)\n", This, debugstr_w(strRet->u.pOleStr), hr);
     }
     else
         CoTaskMemFree(pszPath);
 
-    TRACE ("-- (%p)->(%s,0x%08x)\n", This, debugstr_w(strRet->u.pOleStr), hr);
     return hr;
 }
 



More information about the Ros-diffs mailing list