UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FGenericPlatformProcess Struct Reference

#include <GenericPlatformProcess.h>

+ Inheritance diagram for FGenericPlatformProcess:

Classes

struct  ApplicationSettingsContext
 
struct  FSemaphore
 

Public Types

enum class  EWaitAndForkResult : uint8 { Error , Parent , Child }
 

Static Public Member Functions

static CORE_API voidGetDllHandle (const TCHAR *Filename)
 
static CORE_API void FreeDllHandle (void *DllHandle)
 
static CORE_API voidGetDllExport (void *DllHandle, const TCHAR *ProcName)
 
static UE_FORCEINLINE_HINT void AddDllDirectory (const TCHAR *Directory)
 
static UE_FORCEINLINE_HINT void PushDllDirectory (const TCHAR *Directory)
 
static UE_FORCEINLINE_HINT void PopDllDirectory (const TCHAR *Directory)
 
static UE_FORCEINLINE_HINT void GetDllDirectories (TArray< FString > &OutDllDirectories)
 
static CORE_API uint32 GetCurrentProcessId ()
 
static CORE_API uint32 GetCurrentCoreNumber ()
 
static bool GetPerFrameProcessorUsage (uint32 ProcessId, float &ProcessUsageFraction, float &IdleUsageFraction)
 
static CORE_API void SetThreadAffinityMask (uint64 AffinityMask)
 
static CORE_API void SetThreadPriority (EThreadPriority NewPriority)
 
static void SetThreadName (const TCHAR *ThreadName)
 
static CORE_API uint32 GetStackSize ()
 
static void DumpThreadInfo (const TCHAR *MarkerName)
 
static void SetupGameThread ()
 
static void SetupRenderThread ()
 
static void SetupAudioThread ()
 
static void TeardownAudioThread ()
 
static CORE_API bool ShouldSaveToUserDir ()
 
static CORE_API const TCHARBaseDir ()
 
static CORE_API const TCHARUserDir ()
 
static CORE_API const TCHARUserSettingsDir ()
 
static CORE_API const TCHARUserTempDir ()
 
static CORE_API const TCHARUserHomeDir ()
 
static CORE_API const TCHARApplicationSettingsDir ()
 
static CORE_API FString GetApplicationSettingsDir (const ApplicationSettingsContext &Settings)
 
static CORE_API const TCHARComputerName ()
 
static CORE_API const TCHARUserName (bool bOnlyAlphaNumeric=true)
 
static CORE_API const TCHARShaderDir ()
 
static CORE_API void SetShaderDir (const TCHAR *Where)
 
static CORE_API void SetCurrentWorkingDirectoryToBaseDir ()
 
static CORE_API FString GetCurrentWorkingDirectory ()
 
static bool SetProcessLimits (EProcessResource::Type Resource, uint64 Limit)
 
static CORE_API const FString ShaderWorkingDir ()
 
static CORE_API void CleanShaderWorkingDir ()
 
static CORE_API const TCHARExecutablePath ()
 
static CORE_API const TCHARExecutableName (bool bRemoveExtension=true)
 
static CORE_API FString GenerateApplicationPath (const FString &AppName, EBuildConfiguration BuildConfiguration)
 
static CORE_API const TCHARGetArchitectureSuffix ()
 
static CORE_API const TCHARGetModulePrefix ()
 
static CORE_API const TCHARGetModuleExtension ()
 
static CORE_API const TCHARGetBinariesSubdirectory ()
 
static CORE_API const FString GetModulesDirectory ()
 
static CORE_API bool ModuleExists (const FString &Filename)
 
static CORE_API void LaunchURL (const TCHAR *URL, const TCHAR *Parms, FString *Error)
 
static CORE_API bool LaunchURLFiltered (const TCHAR *URL, const TCHAR *Parms, FString *Error, const UE::Core::FURLRequestFilter &Filter)
 
static CORE_API bool CanLaunchURL (const TCHAR *URL)
 
static CORE_API FString GetGameBundleId ()
 
static CORE_API FProcHandle CreateProc (const TCHAR *URL, const TCHAR *Parms, bool bLaunchDetached, bool bLaunchHidden, bool bLaunchReallyHidden, uint32 *OutProcessID, int32 PriorityModifier, const TCHAR *OptionalWorkingDirectory, void *PipeWriteChild, void *PipeReadChild=nullptr)
 
static CORE_API FProcHandle CreateProc (const TCHAR *URL, const TCHAR *Parms, bool bLaunchDetached, bool bLaunchHidden, bool bLaunchReallyHidden, uint32 *OutProcessID, int32 PriorityModifier, const TCHAR *OptionalWorkingDirectory, void *PipeWriteChild, void *PipeReadChild, void *PipeStdErrChild)
 
