From c4aa25f1aa3bd4deb6466f3abbe6756e4cf67d9a Mon Sep 17 00:00:00 2001 From: Christoph von Wittich Date: Thu, 26 Jul 2007 21:53:05 +0000 Subject: [PATCH] add shell32_ros.diff svn path=/trunk/; revision=27889 --- reactos/dll/win32/shell32/shell32_ros.diff | 77 ++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 reactos/dll/win32/shell32/shell32_ros.diff diff --git a/reactos/dll/win32/shell32/shell32_ros.diff b/reactos/dll/win32/shell32/shell32_ros.diff new file mode 100644 index 00000000000..475db7a21bf --- /dev/null +++ b/reactos/dll/win32/shell32/shell32_ros.diff @@ -0,0 +1,77 @@ +Index: shell32_main.c +=================================================================== +--- shell32_main.c (revision 26448) ++++ shell32_main.c (working copy) +@@ -509,23 +509,59 @@ + /* get the iconlocation */ + if (SUCCEEDED(hr) && (flags & SHGFI_ICONLOCATION )) + { +- UINT uDummy,uFlags; ++ if (!(flags & SHGFI_USEFILEATTRIBUTES)) ++ { ++ UINT uDummy,uFlags; + +- hr = IShellFolder_GetUIObjectOf(psfParent, 0, 1, +- (LPCITEMIDLIST*)&pidlLast, &IID_IExtractIconA, +- &uDummy, (LPVOID*)&pei); +- if (SUCCEEDED(hr)) ++ hr = IShellFolder_GetUIObjectOf(psfParent, 0, 1, ++ (LPCITEMIDLIST*)&pidlLast, &IID_IExtractIconA, ++ &uDummy, (LPVOID*)&pei); ++ if (SUCCEEDED(hr)) ++ { ++ hr = IExtractIconW_GetIconLocation(pei, uGilFlags, ++ szLocation, MAX_PATH, &iIndex, &uFlags); ++ psfi->iIcon = iIndex; ++ ++ if (!(uFlags & GIL_NOTFILENAME)) ++ lstrcpyW (psfi->szDisplayName, szLocation); ++ else ++ ret = FALSE; ++ ++ IExtractIconA_Release(pei); ++ } ++ } ++ else + { +- hr = IExtractIconW_GetIconLocation(pei, uGilFlags, +- szLocation, MAX_PATH, &iIndex, &uFlags); +- psfi->iIcon = iIndex; +- +- if (!(uFlags & GIL_NOTFILENAME)) +- lstrcpyW (psfi->szDisplayName, szLocation); ++ if (dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ++ { ++ strcpyW(psfi->szDisplayName, swShell32Name); ++ psfi->iIcon = SIC_GetIconIndex(swShell32Name, -IDI_SHELL_FOLDER, 0); ++ } + else +- ret = FALSE; ++ { ++ WCHAR sTemp [MAX_PATH]; ++ WCHAR * szExt; ++ DWORD dwNr=0; ++ static const WCHAR p1W[] = {'%','1',0}; + +- IExtractIconA_Release(pei); ++ lstrcpynW(sTemp, szFullPath, MAX_PATH); ++ ++ psfi->iIcon = 0; ++ szExt = (LPWSTR) PathFindExtensionW(sTemp); ++ if ( szExt && ++ HCR_MapTypeToValueW(szExt, sTemp, MAX_PATH, TRUE) && ++ HCR_GetDefaultIconW(sTemp, sTemp, MAX_PATH, &dwNr)) ++ { ++ if (!lstrcmpW(p1W,sTemp)) /* icon is in the file */ ++ strcpyW(psfi->szDisplayName, szFullPath); ++ else ++ strcpyW(psfi->szDisplayName, sTemp); ++ ++ psfi->iIcon = SIC_GetIconIndex(psfi->szDisplayName, dwNr, 0); ++ if (psfi->iIcon == -1) ++ psfi->iIcon = 0; ++ } ++ } + } + } +