+#if wxUSE_MINIDUMP
+ MINIDUMP_EXCEPTION_INFORMATION minidumpExcInfo;
+
+ minidumpExcInfo.ThreadId = ::GetCurrentThreadId();
+ minidumpExcInfo.ExceptionPointers = wxGlobalSEInformation;
+ minidumpExcInfo.ClientPointers = FALSE; // in our own address space
+
+ // do generate the dump
+ MINIDUMP_TYPE dumpFlags;
+ if ( flags & wxCRASH_REPORT_LOCALS )
+ {
+ // the only way to get local variables is to dump the entire
+ // process memory space -- but this makes for huge (dozens or
+ // even hundreds of Mb) files
+ dumpFlags = MiniDumpWithFullMemory;
+ }
+ else if ( flags & wxCRASH_REPORT_GLOBALS )
+ {
+ // MiniDumpWriteDump() has the option for dumping just the data
+ // segment which contains all globals -- exactly what we need
+ dumpFlags = MiniDumpWithDataSegs;
+ }
+ else // minimal dump
+ {
+ dumpFlags = MiniDumpNormal;
+ }
+
+ if ( !MiniDumpWriteDump
+ (
+ ::GetCurrentProcess(),
+ ::GetCurrentProcessId(),
+ m_hFile, // file to write to
+ dumpFlags, // kind of dump to craete
+ &minidumpExcInfo,
+ NULL, // no extra user-defined data
+ NULL // no callbacks
+ ) )
+ {
+ Output(_T("MiniDumpWriteDump() failed."));
+
+ return false;
+ }
+
+ return true;
+#else // !wxUSE_MINIDUMP