diff --git a/reactos/dll/win32/shell32/shellord.c b/reactos/dll/win32/shell32/shellord.c index 05adda5c5b3..ff9025c4e0e 100644 --- a/reactos/dll/win32/shell32/shellord.c +++ b/reactos/dll/win32/shell32/shellord.c @@ -2244,12 +2244,21 @@ LPITEMIDLIST *ppidl, SFGAOF sfgaoIn, SFGAOF *psfgaoOut) HRESULT hr=E_FAIL; ULONG dwAttr=sfgaoIn; - if (!pszName || !ppidl || !psfgaoOut) + if(!ppidl) return E_INVALIDARG; + if (!pszName || !psfgaoOut) + { + *ppidl = NULL; + return E_INVALIDARG; + } + hr = SHGetDesktopFolder(&psfDesktop); if (FAILED(hr)) + { + *ppidl = NULL; return hr; + } hr = IShellFolder_ParseDisplayName(psfDesktop, (HWND)NULL, pbc, (LPOLESTR)pszName, (ULONG *)NULL, ppidl, &dwAttr); @@ -2257,6 +2266,8 @@ LPITEMIDLIST *ppidl, SFGAOF sfgaoIn, SFGAOF *psfgaoOut) if (SUCCEEDED(hr)) *psfgaoOut = dwAttr; + else + *ppidl = NULL; return hr; }