diff --git a/reactos/dll/win32/shell32/classes.cpp b/reactos/dll/win32/shell32/classes.cpp index 16a677a30b5..b1e8a9e46e0 100644 --- a/reactos/dll/win32/shell32/classes.cpp +++ b/reactos/dll/win32/shell32/classes.cpp @@ -470,7 +470,10 @@ BOOL HCR_GetFolderAttributes(LPCITEMIDLIST pidlFolder, LPDWORD pdwAttributes) lResult = RegOpenKeyExW(HKEY_CLASSES_ROOT, wszShellFolderKey, 0, KEY_READ, &hSFKey); if (lResult != ERROR_SUCCESS) + { + ERR("Cannot open key: %ls\n", wszShellFolderKey); return FALSE; + } dwLen = sizeof(DWORD); lResult = RegQueryValueExW(hSFKey, wszCallForAttributes, 0, NULL, (LPBYTE)&dwTemp, &dwLen); diff --git a/reactos/dll/win32/shell32/defcontextmenu.cpp b/reactos/dll/win32/shell32/defcontextmenu.cpp index 56820cfaf45..6c686206a0e 100644 --- a/reactos/dll/win32/shell32/defcontextmenu.cpp +++ b/reactos/dll/win32/shell32/defcontextmenu.cpp @@ -858,7 +858,6 @@ CDefaultContextMenu::BuildShellItemContextMenu( } } - if (rfg & SFGAO_FILESYSTEM) { if (RegOpenKeyExW(HKEY_CLASSES_ROOT, L"AllFilesystemObjects", 0, KEY_READ, &hKey) == ERROR_SUCCESS) @@ -899,7 +898,6 @@ CDefaultContextMenu::BuildShellItemContextMenu( bAddSep = TRUE; } - if (rfg & SFGAO_CANLINK) { bAddSep = FALSE; @@ -907,7 +905,6 @@ CDefaultContextMenu::BuildShellItemContextMenu( _InsertMenuItemW(hMenu, indexMenu++, TRUE, FCIDM_SHVIEW_CREATELINK, MFT_STRING, MAKEINTRESOURCEW(IDS_CREATELINK), MFS_ENABLED); } - if (rfg & SFGAO_CANDELETE) { if (bAddSep) diff --git a/reactos/dll/win32/shell32/folders/desktop.cpp b/reactos/dll/win32/shell32/folders/desktop.cpp index 3fa66dfa4a2..fc03dc1697f 100644 --- a/reactos/dll/win32/shell32/folders/desktop.cpp +++ b/reactos/dll/win32/shell32/folders/desktop.cpp @@ -546,8 +546,8 @@ HRESULT WINAPI CDesktopFolder::GetAttributesOf( SFGAO_CANRENAME | SFGAO_CANDELETE | SFGAO_HASPROPSHEET | SFGAO_DROPTARGET | SFGAO_FILESYSANCESTOR | SFGAO_FOLDER | SFGAO_HASSUBFOLDER; - TRACE ("(%p)->(cidl=%d apidl=%p mask=%p (0x%08x))\n", - this, cidl, apidl, rgfInOut, rgfInOut ? *rgfInOut : 0); + TRACE("(%p)->(cidl=%d apidl=%p mask=%p (0x%08x))\n", + this, cidl, apidl, rgfInOut, rgfInOut ? *rgfInOut : 0); if (!rgfInOut) return E_INVALIDARG; @@ -557,18 +557,22 @@ HRESULT WINAPI CDesktopFolder::GetAttributesOf( if (*rgfInOut == 0) *rgfInOut = ~0; - if(cidl == 0) { + if(cidl == 0) + { *rgfInOut &= dwDesktopAttributes; - } else { - while (cidl > 0 && *apidl) { - pdump (*apidl); - if (_ILIsDesktop(*apidl)) { + } + else + { + while (cidl > 0 && *apidl) + { + pdump(*apidl); + if (_ILIsDesktop(*apidl)) *rgfInOut &= dwDesktopAttributes; - } else if (_ILIsMyComputer(*apidl)) { + else if (_ILIsMyComputer(*apidl)) *rgfInOut &= dwMyComputerAttributes; - } else { - SHELL32_GetItemAttributes ((IShellFolder *)this, *apidl, rgfInOut); - } + else + SHELL32_GetItemAttributes((IShellFolder *)this, *apidl, rgfInOut); + apidl++; cidl--; } @@ -576,7 +580,7 @@ HRESULT WINAPI CDesktopFolder::GetAttributesOf( /* make sure SFGAO_VALIDATE is cleared, some apps depend on that */ *rgfInOut &= ~SFGAO_VALIDATE; - TRACE ("-- result=0x%08x\n", *rgfInOut); + TRACE("-- result=0x%08x\n", *rgfInOut); return hr; } diff --git a/reactos/dll/win32/shell32/folders/recyclebin.cpp b/reactos/dll/win32/shell32/folders/recyclebin.cpp index 852d58da505..28023b9c3fc 100644 --- a/reactos/dll/win32/shell32/folders/recyclebin.cpp +++ b/reactos/dll/win32/shell32/folders/recyclebin.cpp @@ -583,7 +583,7 @@ HRESULT WINAPI CRecycleBin::GetAttributesOf(UINT cidl, LPCITEMIDLIST *apidl, SFGAOF *rgfInOut) { TRACE("(%p, %d, {%p, ...}, {%x})\n", this, cidl, apidl ? apidl[0] : NULL, (unsigned int)*rgfInOut); - *rgfInOut &= SFGAO_CANMOVE | SFGAO_CANDELETE | SFGAO_HASPROPSHEET | SFGAO_FILESYSTEM | SFGAO_FOLDER; + *rgfInOut &= SFGAO_FOLDER|SFGAO_DROPTARGET|SFGAO_HASPROPSHEET|SFGAO_CANLINK; return S_OK; } diff --git a/reactos/dll/win32/shell32/shlfolder.cpp b/reactos/dll/win32/shell32/shlfolder.cpp index 891f746f114..b170a7e9a16 100644 --- a/reactos/dll/win32/shell32/shlfolder.cpp +++ b/reactos/dll/win32/shell32/shlfolder.cpp @@ -398,18 +398,18 @@ HRESULT SHELL32_GetItemAttributes (IShellFolder * psf, LPCITEMIDLIST pidl, LPDWO dwAttributes = *pdwAttributes; /* Attributes of some special folders are hardcoded */ - if (_ILIsDrive(pidl)) { + if (_ILIsDrive(pidl)) *pdwAttributes &= SFGAO_HASSUBFOLDER|SFGAO_FILESYSTEM|SFGAO_FOLDER|SFGAO_FILESYSANCESTOR| SFGAO_DROPTARGET|SFGAO_HASPROPSHEET|SFGAO_CANRENAME; - } else if (_ILIsMyComputer(pidl) || _ILIsNetHood(pidl)) { + else if (_ILIsMyComputer(pidl) || _ILIsNetHood(pidl)) *pdwAttributes &= SFGAO_HASSUBFOLDER|SFGAO_FOLDER|SFGAO_FILESYSANCESTOR| SFGAO_DROPTARGET|SFGAO_HASPROPSHEET|SFGAO_CANDELETE| SFGAO_CANRENAME|SFGAO_CANLINK; - } else if (_ILIsControlPanel(pidl)) { + else if (_ILIsControlPanel(pidl)) *pdwAttributes &= SFGAO_HASSUBFOLDER|SFGAO_FOLDER|SFGAO_CANLINK; - } else if (has_guid && HCR_GetFolderAttributes(pidl, &dwAttributes)) { + else if (has_guid && HCR_GetFolderAttributes(pidl, &dwAttributes)) *pdwAttributes = dwAttributes; - } else if (_ILGetDataPointer(pidl)) + else if (_ILGetDataPointer(pidl)) { dwAttributes = _ILGetFileAttributes(pidl, NULL, 0);