From a6c2a0a1713e3c9dbcbe9506738fd1759c2bf981 Mon Sep 17 00:00:00 2001 From: Doug Turner Date: Thu, 19 Feb 2009 18:56:49 -0800 Subject: [PATCH] Bug 461849 - enable icon decoder on Windows Mobile. r=stuart --- .../libpr0n/decoders/icon/win/nsIconChannel.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/modules/libpr0n/decoders/icon/win/nsIconChannel.cpp b/modules/libpr0n/decoders/icon/win/nsIconChannel.cpp index e403ffac611..d6a72a851af 100644 --- a/modules/libpr0n/decoders/icon/win/nsIconChannel.cpp +++ b/modules/libpr0n/decoders/icon/win/nsIconChannel.cpp @@ -259,6 +259,7 @@ NS_IMETHODIMP nsIconChannel::AsyncOpen(nsIStreamListener *aListener, nsISupports return rv; } +#ifndef WINCE static DWORD GetSpecialFolderIcon(nsIFile* aFile, int aFolder, SHFILEINFOW* aSFI, UINT aInfoFlags) { DWORD shellResult = 0; @@ -292,11 +293,13 @@ static DWORD GetSpecialFolderIcon(nsIFile* aFile, int aFolder, SHFILEINFOW* aSFI } return shellResult; } +#endif static UINT GetSizeInfoFlag(PRUint32 aDesiredImageSize) { UINT infoFlag; #ifndef WINCE + // SHGFI_SHELLICONSIZE does not exist on windows mobile. if (aDesiredImageSize > 16) infoFlag = SHGFI_SHELLICONSIZE; else @@ -308,6 +311,10 @@ static UINT GetSizeInfoFlag(PRUint32 aDesiredImageSize) nsresult nsIconChannel::GetHIconFromFile(HICON *hIcon) { +#ifdef WINCE + // GetDIBits does not exist on windows mobile. + return NS_ERROR_NOT_AVAILABLE; +#else nsXPIDLCString contentType; nsCString fileExt; nsCOMPtr localFile; // file we want an icon for @@ -383,6 +390,7 @@ nsresult nsIconChannel::GetHIconFromFile(HICON *hIcon) rv = NS_ERROR_NOT_AVAILABLE; return rv; +#endif } #ifndef MOZ_DISABLE_VISTA_SDK_REQUIREMENTS @@ -433,7 +441,10 @@ nsresult nsIconChannel::GetStockHIcon(nsIMozIconURI *aIconURI, HICON *hIcon) nsresult nsIconChannel::MakeInputStream(nsIInputStream** _retval, PRBool nonBlocking) { // Check whether the icon requested's a file icon or a stock icon - nsresult rv; + nsresult rv = NS_ERROR_NOT_AVAILABLE; + + // GetDIBits does not exist on windows mobile. +#ifndef WINCE HICON hIcon = NULL; #ifndef MOZ_DISABLE_VISTA_SDK_REQUIREMENTS @@ -522,6 +533,7 @@ nsresult nsIconChannel::MakeInputStream(nsIInputStream** _retval, PRBool nonBloc DestroyIcon(hIcon); } // if we got an hIcon +#endif return rv; }