| 952 | } |
| 953 | |
| 954 | bool StackWalker::Init(ExceptType extype, int options, LPCSTR szSymPath, DWORD dwProcessId, |
| 955 | HANDLE hProcess, PEXCEPTION_POINTERS exp) |
| 956 | { |
| 957 | PCONTEXT ctx = NULL; |
| 958 | if (extype == AfterCatch) |
| 959 | ctx = get_current_exception_context(); |
| 960 | if (extype == AfterExcept && exp) |
| 961 | ctx = exp->ContextRecord; |
| 962 | this->m_options = options; |
| 963 | this->m_modulesLoaded = FALSE; |
| 964 | this->m_szSymPath = NULL; |
| 965 | this->m_MaxRecursionCount = 1000; |
| 966 | this->m_sw = NULL; |
| 967 | SetTargetProcess(dwProcessId, hProcess); |
| 968 | SetSymPath(szSymPath); |
| 969 | /* MSVC ignore std::nothrow specifier for `new` operator */ |
| 970 | LPVOID buf = malloc(sizeof(StackWalkerInternal)); |
| 971 | if (!buf) |
| 972 | return false; |
| 973 | memset(buf, 0, sizeof(StackWalkerInternal)); |
| 974 | this->m_sw = new(buf) StackWalkerInternal(this, this->m_hProcess, ctx); // placement new |
| 975 | return true; |
| 976 | } |
| 977 | |
| 978 | StackWalker::StackWalker(DWORD dwProcessId, HANDLE hProcess) |
| 979 | { |
no test coverage detected