Returns EXCEPTION_EXECUTE_HANDLER if Google Test should handle the given SEH exception, or EXCEPTION_CONTINUE_SEARCH otherwise. This function is useful as an __except condition.
| 2040 | // given SEH exception, or EXCEPTION_CONTINUE_SEARCH otherwise. |
| 2041 | // This function is useful as an __except condition. |
| 2042 | int UnitTestOptions::GTestShouldProcessSEH(DWORD exception_code) { |
| 2043 | // Google Test should handle a SEH exception if: |
| 2044 | // 1. the user wants it to, AND |
| 2045 | // 2. this is not a breakpoint exception, AND |
| 2046 | // 3. this is not a C++ exception (VC++ implements them via SEH, |
| 2047 | // apparently). |
| 2048 | // |
| 2049 | // SEH exception code for C++ exceptions. |
| 2050 | // (see http://support.microsoft.com/kb/185294 for more information). |
| 2051 | const DWORD kCxxExceptionCode = 0xe06d7363; |
| 2052 | |
| 2053 | bool should_handle = true; |
| 2054 | |
| 2055 | if (!GTEST_FLAG(catch_exceptions)) |
| 2056 | should_handle = false; |
| 2057 | else if (exception_code == EXCEPTION_BREAKPOINT) |
| 2058 | should_handle = false; |
| 2059 | else if (exception_code == kCxxExceptionCode) |
| 2060 | should_handle = false; |
| 2061 | |
| 2062 | return should_handle ? EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH; |
| 2063 | } |
| 2064 | #endif // GTEST_HAS_SEH |
| 2065 | |
| 2066 | } // namespace internal |
nothing calls this directly
no outgoing calls
no test coverage detected