| 898 | } |
| 899 | |
| 900 | bool StackWalker::Init(ExceptType extype, int options, LPCSTR szSymPath, DWORD dwProcessId, |
| 901 | HANDLE hProcess, PEXCEPTION_POINTERS exp) |
| 902 | { |
| 903 | PCONTEXT ctx = NULL; |
| 904 | if (extype == AfterCatch) |
| 905 | ctx = get_current_exception_context(); |
| 906 | if (extype == AfterExcept && exp) |
| 907 | ctx = exp->ContextRecord; |
| 908 | this->m_options = options; |
| 909 | this->m_modulesLoaded = FALSE; |
| 910 | this->m_szSymPath = NULL; |
| 911 | this->m_MaxRecursionCount = 1000; |
| 912 | this->m_sw = NULL; |
| 913 | SetTargetProcess(dwProcessId, hProcess); |
| 914 | SetSymPath(szSymPath); |
| 915 | /* MSVC ignore std::nothrow specifier for `new` operator */ |
| 916 | LPVOID buf = malloc(sizeof(StackWalkerInternal)); |
| 917 | if (!buf) |
| 918 | return false; |
| 919 | memset(buf, 0, sizeof(StackWalkerInternal)); |
| 920 | this->m_sw = new(buf) StackWalkerInternal(this, this->m_hProcess, ctx); // placement new |
| 921 | return true; |
| 922 | } |
| 923 | |
| 924 | StackWalker::StackWalker(DWORD dwProcessId, HANDLE hProcess) |
| 925 | { |
no test coverage detected