UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
LaunchWindows.cpp File Reference
#include "CoreMinimal.h"
#include "Misc/App.h"
#include "Misc/OutputDeviceError.h"
#include "Sanitizer/RaceDetector.h"
#include "LaunchEngineLoop.h"
#include "HAL/ExceptionHandling.h"
#include "HAL/PlatformMallocCrash.h"
#include "Windows/WindowsHWrapper.h"
#include <shellapi.h>

Macros

#define D3D12_CORE_ENABLED   0
 

Functions

 DEFINE_LOG_CATEGORY_STATIC (LogLaunchWindows, Log, All)
 
int32 GuardedMain (const TCHAR *CmdLine)
 
void LaunchStaticShutdownAfterError ()
 
 _declspec (dllexport) uint32 NvOptimusEnablement=0x00000001
 
void InvalidParameterHandler (const TCHAR *Expression, const TCHAR *Function, const TCHAR *File, uint32 Line, uintptr_t Reserved)
 
void SetupWindowsEnvironment (void)
 
LAUNCH_API int32 GuardedMainWrapper (const TCHAR *CmdLine)
 
bool ProcessCommandLine ()
 
LAUNCH_API int32 LaunchWindowsStartup (HINSTANCE hInInstance, HINSTANCE hPrevInstance, char *, int32 nCmdShow, const TCHAR *CmdLine)
 
LAUNCH_API void LaunchWindowsShutdown ()
 
int32 WINAPI WinMain (_In_ HINSTANCE hInInstance, _In_opt_ HINSTANCE hPrevInstance, _In_ char *pCmdLine, _In_ int32 nCmdShow)
 

Variables

bool GShouldPauseBeforeExit
 
bool GEnableInnerException = false
 

Macro Definition Documentation

◆ D3D12_CORE_ENABLED

#define D3D12_CORE_ENABLED   0

Function Documentation

◆ _declspec()

_declspec ( dllexport  )
pure virtual

◆ DEFINE_LOG_CATEGORY_STATIC()

DEFINE_LOG_CATEGORY_STATIC ( LogLaunchWindows  ,
Log  ,
All   
)

◆ GuardedMain()

int32 GuardedMain ( const TCHAR CmdLine)
extern

◆ GuardedMainWrapper()

LAUNCH_API int32 GuardedMainWrapper ( const TCHAR CmdLine)

The inner exception handler catches crashes/asserts in native C++ code and is the only way to get the correct callstack when running a 64-bit executable. However, XAudio2 doesn't like this and it may result in no sound.

◆ InvalidParameterHandler()

void InvalidParameterHandler ( const TCHAR Expression,
const TCHAR Function,
const TCHAR File,
uint32  Line,
uintptr_t  Reserved 
)

Handler for CRT parameter validation. Triggers error

Parameters
Expression- the expression that failed crt validation
Function- function which failed crt validation
File- file where failure occured
Line- line number of failure
Reserved- not used

◆ LaunchStaticShutdownAfterError()

void LaunchStaticShutdownAfterError ( )
extern

◆ LaunchWindowsShutdown()

LAUNCH_API void LaunchWindowsShutdown ( )

◆ LaunchWindowsStartup()

LAUNCH_API int32 LaunchWindowsStartup ( HINSTANCE  hInInstance,
HINSTANCE  hPrevInstance,
char ,
int32  nCmdShow,
const TCHAR CmdLine 
)

◆ ProcessCommandLine()

bool ProcessCommandLine ( )

◆ SetupWindowsEnvironment()

void SetupWindowsEnvironment ( void  )

Setup the common debug settings

◆ WinMain()

int32 WINAPI WinMain ( _In_ HINSTANCE  hInInstance,
_In_opt_ HINSTANCE  hPrevInstance,
_In_ char pCmdLine,
_In_ int32  nCmdShow 
)

Variable Documentation

◆ GEnableInnerException

bool GEnableInnerException = false

The inner exception handler catches crashes/asserts in native C++ code and is the only way to get the correct callstack when running a 64-bit executable. However, XAudio2 doesn't always like this and it may result in no sound.

◆ GShouldPauseBeforeExit

bool GShouldPauseBeforeExit

Whether we should pause before exiting. used by UCC