[shell32.dll]
authorClaudiu Mihail <claudiu.bogdan.mihail@gmail.com>
Thu, 8 Sep 2011 14:07:02 +0000 (14:07 +0000)
committerClaudiu Mihail <claudiu.bogdan.mihail@gmail.com>
Thu, 8 Sep 2011 14:07:02 +0000 (14:07 +0000)
- Make sure the ParseDisplayName functions make the ppidle parameter NULL whenever that's possible. Scores a wine test. Spotted by Victor Martinez.

svn path=/branches/shell32_new-bringup/; revision=53641

dll/win32/shell32/shfldr_desktop.cpp
dll/win32/shell32/shfldr_fs.cpp

index 277bb38..4bb5057 100644 (file)
@@ -304,10 +304,16 @@ HRESULT WINAPI CDesktopFolder::ParseDisplayName (HWND hwndOwner, LPBC pbc, LPOLE
            this, hwndOwner, pbc, lpszDisplayName, debugstr_w(lpszDisplayName),
            pchEaten, ppidl, pdwAttributes);
 
-    if (!lpszDisplayName || !ppidl)
+    if (!ppidl)
         return E_INVALIDARG;
 
-    *ppidl = 0;
+    if (!lpszDisplayName)
+    {
+        *ppidl = NULL;
+        return E_INVALIDARG;
+    }
+
+    *ppidl = NULL;
 
     if (pchEaten)
         *pchEaten = 0;        /* strange but like the original */
@@ -333,6 +339,7 @@ HRESULT WINAPI CDesktopFolder::ParseDisplayName (HWND hwndOwner, LPBC pbc, LPOLE
     else if( (pidlTemp = SHELL32_CreatePidlFromBindCtx(pbc, lpszDisplayName)) )
     {
         *ppidl = pidlTemp;
+        DbgPrint("[shell32, CDesktopFolder::ParseDisplayName] 1 *ppidl = 0x%x\n", *ppidl);
         return S_OK;
     }
     else
@@ -379,7 +386,10 @@ HRESULT WINAPI CDesktopFolder::ParseDisplayName (HWND hwndOwner, LPBC pbc, LPOLE
         }
     }
 
-    *ppidl = pidlTemp;
+    if (SUCCEEDED(hr))
+        *ppidl = pidlTemp;
+    else
+        *ppidl = NULL;
 
     TRACE ("(%p)->(-- ret=0x%08x)\n", this, hr);
 
index 030b6da..81f7cf7 100644 (file)
@@ -188,9 +188,17 @@ HRESULT WINAPI CFSFolder::ParseDisplayName(HWND hwndOwner,
      this, hwndOwner, pbc, lpszDisplayName, debugstr_w (lpszDisplayName),
      pchEaten, ppidl, pdwAttributes);
 
-    if (!lpszDisplayName || !ppidl)
+    if (!ppidl)
         return E_INVALIDARG;
 
+    if (!lpszDisplayName)
+    {
+        *ppidl = NULL;
+        return E_INVALIDARG;
+    }
+
+    *ppidl = NULL;
+
     if (pchEaten)
         *pchEaten = 0; /* strange but like the original */