Bug 801471 - Failed to convert nsresult to HRESULT in nsDataObj.cpp on windows build. r=jmathies
authorOleg Romashin <romaxa@gmail.com>
Sun, 14 Oct 2012 23:20:49 -0700
changeset 110411 25f31c96a280e64a5cea3e7f2bc828d49ca82494
parent 110410 9ec5186031b086655d04cc434cbbe1fc6befc8db
child 110412 8c6f15a776956da96b9a684dc7d9472a7a432f8d
push id93
push usernmatsakis@mozilla.com
push dateWed, 31 Oct 2012 21:26:57 +0000
reviewersjmathies
bugs801471
milestone19.0a1
Bug 801471 - Failed to convert nsresult to HRESULT in nsDataObj.cpp on windows build. r=jmathies
widget/windows/nsDataObj.cpp
--- a/widget/windows/nsDataObj.cpp
+++ b/widget/windows/nsDataObj.cpp
@@ -307,17 +307,17 @@ HRESULT nsDataObj::CreateStream(IStream 
   NS_ENSURE_TRUE(outStream, E_INVALIDARG);
 
   nsresult rv = NS_ERROR_FAILURE;
   nsAutoString wideFileName;
   nsCOMPtr<nsIURI> sourceURI;
 
   rv = GetDownloadDetails(getter_AddRefs(sourceURI),
                           wideFileName);
-  NS_ENSURE_SUCCESS(rv, rv);
+  NS_ENSURE_SUCCESS(rv, E_FAIL);
 
   nsDataObj::CStream *pStream = new nsDataObj::CStream();
   NS_ENSURE_TRUE(pStream, E_OUTOFMEMORY);
 
   pStream->AddRef();
 
   rv = pStream->Init(sourceURI);
   if (NS_FAILED(rv))
@@ -1106,20 +1106,20 @@ nsDataObj :: GetFileContentsInternetShor
   nsCOMPtr<nsIURI> aUri;
   NS_NewURI(getter_AddRefs(aUri), url);
 
   nsAutoString aUriHash;
 
   mozilla::widget::FaviconHelper::ObtainCachedIconFile(aUri, aUriHash, mIOThread, true);
 
   nsresult rv = mozilla::widget::FaviconHelper::GetOutputIconPath(aUri, icoFile, true);
-  NS_ENSURE_SUCCESS(rv, rv);
+  NS_ENSURE_SUCCESS(rv, E_FAIL);
   nsCString path;
   rv = icoFile->GetNativePath(path);
-  NS_ENSURE_SUCCESS(rv, rv);
+  NS_ENSURE_SUCCESS(rv, E_FAIL);
 
   static char* shortcutFormatStr = "[InternetShortcut]\r\nURL=%s\r\n" 
                                    "IDList=\r\nHotKey=0\r\nIconFile=%s\r\n" 
                                    "IconIndex=0\r\n";
   static const int formatLen = strlen(shortcutFormatStr) - 2*2; // don't include %s (2 times) in the len
   const int totalLen = formatLen + asciiUrl.Length() 
                        + path.Length(); // we don't want a null character on the end