You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#rb trivial #rnx #jira none #ROBOMERGE-SOURCE: CL 12762568 in //UE4/Release-4.25/... via CL 12762575 via CL 12784299 #ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v681-12776863) [CL 12786526 by patrick laflamme in Main branch]
48 lines
1.4 KiB
C++
48 lines
1.4 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "CrashReportClientApp.h"
|
|
#include "Windows/WindowsHWrapper.h"
|
|
|
|
#if defined(CRASH_REPORT_WITH_MTBF)
|
|
#include "EditorAnalyticsSession.h"
|
|
#endif
|
|
|
|
/**
|
|
* WinMain, called when the application is started
|
|
*/
|
|
int WINAPI WinMain(_In_ HINSTANCE hInInstance, _In_opt_ HINSTANCE hPrevInstance, _In_ LPSTR, _In_ int nCmdShow)
|
|
{
|
|
hInstance = hInInstance;
|
|
|
|
#if defined(CRASH_REPORT_WITH_MTBF) && !PLATFORM_SEH_EXCEPTIONS_DISABLED
|
|
// Try to record if CrashReportClientEditor is crashing. Analytics shows that good number of Editor exit code are reported delayed, hinting
|
|
// that CRCEditor was not running anymore. Try figuring out if it crashed. Suspecting that the Editor crash reporter/handler code is crashing could also
|
|
// inadvertedly cause a crash in CRCEditor.
|
|
__try
|
|
{
|
|
RunCrashReportClient(GetCommandLineW());
|
|
}
|
|
__except(EXCEPTION_EXECUTE_HANDLER)
|
|
{
|
|
uint64 MonitoredEditorPid;
|
|
if (FParse::Value(GetCommandLineW(), TEXT("-MONITOR="), MonitoredEditorPid))
|
|
{
|
|
FTimespan Timeout = FTimespan::FromSeconds(5);
|
|
if (FEditorAnalyticsSession::Lock(Timeout))
|
|
{
|
|
FEditorAnalyticsSession MonitoredSession;
|
|
if (FEditorAnalyticsSession::FindSession(MonitoredEditorPid, MonitoredSession))
|
|
{
|
|
MonitoredSession.SaveMonitorExceptCode(GetExceptionCode());
|
|
}
|
|
FEditorAnalyticsSession::Unlock();
|
|
}
|
|
}
|
|
}
|
|
#else
|
|
RunCrashReportClient(GetCommandLineW());
|
|
#endif
|
|
|
|
return 0;
|
|
}
|