[SHELL32] - Accept NULL pidl in CRegFolder::GetDisplayNameOf. CORE-12317
authorGiannis Adamopoulos <gadamopoulos@reactos.org>
Tue, 15 Nov 2016 14:25:05 +0000 (14:25 +0000)
committerGiannis Adamopoulos <gadamopoulos@reactos.org>
Tue, 15 Nov 2016 14:25:05 +0000 (14:25 +0000)
svn path=/trunk/; revision=73236

reactos/dll/win32/shell32/folders/CRegFolder.cpp

index deefcf6..a6f9452 100644 (file)
@@ -356,10 +356,10 @@ HRESULT WINAPI CRegFolder::GetUIObjectOf(HWND hwndOwner, UINT cidl, PCUITEMID_CH
 
 HRESULT WINAPI CRegFolder::GetDisplayNameOf(PCUITEMID_CHILD pidl, DWORD dwFlags, LPSTRRET strRet)
 {
-    if (!strRet || !_ILIsSpecialFolder(pidl))
+    if (!strRet || (!_ILIsSpecialFolder(pidl) && pidl != NULL))
         return E_INVALIDARG;
 
-    if (!pidl->mkid.cb)
+    if (!pidl || !pidl->mkid.cb)
     {
         if ((GET_SHGDN_RELATION(dwFlags) == SHGDN_NORMAL) && (GET_SHGDN_FOR(dwFlags) & SHGDN_FORPARSING))
         {