Bug 817568 - Enclose more API calls with __try...__except. r=mcmanus
authorMasatoshi Kimura <VYV03354@nifty.ne.jp>
Thu, 31 Jan 2013 21:47:58 +0900
changeset 120462 14c3c3913e3c07bbc947aac54bf07f4abac165c7
parent 120461 7ee87ad80dd109075c28c1d97dd757bc42365e64
child 120463 3808b7673bde4a6713ce6ea49e62a0da1f9a90a3
push id24251
push userryanvm@gmail.com
push dateThu, 31 Jan 2013 20:56:22 +0000
treeherdermozilla-central@683b08dc1afd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmcmanus
bugs817568
milestone21.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 817568 - Enclose more API calls with __try...__except. r=mcmanus
toolkit/system/windowsproxy/nsWindowsSystemProxySettings.cpp
--- a/toolkit/system/windowsproxy/nsWindowsSystemProxySettings.cpp
+++ b/toolkit/system/windowsproxy/nsWindowsSystemProxySettings.cpp
@@ -63,18 +63,22 @@ static void SetProxyResultDirect(nsACStr
     aResult.AssignASCII("DIRECT");
 }
 
 static nsresult ReadInternetOption(uint32_t aOption, uint32_t& aFlags,
                                    nsAString& aValue)
 {
     DWORD connFlags = 0;
     WCHAR connName[RAS_MaxEntryName + 1];
-    InternetGetConnectedStateExW(&connFlags, connName,
-                                 mozilla::ArrayLength(connName), 0);
+    MOZ_SEH_TRY {
+        InternetGetConnectedStateExW(&connFlags, connName,
+                                     mozilla::ArrayLength(connName), 0);
+    } MOZ_SEH_EXCEPT(EXCEPTION_EXECUTE_HANDLER) {
+        return NS_ERROR_FAILURE;
+    }
 
     INTERNET_PER_CONN_OPTIONW options[2];
     options[0].dwOption = INTERNET_PER_CONN_FLAGS_UI;
     options[1].dwOption = aOption;
 
     INTERNET_PER_CONN_OPTION_LISTW list;
     list.dwSize = sizeof(INTERNET_PER_CONN_OPTION_LISTW);
     list.pszConnection = connFlags & INTERNET_CONNECTION_MODEM ?
@@ -91,17 +95,17 @@ static nsresult ReadInternetOption(uint3
         }
         options[0].dwOption = INTERNET_PER_CONN_FLAGS;
         size = sizeof(INTERNET_PER_CONN_OPTION_LISTW);
         MOZ_SEH_TRY {
             if (!InternetQueryOptionW(NULL, INTERNET_OPTION_PER_CONNECTION_OPTION,
                                       &list, &size)) {
                 return NS_ERROR_FAILURE;
             }
-        } MOZ_SEH_EXCEPT (EXCEPTION_EXECUTE_HANDLER) {
+        } MOZ_SEH_EXCEPT(EXCEPTION_EXECUTE_HANDLER) {
             return NS_ERROR_FAILURE;
         }
     }
 
     aFlags = options[0].Value.dwValue;
     aValue.Assign(options[1].Value.pszValue);
     GlobalFree(options[1].Value.pszValue);