Files
UnrealEngineUWP/Engine/Source/Programs/UnrealFrontend/Private/Windows/WindowsUnrealFrontendMain.cpp
Ryan Durand 74c879d5f3 Updating copyrights for Engine Programs.
#rnx
#rb none
#jira none

#ROBOMERGE-OWNER: ryan.durand
#ROBOMERGE-AUTHOR: ryan.durand
#ROBOMERGE-SOURCE: CL 10869242 in //Fortnite/Release-12.00/... via CL 10869536
#ROBOMERGE-BOT: FORTNITE (Main -> Dev-EngineMerge) (v613-10869866)

[CL 10870960 by Ryan Durand in Main branch]
2019-12-26 23:06:02 -05:00

68 lines
1.6 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "CoreMinimal.h"
#include "UnrealFrontendMain.h"
#include "HAL/ExceptionHandling.h"
#include "LaunchEngineLoop.h"
#include "Windows/WindowsHWrapper.h"
#include "Misc/CommandLine.h"
#include "Misc/OutputDeviceError.h"
/**
* The main application entry point for Windows platforms.
*
* @param hInInstance Handle to the current instance of the application.
* @param hPrevInstance Handle to the previous instance of the application (always NULL).
* @param lpCmdLine Command line for the application.
* @param nShowCmd Specifies how the window is to be shown.
* @return Application's exit value.
*/
int32 WINAPI WinMain( HINSTANCE hInInstance, HINSTANCE hPrevInstance, char* lpCmdLine, int32 nShowCmd )
{
hInstance = hInInstance;
const TCHAR* CmdLine = ::GetCommandLineW();
CmdLine = FCommandLine::RemoveExeName(CmdLine);
#if !UE_BUILD_SHIPPING
if (FParse::Param(CmdLine, TEXT("crashreports")))
{
GAlwaysReportCrash = true;
}
#endif
int32 ErrorLevel = 0;
#if UE_BUILD_DEBUG
if (!GAlwaysReportCrash)
#else
if (FPlatformMisc::IsDebuggerPresent() && !GAlwaysReportCrash)
#endif
{
ErrorLevel = UnrealFrontendMain(CmdLine);
}
else
{
#if !PLATFORM_SEH_EXCEPTIONS_DISABLED
__try
#endif
{
GIsGuarded = 1;
ErrorLevel = UnrealFrontendMain(CmdLine);
GIsGuarded = 0;
}
#if !PLATFORM_SEH_EXCEPTIONS_DISABLED
__except (ReportCrash(GetExceptionInformation()))
{
ErrorLevel = 1;
GError->HandleError();
FPlatformMisc::RequestExit(true);
}
#endif
}
FEngineLoop::AppExit();
return ErrorLevel;
}