Files
o3de/Gems/CrashReporting/Code/Platform/Windows/GameCrashUploader_windows.cpp
T
Steve Pham b4a2edec6a Final update copyright headers to reference license files at the repo root (#1693)
* Final update copyright headers to reference license files at the repo root

Signed-off-by: spham <spham@amazon.com>

* Fix copyright validator unit tests to support the stale O3DE header scenario

Signed-off-by: spham <spham@amazon.com>
2021-06-30 19:51:55 -07:00

55 lines
1.7 KiB
C++

/*
* Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#include <AzCore/PlatformIncl.h>
#include <CrashReporting/GameCrashUploader.h>
#include <CrashSupport.h>
#include <stdlib.h>
#include <locale>
#include <codecvt>
#pragma warning(disable : 4996)
namespace O3de
{
bool GameCrashUploader::CheckConfirmation(const crashpad::CrashReportDatabase::Report& report)
{
if (!m_noConfirmation)
{
const char* noConfirmation = getenv("LY_NO_CONFIRM");
if (noConfirmation == nullptr)
{
std::wstring sendDialogMessage;
std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> converter;
sendDialogMessage = converter.from_bytes(m_executableName);
sendDialogMessage += L" has encountered a fatal error. We're sorry for the inconvenience.\n\nA crash debugging file has been created at:\n";
sendDialogMessage += report.file_path.value();
sendDialogMessage += L"\n\nIf you are willing to submit this file to Amazon it will help us improve the Lumberyard experience. We will treat this report as confidential.\n\nWould you like to send the error report?";
int msgboxID = MessageBoxW(
NULL,
sendDialogMessage.data(),
L"Send Error Report",
(MB_ICONEXCLAMATION | MB_YESNO | MB_SYSTEMMODAL)
);
if (msgboxID == IDNO)
{
return false;
}
}
}
return true;
}
}