20#include "client/windows/handler/exception_handler.h"
28 auto len = wcslen(src);
31 memcpy(dest, src,
sizeof(
wchar_t) * len);
42 auto srclen = wcslen(src);
43 auto dstlen = wcslen(dest);
44 if (srclen + dstlen < destsz)
46 memcpy(dest + dstlen, src,
sizeof(
wchar_t) * srclen);
47 dest[srclen + dstlen] = 0;
57 std::stringstream stream;
59 std::size_t parameterIndex = 0;
60 std::size_t parametersCount = parameters.size();
61 for (
auto& pair : parameters)
63 stream << pair.first.c_str() <<
"=\\\"" << pair.second.c_str() <<
"\\\"";
65 if (parameterIndex < parametersCount)
105 ZeroMemory(&si,
sizeof(si));
107 si.dwFlags = STARTF_USESHOWWINDOW;
108 si.wShowWindow = SW_SHOW;
110 PROCESS_INFORMATION
pi;
111 ZeroMemory(&
pi,
sizeof(
pi));
113 if (CreateProcessW(NULL, c->
mCommand, NULL, NULL, FALSE, 0, NULL, NULL, &si, &
pi))
115 CloseHandle(
pi.hProcess);
116 CloseHandle(
pi.hThread);
124 const wchar_t* dump_path,
125 const wchar_t* minidump_id,
127 EXCEPTION_POINTERS* ,
128 MDRawAssertionInfo* ,
132 if (!
SendReport(crashReportContext, dump_path, minidump_id))
139 auto fullpath = path +
"\\" + CRASHREPORTER_PROGRAM_NAME;
158 static auto handler =
new google_breakpad::ExceptionHandler(
159 std::wstring_convert<std::codecvt_utf8<wchar_t>,
wchar_t>().from_bytes(databasePath),
163 google_breakpad::ExceptionHandler::HANDLER_ALL);
This object is for internal usage.
char mParameters[MaxBufferLength]
bool SetParameters(const std::map< std::string, std::string > &p)
bool SetReportURL(const std::string &url)
char mSenderPath[MaxBufferLength]
bool SetSenderPathUTF8(const std::string &path)
char mReportURL[MaxBufferLength]
static constexpr size_t MaxCommandLength
static constexpr size_t MaxBufferLength
void StartHandler(const std::string &databasePath)
wchar_t mCommand[MaxCommandLength]
bool StrcpyChecked(wchar_t *dest, size_t destsz, const wchar_t *src)
std::string StringifyParameters(const std::map< std::string, std::string > ¶meters)
bool StrcatChecked(wchar_t *dest, size_t destsz, const wchar_t *src)
AuthorizationHandler handler
bool SendReport(CrashReportContext *c, const wchar_t *path, const wchar_t *id)
bool MakeCommand(CrashReportContext *c, const wchar_t *path, const wchar_t *id)
bool UploadReport(const wchar_t *dump_path, const wchar_t *minidump_id, void *context, EXCEPTION_POINTERS *, MDRawAssertionInfo *, bool succeeded)