diff --git a/dlls/shell32/cpanelfolder.c b/dlls/shell32/cpanelfolder.c index 1a3b379f9a0..206ce134622 100644 --- a/dlls/shell32/cpanelfolder.c +++ b/dlls/shell32/cpanelfolder.c @@ -561,7 +561,7 @@ static HRESULT WINAPI ISF_ControlPanel_fnGetAttributesOf(IShellFolder2 *iface, U while(cidl > 0 && *apidl) { pdump(*apidl); - SHELL32_GetItemAttributes((IShellFolder *)&This->IShellFolder2_iface, *apidl, rgfInOut); + SHELL32_GetItemAttributes(&This->IShellFolder2_iface, *apidl, rgfInOut); apidl++; cidl--; } diff --git a/dlls/shell32/shfldr.h b/dlls/shell32/shfldr.h index b6ebfb2b576..1f4194e2965 100644 --- a/dlls/shell32/shfldr.h +++ b/dlls/shell32/shfldr.h @@ -39,7 +39,7 @@ BOOL SHELL32_GetCustomFolderAttribute (LPCITEMIDLIST pidl, LPCWSTR pwszHeading, LPCWSTR GetNextElementW (LPCWSTR pszNext, LPWSTR pszOut, DWORD dwOut) DECLSPEC_HIDDEN; HRESULT SHELL32_ParseNextElement (IShellFolder2 * psf, HWND hwndOwner, LPBC pbc, LPITEMIDLIST * pidlInOut, LPOLESTR szNext, DWORD * pEaten, DWORD * pdwAttributes) DECLSPEC_HIDDEN; -HRESULT SHELL32_GetItemAttributes (IShellFolder * psf, LPCITEMIDLIST pidl, LPDWORD pdwAttributes) DECLSPEC_HIDDEN; +HRESULT SHELL32_GetItemAttributes (IShellFolder2 *folder, LPCITEMIDLIST pidl, DWORD *attributes) DECLSPEC_HIDDEN; HRESULT SHELL32_GetDisplayNameOfChild (IShellFolder2 * psf, LPCITEMIDLIST pidl, DWORD dwFlags, LPWSTR szOut, DWORD dwOutLen) DECLSPEC_HIDDEN; diff --git a/dlls/shell32/shfldr_desktop.c b/dlls/shell32/shfldr_desktop.c index 40cd752eaf6..8721a9acea1 100644 --- a/dlls/shell32/shfldr_desktop.c +++ b/dlls/shell32/shfldr_desktop.c @@ -155,7 +155,6 @@ static HRESULT WINAPI ISF_Desktop_fnParseDisplayName (IShellFolder2 * iface, DWORD * pchEaten, LPITEMIDLIST * ppidl, DWORD * pdwAttributes) { IDesktopFolderImpl *This = impl_from_IShellFolder2(iface); - IShellFolder *shell_folder = (IShellFolder*)iface; WCHAR szElement[MAX_PATH]; LPCWSTR szNext = NULL; LPITEMIDLIST pidlTemp = NULL; @@ -268,7 +267,7 @@ static HRESULT WINAPI ISF_Desktop_fnParseDisplayName (IShellFolder2 * iface, else { if (pdwAttributes && *pdwAttributes) - hr = SHELL32_GetItemAttributes(shell_folder, pidlTemp, pdwAttributes); + hr = SHELL32_GetItemAttributes(iface, pidlTemp, pdwAttributes); } } @@ -454,7 +453,6 @@ static HRESULT WINAPI ISF_Desktop_fnGetAttributesOf (IShellFolder2 * iface, UINT cidl, LPCITEMIDLIST * apidl, DWORD * rgfInOut) { IDesktopFolderImpl *This = impl_from_IShellFolder2(iface); - IShellFolder *shell_folder = (IShellFolder*)iface; static const DWORD dwDesktopAttributes = SFGAO_STORAGE | SFGAO_HASPROPSHEET | SFGAO_STORAGEANCESTOR | @@ -484,7 +482,7 @@ static HRESULT WINAPI ISF_Desktop_fnGetAttributesOf (IShellFolder2 * iface, } else if (_ILIsMyComputer(*apidl)) { *rgfInOut &= dwMyComputerAttributes; } else { - SHELL32_GetItemAttributes ( shell_folder, *apidl, rgfInOut); + SHELL32_GetItemAttributes(iface, *apidl, rgfInOut); } apidl++; cidl--; diff --git a/dlls/shell32/shfldr_fs.c b/dlls/shell32/shfldr_fs.c index 2f49eb27064..c7259276d1d 100644 --- a/dlls/shell32/shfldr_fs.c +++ b/dlls/shell32/shfldr_fs.c @@ -342,10 +342,8 @@ IShellFolder_fnParseDisplayName (IShellFolder2 * iface, &pidlTemp, (LPOLESTR) szNext, pchEaten, pdwAttributes); } else { /* it's the last element */ - if (pdwAttributes && *pdwAttributes) { - hr = SHELL32_GetItemAttributes((IShellFolder *)&This->IShellFolder2_iface, - pidlTemp, pdwAttributes); - } + if (pdwAttributes && *pdwAttributes) + hr = SHELL32_GetItemAttributes(&This->IShellFolder2_iface, pidlTemp, pdwAttributes); } } } @@ -511,19 +509,19 @@ IShellFolder_fnGetAttributesOf (IShellFolder2 * iface, UINT cidl, *rgfInOut = ~0; if(cidl == 0){ - IShellFolder *psfParent = NULL; + IShellFolder2 *parent = NULL; LPCITEMIDLIST rpidl = NULL; - hr = SHBindToParent(This->pidlRoot, &IID_IShellFolder, (LPVOID*)&psfParent, &rpidl); + hr = SHBindToParent(This->pidlRoot, &IID_IShellFolder2, (void **)&parent, &rpidl); if(SUCCEEDED(hr)) { - SHELL32_GetItemAttributes (psfParent, rpidl, rgfInOut); - IShellFolder_Release(psfParent); + SHELL32_GetItemAttributes(parent, rpidl, rgfInOut); + IShellFolder2_Release(parent); } } else { while (cidl > 0 && *apidl) { pdump (*apidl); - SHELL32_GetItemAttributes((IShellFolder *)&This->IShellFolder2_iface, *apidl, rgfInOut); + SHELL32_GetItemAttributes(&This->IShellFolder2_iface, *apidl, rgfInOut); apidl++; cidl--; } diff --git a/dlls/shell32/shfldr_mycomp.c b/dlls/shell32/shfldr_mycomp.c index 767509bb8ea..4022c8d1bdd 100644 --- a/dlls/shell32/shfldr_mycomp.c +++ b/dlls/shell32/shfldr_mycomp.c @@ -232,8 +232,7 @@ static HRESULT WINAPI ISF_MyComputer_fnParseDisplayName (IShellFolder2 *iface, else { if (pdwAttributes && *pdwAttributes) - SHELL32_GetItemAttributes ((IShellFolder*)&This->IShellFolder2_iface, pidlTemp, - pdwAttributes); + SHELL32_GetItemAttributes (&This->IShellFolder2_iface, pidlTemp, pdwAttributes); hr = S_OK; } @@ -477,18 +476,18 @@ static HRESULT WINAPI ISF_MyComputer_fnGetAttributesOf (IShellFolder2 * iface, *rgfInOut = ~0; if(cidl == 0){ - IShellFolder *psfParent = NULL; + IShellFolder2 *parent = NULL; LPCITEMIDLIST rpidl = NULL; - hr = SHBindToParent(This->pidlRoot, &IID_IShellFolder, (LPVOID*)&psfParent, &rpidl); + hr = SHBindToParent(This->pidlRoot, &IID_IShellFolder2, (void **)&parent, &rpidl); if(SUCCEEDED(hr)) { - SHELL32_GetItemAttributes (psfParent, rpidl, rgfInOut); - IShellFolder_Release(psfParent); + SHELL32_GetItemAttributes(parent, rpidl, rgfInOut); + IShellFolder2_Release(parent); } } else { while (cidl > 0 && *apidl) { pdump (*apidl); - SHELL32_GetItemAttributes ((IShellFolder*)&This->IShellFolder2_iface, *apidl, rgfInOut); + SHELL32_GetItemAttributes(&This->IShellFolder2_iface, *apidl, rgfInOut); apidl++; cidl--; } diff --git a/dlls/shell32/shfldr_netplaces.c b/dlls/shell32/shfldr_netplaces.c index 16e7cd5a895..b9513a9b5e0 100644 --- a/dlls/shell32/shfldr_netplaces.c +++ b/dlls/shell32/shfldr_netplaces.c @@ -220,8 +220,7 @@ static HRESULT WINAPI ISF_NetworkPlaces_fnParseDisplayName (IShellFolder2 * ifac else { if (pdwAttributes && *pdwAttributes) - hr = SHELL32_GetItemAttributes((IShellFolder *)&This->IShellFolder2_iface, pidlTemp, - pdwAttributes); + hr = SHELL32_GetItemAttributes(&This->IShellFolder2_iface, pidlTemp, pdwAttributes); } } @@ -364,14 +363,14 @@ static HRESULT WINAPI ISF_NetworkPlaces_fnGetAttributesOf (IShellFolder2 * iface if (cidl == 0) { - IShellFolder *psfParent = NULL; + IShellFolder2 *parent = NULL; LPCITEMIDLIST rpidl = NULL; - hr = SHBindToParent(This->pidlRoot, &IID_IShellFolder, (void**)&psfParent, &rpidl); + hr = SHBindToParent(This->pidlRoot, &IID_IShellFolder2, (void **)&parent, &rpidl); if(SUCCEEDED(hr)) { - SHELL32_GetItemAttributes (psfParent, rpidl, rgfInOut); - IShellFolder_Release(psfParent); + SHELL32_GetItemAttributes(parent, rpidl, rgfInOut); + IShellFolder2_Release(parent); } } else @@ -379,7 +378,7 @@ static HRESULT WINAPI ISF_NetworkPlaces_fnGetAttributesOf (IShellFolder2 * iface while (cidl > 0 && *apidl) { pdump (*apidl); - SHELL32_GetItemAttributes ((IShellFolder *)&This->IShellFolder2_iface, *apidl, rgfInOut); + SHELL32_GetItemAttributes(&This->IShellFolder2_iface, *apidl, rgfInOut); apidl++; cidl--; } diff --git a/dlls/shell32/shlfolder.c b/dlls/shell32/shlfolder.c index c39d96837a4..8688c5d053d 100644 --- a/dlls/shell32/shlfolder.c +++ b/dlls/shell32/shlfolder.c @@ -389,7 +389,7 @@ HRESULT SHELL32_GetDisplayNameOfChild (IShellFolder2 * psf, * According to the MSDN documentation this function should not set flags. It claims only to reset flags when necessary. * However it turns out the native shell32.dll _sets_ flags in several cases - so do we. */ -HRESULT SHELL32_GetItemAttributes (IShellFolder * psf, LPCITEMIDLIST pidl, LPDWORD pdwAttributes) +HRESULT SHELL32_GetItemAttributes (IShellFolder2 *psf, LPCITEMIDLIST pidl, LPDWORD pdwAttributes) { DWORD dwAttributes; BOOL has_guid; @@ -435,8 +435,7 @@ HRESULT SHELL32_GetItemAttributes (IShellFolder * psf, LPCITEMIDLIST pidl, LPDWO /* File attributes are not present in the internal PIDL structure, so get them from the file system. */ - HRESULT hr = IShellFolder_GetDisplayNameOf(psf, pidl, SHGDN_FORPARSING, &strret); - + HRESULT hr = IShellFolder2_GetDisplayNameOf(psf, pidl, SHGDN_FORPARSING, &strret); if (SUCCEEDED(hr)) { hr = StrRetToBufW(&strret, pidl, path, MAX_PATH);