I'm writing an out of process minidump for a child process. Here is the relevant code snippet:
CONTEXT thread_context{};
thread_context.ContextFlags = CONTEXT_FULL;
assert(GetThreadContext(child_thread_handle, &thread_context));
EXCEPTION_POINTERS exception_ptrs;
exception_ptrs.ExceptionRecord = &exception_info.ExceptionRecord;
exception_ptrs.ContextRecord = &thread_context;
MINIDUMP_EXCEPTION_INFORMATION minidump_exception_info;
minidump_exception_info.ThreadId = evt.dwThreadId;
minidump_exception_info.ExceptionPointers = &exception_ptrs;
minidump_exception_info.ClientPointers = FALSE;
auto success = MiniDumpWriteDump(child_handle, evt.dwProcessId, file_handle, minidump_flags, &minidump_exception_info, nullptr, nullptr);
This gives me the exception information, and the call stack for every thread except the thread that raised the exception. If I change &minidump_exception_info
to nullptr, I get the call stack but no exception information. Is there a way to get both the exception information and the call stack?