static CORE_API TTuple< FProcHandle, UE::HAL::EProcessIdCreateProc (const UE::HAL::FProcessStartInfo &StartInfo)
 
static CORE_API FProcHandle OpenProcess (uint32 ProcessID)
 
static CORE_API bool IsProcRunning (FProcHandle &ProcessHandle)
 
static CORE_API void WaitForProc (FProcHandle &ProcessHandle)
 
static CORE_API void CloseProc (FProcHandle &ProcessHandle)
 
static CORE_API void TerminateProc (FProcHandle &ProcessHandle, bool KillTree=false)
 
static CORE_API void TerminateProcTreeWithPredicate (FProcHandle &ProcessHandle, TFunctionRef< bool(uint32 ProcessId, const TCHAR *ApplicationName)> Predicate)
 
static CORE_API EWaitAndForkResult WaitAndFork ()
 
static CORE_API bool GetProcReturnCode (FProcHandle &ProcHandle, int32 *ReturnCode)
 
static CORE_API bool IsApplicationRunning (uint32 ProcessId)
 
static CORE_API bool IsApplicationRunning (const TCHAR *ProcName)
 
static CORE_API FString GetApplicationName (uint32 ProcessId)
 
static CORE_API bool GetApplicationMemoryUsage (uint32 ProcessId, SIZE_T *OutMemoryUsage)
 
static CORE_API bool ExecProcess (const TCHAR *URL, const TCHAR *Params, int32 *OutReturnCode, FString *OutStdOut, FString *OutStdErr, const TCHAR *OptionalWorkingDirectory=NULL, bool bShouldEndWithParentProcess=false)
 
static CORE_API bool ExecElevatedProcess (const TCHAR *URL, const TCHAR *Params, int32 *OutReturnCode)
 
static CORE_API bool LaunchFileInDefaultExternalApplication (const TCHAR *FileName, const TCHAR *Parms=NULL, ELaunchVerb::Type Verb=ELaunchVerb::Open, bool bPromptToOpenOnFailure=true)
 
static CORE_API void ExploreFolder (const TCHAR *FilePath)
 
static CORE_API void ConditionalSleep (TFunctionRef< bool()> Condition, float SleepTime=0.0f)
 
static CORE_API class FEventCreateSynchEvent (bool bIsManualReset=false)
 
static CORE_API class FEventGetSynchEventFromPool (bool bIsManualReset=false)
 
static CORE_API void FlushPoolSyncEvents ()
 
static CORE_API void ReturnSynchEventToPool (FEvent *Event)
 
static CORE_API class FRunnableThreadCreateRunnableThread ()
 
static CORE_API void ClosePipe (void *ReadPipe, void *WritePipe)
 
static CORE_API bool CreatePipe (void *&ReadPipe, void *&WritePipe, bool bWritePipeLocal=false)
 
static CORE_API FString ReadPipe (void *ReadPipe)
 
static CORE_API bool ReadPipeToArray (void *ReadPipe, TArray< uint8 > &Output)
 
static CORE_API bool WritePipe (void *WritePipe, const FString &Message, FString *OutWritten=nullptr)
 
static CORE_API bool WritePipe (void *WritePipe, const uint8 *Data, const int32 DataLength, int32 *OutDataLength=nullptr)
 
static CORE_API bool SupportsMultithreading ()
 
static CORE_API FSemaphoreNewInterprocessSynchObject (const FString &Name, bool bCreate, uint32 MaxLocks=1)
 
static CORE_API FSemaphoreNewInterprocessSynchObject (const TCHAR *Name, bool bCreate, uint32 MaxLocks=1)
 
static CORE_API bool DeleteInterprocessSynchObject (FSemaphore *Object)
 
static CORE_API bool Daemonize ()
 
static CORE_API bool IsFirstInstance ()
 
static CORE_API void CeaseBeingFirstInstance ()
 
static CORE_API void TearDown ()
 
static bool SkipWaitForStats ()
 
static bool TryGetMemoryUsage (FProcHandle &ProcessHandle, FPlatformProcessMemoryStats &OutStats)
 
static CORE_API ENamedThreads::Type GetDesiredThreadForUObjectReferenceCollector ()
 
static CORE_API void ModifyThreadAssignmentForUObjectReferenceCollector (int32 &NumThreads, int32 &NumBackgroundThreads, ENamedThreads::Type &NormalThreadName, ENamedThreads::Type &BackgroundThreadName)
 
static CORE_API TSharedPtr< IProcessSentinelCreateProcessSentinelObject ()
 
static CORE_API TSharedPtr< IProcessSentinelCreateProcessSentinel (const TCHAR *Name, const FString &Contents)
 
static void Yield ()
 
static void YieldCycles (uint64 Cycles)
 

Detailed Description

Generic implementation for most platforms, these tend to be unused and unimplemented

