Author: cmihail Date: Thu Sep 8 14:07:02 2011 New Revision: 53641
URL: http://svn.reactos.org/svn/reactos?rev=53641&view=rev Log: [shell32.dll] - Make sure the ParseDisplayName functions make the ppidle parameter NULL whenever that's possible. Scores a wine test. Spotted by Victor Martinez.
Modified: branches/shell32_new-bringup/dll/win32/shell32/shfldr_desktop.cpp branches/shell32_new-bringup/dll/win32/shell32/shfldr_fs.cpp
Modified: branches/shell32_new-bringup/dll/win32/shell32/shfldr_desktop.cpp URL: http://svn.reactos.org/svn/reactos/branches/shell32_new-bringup/dll/win32/sh... ============================================================================== --- branches/shell32_new-bringup/dll/win32/shell32/shfldr_desktop.cpp [iso-8859-1] (original) +++ branches/shell32_new-bringup/dll/win32/shell32/shfldr_desktop.cpp [iso-8859-1] Thu Sep 8 14:07:02 2011 @@ -304,10 +304,16 @@ 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 @@ 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 @@ } }
- *ppidl = pidlTemp; + if (SUCCEEDED(hr)) + *ppidl = pidlTemp; + else + *ppidl = NULL;
TRACE ("(%p)->(-- ret=0x%08x)\n", this, hr);
Modified: branches/shell32_new-bringup/dll/win32/shell32/shfldr_fs.cpp URL: http://svn.reactos.org/svn/reactos/branches/shell32_new-bringup/dll/win32/sh... ============================================================================== --- branches/shell32_new-bringup/dll/win32/shell32/shfldr_fs.cpp [iso-8859-1] (original) +++ branches/shell32_new-bringup/dll/win32/shell32/shfldr_fs.cpp [iso-8859-1] Thu Sep 8 14:07:02 2011 @@ -188,8 +188,16 @@ 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 */