- int size = CaptureStackBackTrace(skip_count, max_depth, &stack[0], NULL);
- for (int i = 0; i < size; ++i) {
- // Resolve symbol information from address.
- char buffer[sizeof(SYMBOL_INFO) + MAX_SYM_NAME * sizeof(TCHAR)];
- SYMBOL_INFO* symbol = reinterpret_cast<SYMBOL_INFO*>(buffer);
- symbol->SizeOfStruct = sizeof(SYMBOL_INFO);
- symbol->MaxNameLen = MAX_SYM_NAME;
- SymFromAddr(module_initializer.hProcess, reinterpret_cast<DWORD64>(stack[i]), 0, symbol);
- result[i] = stack[i];
- }
-
- return size;
+ return CaptureStackBackTrace(skip_count, max_depth, result, NULL);