Member Enumeration Documentation

◆ EWaitAndForkResult

Enumerator
Error 
Parent 
Child 

Member Function Documentation

◆ AddDllDirectory()

static UE_FORCEINLINE_HINT void FGenericPlatformProcess::AddDllDirectory ( const TCHAR Directory)
inlinestatic

Adds a directory to search in when resolving implicitly loaded or filename-only DLLs.

◆ ApplicationSettingsDir()

const TCHAR * FGenericPlatformProcess::ApplicationSettingsDir ( )
static

Get application settings directory. NOTE: Only one return value is valid at a time!

◆ BaseDir()

static CORE_API const TCHAR * FGenericPlatformProcess::BaseDir ( )
static

Get startup directory. NOTE: Only one return value is valid at a time!

◆ CanLaunchURL()

bool FGenericPlatformProcess::CanLaunchURL ( const TCHAR URL)
static

Checks if the platform can launch a uniform resource locator (i.e. http://www.epicgames.com/unreal).

◆ CeaseBeingFirstInstance()

void FGenericPlatformProcess::CeaseBeingFirstInstance ( )
static

Stop reporting that we are the first instance

◆ CleanShaderWorkingDir()

void FGenericPlatformProcess::CleanShaderWorkingDir ( )
static

Clean the shader working directory.

Clean the shader working directory

◆ ClosePipe()

void FGenericPlatformProcess::ClosePipe ( void ReadPipe,
void WritePipe 
)
static

Closes an anonymous pipe.

Parameters
ReadPipeThe handle to the read end of the pipe.
WritePipeThe handle to the write end of the pipe.
See also
CreatePipe, ReadPipe

◆ CloseProc()

void FGenericPlatformProcess::CloseProc ( FProcHandle ProcessHandle)
static

Cleans up FProcHandle after we're done with it.

Parameters
ProcessHandlehandle returned from FPlatformProcess::CreateProc.

◆ ComputerName()

const TCHAR * FGenericPlatformProcess::ComputerName ( )
static

Get computer name. NOTE: Only one return value is valid at a time!

◆ ConditionalSleep()

void FGenericPlatformProcess::ConditionalSleep ( TFunctionRef< bool()>  Condition,
float  SleepTime = 0.0f 
)
static

Sleep thread until condition is satisfied.

Parameters
ConditionCondition to evaluate.
SleepTimeTime to sleep

◆ CreatePipe()

bool FGenericPlatformProcess::CreatePipe ( void *&  ReadPipe,
void *&  WritePipe,
bool  bWritePipeLocal = false 
)
static

Creates a writable anonymous pipe.

Anonymous pipes can be used to capture and/or redirect STDOUT and STDERROR of a process. The pipe created by this method can be passed into CreateProc as Write

Parameters
ReadPipeWill hold the handle to the read end of the pipe.
WritePipeWill hold the handle to the write end of the pipe. @parm bWritePipeLocal indicates that the write pipe end will be used locally, instead of the read pipe
Returns
true on success, false otherwise.
See also
ClosePipe, ReadPipe

◆ CreateProc() [1/3]

FProcHandle FGenericPlatformProcess::CreateProc ( const TCHAR URL,
const TCHAR Parms,
bool  bLaunchDetached,
bool  bLaunchHidden,
bool  bLaunchReallyHidden,
uint32 OutProcessID,
int32  PriorityModifier,
const TCHAR OptionalWorkingDirectory,
void PipeWriteChild,
void PipeReadChild,
void PipeStdErrChild 
)
static

Creates a new process and its primary thread, with separate std pipes. The new process runs the specified executable file in the security context of the calling process.

Parameters
URLexecutable name
Parmscommand line arguments
bLaunchDetachedif true, the new process will have its own window
bLaunchHiddenif true, the new process will be minimized in the task bar
bLaunchReallyHiddenif true, the new process will not have a window or be in the task bar
OutProcessIdif non-NULL, this will be filled in with the ProcessId
PriorityModifier-2 idle, -1 low, 0 normal, 1 high, 2 higher
OptionalWorkingDirectoryDirectory to start in when running the program, or NULL to use the current working directory
PipeWriteChildOptional HANDLE to pipe for redirecting stdout
PipeReadChildOptional HANDLE to pipe for redirecting stdin
PipeStdErrChildOptional HANDLE to pipe for redirecting stderr
Returns
The process handle for use in other process functions

◆ CreateProc() [2/3]

FProcHandle FGenericPlatformProcess::CreateProc ( const TCHAR URL,
const TCHAR Parms,
bool  bLaunchDetached,
bool  bLaunchHidden,
bool  bLaunchReallyHidden,
uint32 OutProcessID,
int32  PriorityModifier,
const TCHAR OptionalWorkingDirectory,
void PipeWriteChild,
void PipeReadChild = nullptr 
)
static

Creates a new process and its primary thread. The new process runs the specified executable file in the security context of the calling process.

Parameters
URLexecutable name
Parmscommand line arguments
bLaunchDetachedif true, the new process will have its own window
bLaunchHiddenif true, the new process will be minimized in the task bar
bLaunchReallyHiddenif true, the new process will not have a window or be in the task bar
OutProcessIdif non-NULL, this will be filled in with the ProcessId
PriorityModifier-2 idle, -1 low, 0 normal, 1 high, 2 higher
OptionalWorkingDirectoryDirectory to start in when running the program, or NULL to use the current working directory
PipeWriteChildOptional HANDLE to pipe for redirecting output
PipeReadChildOptional HANDLE to pipe for redirecting input
Returns
The process handle for use in other process functions

◆ CreateProc() [3/3]

TTuple< FProcHandle, UE::HAL::EProcessId > FGenericPlatformProcess::CreateProc ( const UE::HAL::FProcessStartInfo StartInfo)
static

Creates a new process using StartInfo. The new process runs the specified executable file in the security context of the calling process.

Parameters
StartInfoThe starting parameters
Returns
The process Handle and Id for use in other process functions

◆ CreateProcessSentinel()

TSharedPtr< IProcessSentinel > FGenericPlatformProcess::CreateProcessSentinel ( const TCHAR Name,
const FString &  Contents 
)
static

Create a GenericProcessSentinel, or a subclass, object, and then uses it to create the actual sentinel file on disk

◆ CreateProcessSentinelObject()

TSharedPtr< IProcessSentinel > FGenericPlatformProcess::CreateProcessSentinelObject ( )
static

Create a GenericProcessSentinel, or a subclass, object

◆ CreateRunnableThread()

FRunnableThread * FGenericPlatformProcess::CreateRunnableThread ( )
static

Creates the platform-specific runnable thread. This should only be called from FRunnableThread::Create.

Returns
The newly created thread

◆ CreateSynchEvent()

FEvent * FGenericPlatformProcess::CreateSynchEvent ( bool  bIsManualReset = false)
static

Creates a new event.

Parameters
bIsManualResetWhether the event requires manual reseting or not.
Returns
A new event, or nullptr none could be created.
See also
GetSynchEventFromPool, ReturnSynchEventToPool

◆ Daemonize()

bool FGenericPlatformProcess::Daemonize ( )
static

Makes process run as a system service (daemon), i.e. detaches it from whatever user session it was initially run from.

Returns
true if successful, false otherwise.

◆ DeleteInterprocessSynchObject()

bool FGenericPlatformProcess::DeleteInterprocessSynchObject ( FSemaphore Object)
static

Deletes an interprocess synchronization object.

Parameters
Objectobject to destroy.

◆ DumpThreadInfo()

static void FGenericPlatformProcess::DumpThreadInfo ( const TCHAR MarkerName)
inlinestatic

Output information about the currently active thread

◆ ExecElevatedProcess()

bool FGenericPlatformProcess::ExecElevatedProcess ( const TCHAR URL,
const TCHAR Params,
int32 OutReturnCode 
)
static

Executes a process as administrator, requesting elevation as necessary. This call blocks until the process has returned.

◆ ExecProcess()

bool FGenericPlatformProcess::ExecProcess ( const TCHAR URL,
const TCHAR Params,
int32 OutReturnCode,
FString *  OutStdOut,
FString *  OutStdErr,
const TCHAR OptionalWorkingDirectory = NULL,
bool  bShouldEndWithParentProcess = false 
)
static

Executes a process, returning the return code, stdout, and stderr. This call blocks until the process has returned.

Parameters
OutReturnCodemay be 0
OutStdOutmay be 0
OutStdErrmay be 0 @OptionalWorkingDirectory may be 0 @OptionalbShouldEndWithParentProcess false by default. True to make sure the process is killed with the parent processor (Not Supported on all Platforms)

◆ ExecutableName()

const TCHAR * FGenericPlatformProcess::ExecutableName ( bool  bRemoveExtension = true)
static

Return the name of the currently running executable

Parameters
bRemoveExtensiontrue to remove the extension of the executable name, false to leave it intact
Returns
Name of the currently running executable

◆ ExecutablePath()

const TCHAR * FGenericPlatformProcess::ExecutablePath ( )
static

Return the path to the currently running executable

Returns
Path of the currently running executable

◆ ExploreFolder()

void FGenericPlatformProcess::ExploreFolder ( const TCHAR FilePath)
static

Attempt to "explore" the folder specified by the provided file path

Parameters
FilePathFile path specifying a folder to explore

◆ FlushPoolSyncEvents()

void FGenericPlatformProcess::FlushPoolSyncEvents ( )
static

Deletes all the recycled sync events contained by the pools

◆ FreeDllHandle()

void FGenericPlatformProcess::FreeDllHandle ( void DllHandle)
static

Free a DLL.

◆ GenerateApplicationPath()

FString FGenericPlatformProcess::GenerateApplicationPath ( const FString &  AppName,
EBuildConfiguration  BuildConfiguration 
)
static

Generates the path to the specified application or game.

The application must reside in the Engine's binaries directory. The returned path is relative to this executable's directory.For example, calling this method with "UE4" and EBuildConfiguration::Debug on Windows 64-bit will generate the path "../Win64/UnrealEditor-Win64-Debug.exe"

Parameters
AppNameThe name of the application or game.
BuildConfigurationThe build configuration of the game.
Returns
The generated application path.

◆ GetApplicationMemoryUsage()

bool FGenericPlatformProcess::GetApplicationMemoryUsage ( uint32  ProcessId,
SIZE_T OutMemoryUsage 
)
static

Outputs the virtual memory usage, of the process with the specified PID

◆ GetApplicationName()

FString FGenericPlatformProcess::GetApplicationName ( uint32  ProcessId)
static

Returns the Name of process given by the PID. Returns Empty string "" if PID not found.

◆ GetApplicationSettingsDir()

FString FGenericPlatformProcess::GetApplicationSettingsDir ( const ApplicationSettingsContext Settings)
static

Get application settings directory for a given context.

Parameters
SettingsThe context in which the application settings should be stored for.
Returns
A string to the appropriate directory.

◆ GetArchitectureSuffix()

const TCHAR * FGenericPlatformProcess::GetArchitectureSuffix ( )
static

Get the architecture suffix, if any

Relates to UnrealArchitectureConfig.RequiresArchitectureFilenames in UnrealBuildTool

Returns
The platform's architecture suffix, or null if it isn't required

◆ GetBinariesSubdirectory()

const TCHAR * FGenericPlatformProcess::GetBinariesSubdirectory ( )
static

Used only by platforms with DLLs, this gives the subdirectory from binaries to find the executables

◆ GetCurrentCoreNumber()

uint32 FGenericPlatformProcess::GetCurrentCoreNumber ( )
static

Retrieves the current hardware CPU core

Returns
the current hardware core.

◆ GetCurrentProcessId()

uint32 FGenericPlatformProcess::GetCurrentProcessId ( )
static

Retrieves the ProcessId of this process.

Returns
the ProcessId of this process.

◆ GetCurrentWorkingDirectory()

FString FGenericPlatformProcess::GetCurrentWorkingDirectory ( )
static

Get the current working directory (only really makes sense on desktop platforms)

◆ GetDesiredThreadForUObjectReferenceCollector()

ENamedThreads::Type FGenericPlatformProcess::GetDesiredThreadForUObjectReferenceCollector ( )
static

specifies the thread to use for UObject reference collection

◆ GetDllDirectories()

static UE_FORCEINLINE_HINT void FGenericPlatformProcess::GetDllDirectories ( TArray< FString > &  OutDllDirectories)
inlinestatic

Get the list of registered directories to search in when resolving implicitly loaded or filename-only DLLs.

◆ GetDllExport()

void * FGenericPlatformProcess::GetDllExport ( void DllHandle,
const TCHAR ProcName 
)
static

Lookup the address of a DLL function.

◆ GetDllHandle()

void * FGenericPlatformProcess::GetDllHandle ( const TCHAR Filename)
static

Load a DLL.

◆ GetGameBundleId()

FString FGenericPlatformProcess::GetGameBundleId ( )
static

Retrieves the platform-specific bundle identifier or package name of the game

Returns
The game's bundle identifier or package name.

◆ GetModuleExtension()

const TCHAR * FGenericPlatformProcess::GetModuleExtension ( )
static

Return the extension of dynamic library

Returns
Extension of dynamic library.
See also
GetModulePrefix, GetModulesDirectory

◆ GetModulePrefix()

const TCHAR * FGenericPlatformProcess::GetModulePrefix ( )
static

Return the prefix of dynamic library (e.g. lib)

Returns
The prefix string.
See also
GetModuleExtension, GetModulesDirectory

◆ GetModulesDirectory()

const FString FGenericPlatformProcess::GetModulesDirectory ( )
static

Used only by platforms with DLLs, this gives the full path to the main directory containing modules

Returns
The path to the directory.
See also
GetModulePrefix, GetModuleExtension

◆ GetPerFrameProcessorUsage()

static bool FGenericPlatformProcess::GetPerFrameProcessorUsage ( uint32  ProcessId,
float ProcessUsageFraction,
float IdleUsageFraction 
)
inlinestatic

Retrieves the current CPU Utilization for the current process in terms of percentage of all capacity

Returns
the current hardware core.

◆ GetProcReturnCode()

bool FGenericPlatformProcess::GetProcReturnCode ( FProcHandle ProcHandle,
int32 ReturnCode 
)
static

Retrieves the termination status of the specified process.

◆ GetStackSize()

uint32 FGenericPlatformProcess::GetStackSize ( )
static

Get the active stack size for the currently running thread

◆ GetSynchEventFromPool()

FEvent * FGenericPlatformProcess::GetSynchEventFromPool ( bool  bIsManualReset = false)
static

Gets an event from the pool or creates a new one if necessary.

Parameters
bIsManualResetWhether the event requires manual reseting or not.
Returns
An event, or nullptr none could be created.
See also
CreateSynchEvent, ReturnSynchEventToPool

◆ IsApplicationRunning() [1/2]

bool FGenericPlatformProcess::IsApplicationRunning ( const TCHAR ProcName)
static

Returns true if the specified application is running

◆ IsApplicationRunning() [2/2]

bool FGenericPlatformProcess::IsApplicationRunning ( uint32  ProcessId)
static

Returns true if the specified application is running

◆ IsFirstInstance()

bool FGenericPlatformProcess::IsFirstInstance ( )
static

Checks if we're the first instance. An instance can become first if the previous first instance quits before it.

◆ IsProcRunning()

bool FGenericPlatformProcess::IsProcRunning ( FProcHandle ProcessHandle)
static

Returns true if the specified process is running

Parameters
ProcessHandlehandle returned from FPlatformProcess::CreateProc
Returns
true if the process is still running

◆ LaunchFileInDefaultExternalApplication()

bool FGenericPlatformProcess::LaunchFileInDefaultExternalApplication ( const TCHAR FileName,
const TCHAR Parms = NULL,
ELaunchVerb::Type  Verb = ELaunchVerb::Open,
bool  bPromptToOpenOnFailure = true 
)
static

Attempt to launch the provided file name in its default external application. Similar to FPlatformProcess::LaunchURL, with the exception that if a default application isn't found for the file, the user will be prompted with an "Open With..." dialog.

Parameters
FileNameName of the file to attempt to launch in its default external application
ParmsOptional parameters to the default application
VerbOptional verb to use when opening the file, if it applies for the platform.
Returns
true if the file is launched successfully, false otherwise.

◆ LaunchURL()

void FGenericPlatformProcess::LaunchURL ( const TCHAR URL,
const TCHAR Parms,
FString *  Error 
)
static

Launch a uniform resource locator (i.e. http://www.epicgames.com/unreal). This is expected to return immediately as the URL is launched by another task. The URL param must already be a valid URL. If you're looking for code to properly escape a URL fragment, use FGenericPlatformHttp::UrlEncode.

◆ LaunchURLFiltered()

bool FGenericPlatformProcess::LaunchURLFiltered ( const TCHAR URL,
const TCHAR Parms,
FString *  Error,
const UE::Core::FURLRequestFilter Filter 
)
static

Launch a uniform resource locator (i.e. http://www.epicgames.com/unreal). This is expected to return immediately as the URL is launched by another task. The URL param must already be a valid URL. The URL is passed through the filter parameter for an added measure of security if the URL is from and untrusted source. If you're looking for code to properly escape a URL fragment, use FGenericPlatformHttp::UrlEncode.

Returns
true if URL passed the filter and was launched, false if it was rejected by the filter.

◆ ModifyThreadAssignmentForUObjectReferenceCollector()

void FGenericPlatformProcess::ModifyThreadAssignmentForUObjectReferenceCollector ( int32 NumThreads,
int32 NumBackgroundThreads,
ENamedThreads::Type NormalThreadName,
ENamedThreads::Type BackgroundThreadName 
)
static

allows a platform to override the threading configuration for reference collection

◆ ModuleExists()

bool FGenericPlatformProcess::ModuleExists ( const FString &  Filename)
static

Used only by platforms with DLLs, this confirms the existence of a given module. This should be called with the proper extension for modules. Returning true should ensure that GetDllHandle() will find the same file.

◆ NewInterprocessSynchObject() [1/2]

FGenericPlatformProcess::FSemaphore * FGenericPlatformProcess::NewInterprocessSynchObject ( const FString &  Name,
bool  bCreate,
uint32  MaxLocks = 1 
)
static

Creates or opens an interprocess synchronization object.

Parameters
Namename (so we can use it across processes).
bCreateIf true, the function will try to create, otherwise will try to open existing.
MaxLocksMaximum amount of locks that the semaphore can have (pass 1 to make it act as mutex).
Returns
Pointer to heap allocated semaphore object. Caller is responsible for deletion.

◆ NewInterprocessSynchObject() [2/2]

FGenericPlatformProcess::FSemaphore * FGenericPlatformProcess::NewInterprocessSynchObject ( const TCHAR Name,
bool  bCreate,
uint32  MaxLocks = 1 
)
static

Creates or opens an interprocess synchronization object.

Parameters
Namename (so we can use it across processes).
bCreateIf true, the function will try to create, otherwise will try to open existing.
MaxLocksMaximum amount of locks that the semaphore can have (pass 1 to make it act as mutex).
Returns
Pointer to heap allocated semaphore object. Caller is responsible for deletion.

◆ OpenProcess()

FProcHandle FGenericPlatformProcess::OpenProcess ( uint32  ProcessID)
static

Opens an existing process.

Parameters
ProcessIDThe process id of the process for which we want to obtain a handle.
Returns
The process handle for use in other process functions

◆ PopDllDirectory()

static UE_FORCEINLINE_HINT void FGenericPlatformProcess::PopDllDirectory ( const TCHAR Directory)
inlinestatic

Unsets a directory to look for DLL files. The same directory must be passed in as the Push call to validate

◆ PushDllDirectory()

static UE_FORCEINLINE_HINT void FGenericPlatformProcess::PushDllDirectory ( const TCHAR Directory)
inlinestatic

Set a directory to look for DLL files. NEEDS to have a Pop call when complete

◆ ReadPipe()

FString FGenericPlatformProcess::ReadPipe ( void ReadPipe)
static

Reads all pending data from an anonymous pipe, such as STDOUT or STDERROR of a process.

Parameters
PipeThe handle to the pipe to read from.
Returns
A string containing the read data.
See also
ClosePipe, CreatePipe

◆ ReadPipeToArray()

bool FGenericPlatformProcess::ReadPipeToArray ( void ReadPipe,
TArray< uint8 > &  Output 
)
static

Reads all pending data from an anonymous pipe, such as STDOUT or STDERROR of a process.

Parameters
PipeThe handle to the pipe to read from.
OutputThe data read.
Returns
true if successful (i.e. any data was read)
See also
ClosePipe, CreatePipe

◆ ReturnSynchEventToPool()

void FGenericPlatformProcess::ReturnSynchEventToPool ( FEvent Event)
static

Returns an event to the pool.

Parameters
EventThe event to return.
See also
CreateSynchEvent, GetSynchEventFromPool

◆ SetCurrentWorkingDirectoryToBaseDir()

void FGenericPlatformProcess::SetCurrentWorkingDirectoryToBaseDir ( )
static

◆ SetProcessLimits()

static bool FGenericPlatformProcess::SetProcessLimits ( EProcessResource::Type  Resource,
uint64  Limit 
)
inlinestatic

Sets the process limits.

Parameters
Resourceone of process resources.
Limitthe maximum amount of the resource (for some OS, this means both hard and soft limits).
Returns
true on success, false otherwise.

◆ SetShaderDir()

void FGenericPlatformProcess::SetShaderDir ( const TCHAR Where)
static

◆ SetThreadAffinityMask()

void FGenericPlatformProcess::SetThreadAffinityMask ( uint64  AffinityMask)
static

Change the thread processor affinity

Parameters
AffinityMaskA bitfield indicating what processors the thread is allowed to run on.

◆ SetThreadName()

static void FGenericPlatformProcess::SetThreadName ( const TCHAR ThreadName)
inlinestatic

Helper function to set thread name of the current thread.

Parameters
ThreadNameName to set

◆ SetThreadPriority()

void FGenericPlatformProcess::SetThreadPriority ( EThreadPriority  NewPriority)
static

Change the thread processor priority

Parameters
NewPriorityan EThreadPriority indicating what priority the thread is to run at.

◆ SetupAudioThread()

static void FGenericPlatformProcess::SetupAudioThread ( )
inlinestatic

Allow the platform to do anything it needs for audio thread

◆ SetupGameThread()

static void FGenericPlatformProcess::SetupGameThread ( )
inlinestatic

Allow the platform to do anything it needs for game thread

◆ SetupRenderThread()

static void FGenericPlatformProcess::SetupRenderThread ( )
inlinestatic

Allow the platform to do anything it needs for render thread

◆ ShaderDir()

const TCHAR * FGenericPlatformProcess::ShaderDir ( )
static

◆ ShaderWorkingDir()

const FString FGenericPlatformProcess::ShaderWorkingDir ( )
static

Get the shader working directory.

Returns
The path to the directory.

Get the shader working directory

◆ ShouldSaveToUserDir()

bool FGenericPlatformProcess::ShouldSaveToUserDir ( )
static

Content saved to the game or engine directories should be rerouted to user directories instead

◆ SkipWaitForStats()

static bool FGenericPlatformProcess::SkipWaitForStats ( )
inlinestatic

force skip calling FThreadStats::WaitForStats()

◆ SupportsMultithreading()

bool FGenericPlatformProcess::SupportsMultithreading ( )
static

Gets whether this platform can use multiple threads.

Returns
true if the platform can use multiple threads, false otherwise.

◆ TearDown()

void FGenericPlatformProcess::TearDown ( )
static

Tears down allocated process resources.

◆ TeardownAudioThread()

static void FGenericPlatformProcess::TeardownAudioThread ( )
inlinestatic

Allow the platform to tear down the audio thread

◆ TerminateProc()

void FGenericPlatformProcess::TerminateProc ( FProcHandle ProcessHandle,
bool  KillTree = false 
)
static

Terminates a process

Parameters
ProcessHandlehandle returned from FPlatformProcess::CreateProc
KillTreeWhether the entire process tree should be terminated.

◆ TerminateProcTreeWithPredicate()

void FGenericPlatformProcess::TerminateProcTreeWithPredicate ( FProcHandle ProcessHandle,
TFunctionRef< bool(uint32 ProcessId, const TCHAR *ApplicationName)>  Predicate 
)
static

Terminates a process tree

Parameters
ProcessHandlehandle returned from FPlatformProcess::CreateProc
Predicatethat returns true if the process identified by ProcessId and ApplicationName should be terminated with its children, else that process and its children will be kept alive

◆ TryGetMemoryUsage()

static bool FGenericPlatformProcess::TryGetMemoryUsage ( FProcHandle ProcessHandle,
FPlatformProcessMemoryStats OutStats 
)
inlinestatic

Queries the memory usage of the process. Returns whether the operation is supported and succeeded.

◆ UserDir()

const TCHAR * FGenericPlatformProcess::UserDir ( )
static

Get user directory. NOTE: Only one return value is valid at a time!

◆ UserHomeDir()

const TCHAR * FGenericPlatformProcess::UserHomeDir ( )
static

Get the user home directory. NOTE: Only one return value is valid at a time!

◆ UserName()

const TCHAR * FGenericPlatformProcess::UserName ( bool  bOnlyAlphaNumeric = true)
static

Get user name. NOTE: Only one return value is valid at a time!

◆ UserSettingsDir()

const TCHAR * FGenericPlatformProcess::UserSettingsDir ( )
static

Get the user settings directory. NOTE: Only one return value is valid at a time!

◆ UserTempDir()

const TCHAR * FGenericPlatformProcess::UserTempDir ( )
static

Get the user temporary directory. NOTE: Only one return value is valid at a time!

◆ WaitAndFork()

FGenericPlatformProcess::EWaitAndForkResult FGenericPlatformProcess::WaitAndFork ( )
static

Waits for process signals and forks child processes.

WaitAndFork stalls the invoking process and forks child processes when signals are sent to it from an external source. Forked child processes will provide a return value of EWaitAndForkResult::Child, while the parent process will not return until IsEngineExitRequested() is true (EWaitAndForkResult::Parent) or there was an error (EWaitAndForkResult::Error) The signal the parent process expects is platform-specific (i.e. SIGRTMIN+1 on Linux).

◆ WaitForProc()

void FGenericPlatformProcess::WaitForProc ( FProcHandle ProcessHandle)
static

Waits for a process to stop

Parameters
ProcessHandlehandle returned from FPlatformProcess::CreateProc

◆ WritePipe() [1/2]

bool FGenericPlatformProcess::WritePipe ( void WritePipe,
const FString &  Message,
FString *  OutWritten = nullptr 
)
static

Sends the message to process through pipe

Parameters
WritePipePipe for writing.
MessageThe message to be written.
OutWrittenOptional parameter to know how much of the string written.
Returns
True if all bytes written successfully.
See also
CreatePipe, ClosePipe, ReadPipe

◆ WritePipe() [2/2]

bool FGenericPlatformProcess::WritePipe ( void WritePipe,
const uint8 Data,
const int32  DataLength,
int32 OutDataLength = nullptr 
)
static

Sends data to process through pipe

Parameters
WritePipePipe for writing.
DataThe data to be written.
DataLengthhow many bytes to write.
OutDataLengthOptional parameter to know how many bytes had been written.
Returns
True if all bytes written successfully.
See also
CreatePipe, ClosePipe, ReadPipe

◆ Yield()

static void FGenericPlatformProcess::Yield ( )
inlinestatic

Tells the processor to pause for implementation-specific amount of time. Is used for spin-loops to improve the speed at which the code detects the release of the lock and power-consumption.

◆ YieldCycles()

static void FGenericPlatformProcess::YieldCycles ( uint64  Cycles)
inlinestatic

Tells the processor to pause for at least the amount of cycles given. Is used for spin-loops to improve the speed at which the code detects the release of the lock and power-consumption.


The documentation for this struct was generated from the following files: