Audacity 3.2.0
Namespaces | Functions
win32/CrashReportContext.cpp File Reference
#include "CrashReportContext.h"
#include <locale>
#include <codecvt>
#include <sstream>
#include "client/windows/handler/exception_handler.h"
Include dependency graph for win32/CrashReportContext.cpp:

Go to the source code of this file.

Namespaces

namespace  anonymous_namespace{CrashReportContext.cpp}
 

Functions

bool anonymous_namespace{CrashReportContext.cpp}::StrcpyChecked (wchar_t *dest, size_t destsz, const wchar_t *src)
 
bool anonymous_namespace{CrashReportContext.cpp}::StrcatChecked (wchar_t *dest, size_t destsz, const wchar_t *src)
 
std::string anonymous_namespace{CrashReportContext.cpp}::StringifyParameters (const std::map< std::string, std::string > &parameters)
 
bool MakeCommand (CrashReportContext *c, const wchar_t *path, const wchar_t *id)
 
bool SendReport (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)
 

Function Documentation

◆ MakeCommand()

bool MakeCommand ( CrashReportContext c,
const wchar_t *  path,
const wchar_t *  id 
)

Definition at line 72 of file win32/CrashReportContext.cpp.

73{
74 //utility path
78
79 //parameters: /p "..."
80 if (ok && c->mParameters[0] != 0)
81 {
85 }
86 //crash report URL: /u https://...
90 //minidump path: path/to/minidump.dmp
96 return ok;
97}
char mParameters[MaxBufferLength]
char mSenderPath[MaxBufferLength]
char mReportURL[MaxBufferLength]
static constexpr size_t MaxCommandLength
static constexpr size_t MaxBufferLength
wchar_t mCommand[MaxCommandLength]
bool StrcpyChecked(wchar_t *dest, size_t destsz, const wchar_t *src)
bool StrcatChecked(wchar_t *dest, size_t destsz, const wchar_t *src)

◆ SendReport()

bool SendReport ( CrashReportContext c,
const wchar_t *  path,
const wchar_t *  id 
)

Definition at line 99 of file win32/CrashReportContext.cpp.

100{
101 if (!MakeCommand(c, path, id))
102 return false;
103
104 STARTUPINFOW si;
105 ZeroMemory(&si, sizeof(si));
106 si.cb = sizeof(si);
107 si.dwFlags = STARTF_USESHOWWINDOW;
108 si.wShowWindow = SW_SHOW;
109
110 PROCESS_INFORMATION pi;
111 ZeroMemory(&pi, sizeof(pi));
112
113 if (CreateProcessW(NULL, c->mCommand, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi))
114 {
115 CloseHandle(pi.hProcess);
116 CloseHandle(pi.hThread);
117 return true;
118 }
119 else
120 return false;
121}
bool MakeCommand(CrashReportContext *c, const wchar_t *path, const wchar_t *id)

Referenced by UploadReport().

Here is the caller graph for this function:

◆ UploadReport()

bool UploadReport ( const wchar_t *  dump_path,
const wchar_t *  minidump_id,
void *  context,
EXCEPTION_POINTERS *  ,
MDRawAssertionInfo *  ,
bool  succeeded 
)

Definition at line 123 of file win32/CrashReportContext.cpp.

130{
131 CrashReportContext* crashReportContext = static_cast<CrashReportContext*>(context);
132 if (!SendReport(crashReportContext, dump_path, minidump_id))
133 return false;
134 return succeeded;
135}
This object is for internal usage.
bool SendReport(CrashReportContext *c, const wchar_t *path, const wchar_t *id)

References SendReport().

Here is the call graph for this function: