From 8bf6255b7e924dcd87a7f70d37fd019b2c4e3892 Mon Sep 17 00:00:00 2001 From: "neil%parkwaycc.co.uk" Date: Tue, 29 Jun 2004 20:16:00 +0000 Subject: [PATCH] Remove ben's win/nsIconChannel.cpp dependency on IE allowing it to work on W95/NT4 again also fixing mingw builds p=lorenzo@colitti.com r=me sr=mscott git-svn-id: svn://10.0.0.236/trunk@158585 18797224-902f-48f8-a5cc-f745e15eee43 --- .../libpr0n/decoders/icon/win/nsIconChannel.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/mozilla/modules/libpr0n/decoders/icon/win/nsIconChannel.cpp b/mozilla/modules/libpr0n/decoders/icon/win/nsIconChannel.cpp index 140c5c4d838..b173f0b7817 100644 --- a/mozilla/modules/libpr0n/decoders/icon/win/nsIconChannel.cpp +++ b/mozilla/modules/libpr0n/decoders/icon/win/nsIconChannel.cpp @@ -249,14 +249,14 @@ static DWORD GetSpecialFolderIcon(nsIFile* aFile, int aFolder, SHFILEINFO* aSFI, aFile->GetNativePath(fileNativePathStr); ::GetShortPathName(fileNativePathStr.get(), fileNativePath, sizeof(fileNativePath)); - char specialNativePath[MAX_PATH]; - ::SHGetSpecialFolderPath(NULL, specialNativePath, aFolder, FALSE); - ::GetShortPathName(specialNativePath, specialNativePath, sizeof(specialNativePath)); + LPITEMIDLIST idList; + HRESULT hr = ::SHGetSpecialFolderLocation(NULL, aFolder, &idList); + if (SUCCEEDED(hr)) { + char specialNativePath[MAX_PATH]; + ::SHGetPathFromIDList(idList, specialNativePath); + ::GetShortPathName(specialNativePath, specialNativePath, sizeof(specialNativePath)); - if (nsDependentCString(fileNativePath).EqualsIgnoreCase(specialNativePath)) { - LPITEMIDLIST idList; - HRESULT hr = ::SHGetSpecialFolderLocation(NULL, aFolder, &idList); - if (SUCCEEDED(hr)) { + if (nsDependentCString(fileNativePath).EqualsIgnoreCase(specialNativePath)) { aInfoFlags |= (SHGFI_PIDL | SHGFI_SYSICONINDEX); shellResult = ::SHGetFileInfo((LPCTSTR)(LPCITEMIDLIST)idList, 0, aSFI, sizeof(SHFILEINFO), aInfoFlags);