Merge pull request #5687 from electron/fix-invalid-parameter
Ignore invalid parameter error on Window
This commit is contained in:
commit
3ef0947718
2 changed files with 28 additions and 3 deletions
|
@ -30,6 +30,13 @@ bool IsBrowserProcess(base::CommandLine* cmd) {
|
||||||
return process_type.empty();
|
return process_type.empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(OS_WIN)
|
||||||
|
void InvalidParameterHandler(const wchar_t*, const wchar_t*, const wchar_t*,
|
||||||
|
unsigned int, uintptr_t) {
|
||||||
|
// noop.
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
AtomMainDelegate::AtomMainDelegate() {
|
AtomMainDelegate::AtomMainDelegate() {
|
||||||
|
@ -87,6 +94,11 @@ bool AtomMainDelegate::BasicStartupComplete(int* exit_code) {
|
||||||
SetUpBundleOverrides();
|
SetUpBundleOverrides();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(OS_WIN)
|
||||||
|
// Ignore invalid parameter errors.
|
||||||
|
_set_invalid_parameter_handler(InvalidParameterHandler);
|
||||||
|
#endif
|
||||||
|
|
||||||
return brightray::MainDelegate::BasicStartupComplete(exit_code);
|
return brightray::MainDelegate::BasicStartupComplete(exit_code);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -43,6 +43,10 @@ const MINIDUMP_TYPE kSmallDumpType = static_cast<MINIDUMP_TYPE>(
|
||||||
const wchar_t kWaitEventFormat[] = L"$1CrashServiceWaitEvent";
|
const wchar_t kWaitEventFormat[] = L"$1CrashServiceWaitEvent";
|
||||||
const wchar_t kPipeNameFormat[] = L"\\\\.\\pipe\\$1 Crash Service";
|
const wchar_t kPipeNameFormat[] = L"\\\\.\\pipe\\$1 Crash Service";
|
||||||
|
|
||||||
|
// Matches breakpad/src/client/windows/common/ipc_protocol.h.
|
||||||
|
const int kNameMaxLength = 64;
|
||||||
|
const int kValueMaxLength = 64;
|
||||||
|
|
||||||
typedef NTSTATUS (WINAPI* NtTerminateProcessPtr)(HANDLE ProcessHandle,
|
typedef NTSTATUS (WINAPI* NtTerminateProcessPtr)(HANDLE ProcessHandle,
|
||||||
NTSTATUS ExitStatus);
|
NTSTATUS ExitStatus);
|
||||||
char* g_real_terminate_process_stub = NULL;
|
char* g_real_terminate_process_stub = NULL;
|
||||||
|
@ -247,9 +251,18 @@ google_breakpad::CustomClientInfo* CrashReporterWin::GetCustomInfo(
|
||||||
|
|
||||||
for (StringMap::const_iterator iter = upload_parameters_.begin();
|
for (StringMap::const_iterator iter = upload_parameters_.begin();
|
||||||
iter != upload_parameters_.end(); ++iter) {
|
iter != upload_parameters_.end(); ++iter) {
|
||||||
custom_info_entries_.push_back(google_breakpad::CustomInfoEntry(
|
// breakpad has hardcoded the length of name/value, and doesn't truncate
|
||||||
base::UTF8ToWide(iter->first).c_str(),
|
// the values itself, so we have to truncate them here otherwise weird
|
||||||
base::UTF8ToWide(iter->second).c_str()));
|
// things may happen.
|
||||||
|
std::wstring name = base::UTF8ToWide(iter->first);
|
||||||
|
std::wstring value = base::UTF8ToWide(iter->second);
|
||||||
|
if (name.length() > kNameMaxLength - 1)
|
||||||
|
name.resize(kNameMaxLength - 1);
|
||||||
|
if (value.length() > kValueMaxLength - 1)
|
||||||
|
value.resize(kValueMaxLength - 1);
|
||||||
|
|
||||||
|
custom_info_entries_.push_back(
|
||||||
|
google_breakpad::CustomInfoEntry(name.c_str(), value.c_str()));
|
||||||
}
|
}
|
||||||
|
|
||||||
custom_info_.entries = &custom_info_entries_.front();
|
custom_info_.entries = &custom_info_entries_.front();
|
||||||
|
|
Loading…
Reference in a new issue