msi: Call ui_actiondata for more actions.
[wine/wine64.git] / programs / winedbg / tgt_minidump.c
bloba203a9dc372ac39b8454f3535224cd63c3a62a08
1 /*
2 * Wine debugger - minidump handling
4 * Copyright 2005 Eric Pouech
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #define NONAMELESSUNION
22 #define NONAMELESSSTRUCT
24 #include "config.h"
26 #include <stdlib.h>
27 #include <stdio.h>
28 #include <string.h>
29 #include <stdarg.h>
31 #include "debugger.h"
32 #include "wingdi.h"
33 #include "winuser.h"
34 #include "tlhelp32.h"
35 #include "wine/debug.h"
37 WINE_DEFAULT_DEBUG_CHANNEL(winedbg);
39 void minidump_write(const char* file, const EXCEPTION_RECORD* rec)
41 HANDLE hFile;
42 MINIDUMP_EXCEPTION_INFORMATION mei;
43 EXCEPTION_POINTERS ep;
44 DWORD wine_opt;
46 hFile = CreateFile(file, GENERIC_READ|GENERIC_WRITE, 0, NULL, CREATE_ALWAYS,
47 FILE_ATTRIBUTE_NORMAL, NULL);
49 if (hFile == INVALID_HANDLE_VALUE) return;
51 if (rec)
53 mei.ThreadId = dbg_curr_thread->tid;
54 mei.ExceptionPointers = &ep;
55 ep.ExceptionRecord = (EXCEPTION_RECORD*)rec;
56 ep.ContextRecord = &dbg_context;
57 mei.ClientPointers = FALSE;
59 /* this is a wine specific options to return also ELF modules in the
60 * dumping
62 SymSetOptions((wine_opt = SymGetOptions()) | 0x40000000);
63 MiniDumpWriteDump(dbg_curr_process->handle, dbg_curr_process->pid,
64 hFile, MiniDumpNormal/*|MiniDumpWithDataSegs*/,
65 rec ? &mei : NULL, NULL, NULL);
66 SymSetOptions(wine_opt);
67 CloseHandle(hFile);