FGenericPlatformProcess

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

Windows
MacOS
Linux

Inheritance Hierarchy

FGenericPlatformProcess

FHoloLensProcess

FUnixPlatformProcess

References

Module

Core

Header

/Engine/Source/Runtime/Core/Public/GenericPlatform/GenericPlatformProcess.h

Include

#include "GenericPlatform/GenericPlatformProcess.h"

Syntax

struct FGenericPlatformProcess

Remarks

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

Functions

Name Description

Public function Static

void

 

AddDllDirectory

(
    const TCHAR* Directory
)

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

Public function Static

const TCHAR ...

 

ApplicationSettingsDir()

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

Public function Static

const TCHAR ...

 

BaseDir()

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

Public function Static

bool

 

CanLaunchURL

(
    const TCHAR* URL
)

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

Public function Static

void

 

CleanShaderWorkingDir()

Clean the shader working directory.

Clean the shader working directory

Public function Static

void

 

ClosePipe

(
    void* ReadPipe,
    void* WritePipe
)

Closes an anonymous pipe.

Public function Static

void

 

CloseProc

(
    FProcHandle& ProcessHandle
)

Cleans up FProcHandle after we're done with it.

Public function Static

const TCHAR ...

 

ComputerName()

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

Public function Static

void

 

ConditionalSleep

(
    TFunctionRef< bool()> Condition,
    float SleepTime
)

Sleep thread until condition is satisfied.

Public function Static

bool

 

CreatePipe

(
    void*& ReadPipe,
    void*& WritePipe
)

Creates a writable anonymous pipe.

Public function Static

FProcHandle

 

CreateProc

(
    const TCHAR* URL,
    const TCHAR* Parms,
    bool bLaunchDetached,
    bool bLaunchHidden,
    bool bLaunchReallyHidden,
    uint32* OutProcessID,
    int32 PriorityModifier,
    const TCHAR* OptionalWorkingDi...,
    void* PipeWriteChild,
    void* PipeReadChild
)

Creates a new process and its primary thread.

Public function Static

FRunnableThr...

 

CreateRunnableThread()

Creates the platform-specific runnable thread.

Public function Static

bool

 

Daemonize()

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

Public function Static

bool

 

DeleteInterprocessSynchObject

(
    FSemaphore* Object
)

Deletes an interprocess synchronization object.

Public function Static

bool

 

ExecElevatedProcess

(
    const TCHAR* URL,
    const TCHAR* Params,
    int32* OutReturnCode
)

Executes a process as administrator, requesting elevation as necessary.

Public function Static

bool

 

ExecProcess

(
    const TCHAR* URL,
    const TCHAR* Params,
    int32* OutReturnCode,
    FString* OutStdOut,
    FString* OutStdErr,
    const TCHAR* OptionalWorkingDi...
)

Executes a process, returning the return code, stdout, and stderr.

Public function Static

const TCHAR ...

 

ExecutableName

(
    bool bRemoveExtension
)

Return the name of the currently running executable

Public function Static

const TCHAR ...

 

ExecutablePath()

Return the path to the currently running executable

Public function Static

void

 

ExploreFolder

(
    const TCHAR* FilePath
)

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

Public function Static

void

 

FreeDllHandle

(
    void* DllHandle
)

Free a DLL.

Public function Static

FString

 

GenerateApplicationPath

(
    const FString& AppName,
    EBuildConfiguration BuildConfigurat...
)

Generates the path to the specified application or game.

Public function Static

bool

 

GetApplicationMemoryUsage

(
    uint32 ProcessId,
    SIZE_T* OutMemoryUsage
)

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

Public function Static

FString

 

GetApplicationName

(
    uint32 ProcessId
)

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

Public function Static

const TCHAR ...

 

GetBinariesSubdirectory()

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

Public function Static

uint32

 

GetCurrentCoreNumber()

Retrieves the current hardware CPU core

Public function Static

uint32

 

GetCurrentProcessId()

Retrieves the ProcessId of this process.

Public function Static

FString

 

GetCurrentWorkingDirectory()

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

Public function Static

ENamedThread...

 

GetDesiredThreadForUObjectReferenceCollector()

Specifies the thread to use for UObject reference collection

Public function Static

void

 

GetDllDirectories

(
    TArray< FString >& OutDllDirectori...
)

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

Public function Static

void *

 

GetDllExport

(
    void* DllHandle,
    const TCHAR* ProcName
)

Lookup the address of a DLL function.

Public function Static

void *

 

GetDllHandle

(
    const TCHAR* Filename
)

Load a DLL.

Public function Static

FString

 

GetGameBundleId()

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

Public function Static

const TCHAR ...

 

GetModuleExtension()

Return the extension of dynamic library

Public function Static

const TCHAR ...

 

GetModulePrefix()

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

Public function Static

const FStrin...

 

GetModulesDirectory()

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

Public function Static

bool

 

GetProcReturnCode

(
    FProcHandle& ProcHandle,
    int32* ReturnCode
)

Retrieves the termination status of the specified process.

Public function Static

FEvent *

 

GetSynchEventFromPool

(
    bool bIsManualReset
)

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

Public function Static

bool

 

IsApplicationRunning

(
    const TCHAR* ProcName
)

Returns true if the specified application is running

Public function Static

bool

 

IsApplicationRunning

(
    uint32 ProcessId
)

Returns true if the specified application is running

Public function Static

bool

 

IsFirstInstance()

Checks if we're the first instance.

Public function Static

bool

 

IsProcRunning

(
    FProcHandle& ProcessHandle
)

Returns true if the specified process is running

Public function Static

void

 

LaunchFileInDefaultExternalApplication

(
    const TCHAR* FileName,
    const TCHAR* Parms,
    ELaunchVerb::Type Verb
)

Attempt to launch the provided file name in its default external application.

Public function Static

void

 

LaunchURL

(
    const TCHAR* URL,
    const TCHAR* Parms,
    FString* Error
)

Launch a uniform resource locator (i.e. http://www.epicgames.com/unreal).

Public function Static

void

 

ModifyThreadAssignmentForUObjectReferenceCollector

(
    int32& NumThreads,
    int32& NumBackgroundThreads,
    ENamedThreads::Type& NormalThreadN...,
    ENamedThreads::Type& BackgroundThr...
)

Allows a platform to override the threading configuration for reference collection

Public function Static

FSemaphore &...

 

NewInterprocessSynchObject

(
    const TCHAR* Name,
    bool bCreate,
    uint32 MaxLocks
)

Creates or opens an interprocess synchronization object.

Public function Static

FSemaphore &...

 

NewInterprocessSynchObject

(
    const FString& Name,
    bool bCreate,
    uint32 MaxLocks
)

Creates or opens an interprocess synchronization object.

Public function Static

FProcHandle

 

OpenProcess

(
    uint32 ProcessID
)

Opens an existing process.

Public function Static

void

 

PopDllDirectory

(
    const TCHAR* Directory
)

Unsets a directory to look for DLL files.

Public function Static

void

 

PushDllDirectory

(
    const TCHAR* Directory
)

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

Public function Static

FString

 

ReadPipe

(
    void* ReadPipe
)

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

Public function Static

bool

 

ReadPipeToArray

(
    void* ReadPipe,
    TArray< uint8 >& Output
)

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

Public function Static

void

 

ReturnSynchEventToPool

(
    FEvent* Event
)

Returns an event to the pool.

Public function Static

void

 

SetCurrentWorkingDirectoryToBaseDir()

Public function Static

bool

 

SetProcessLimits

(
    EProcessResource::Type Resource,
    uint64 Limit
)

Sets the process limits.

Public function Static

void

 

SetRealTimeMode()

Enables Real Time Mode on the current thread.

Public function Static

void

 

SetShaderDir

(
    const TCHAR* Where
)

Public function Static

void

 

SetThreadAffinityMask

(
    uint64 AffinityMask
)

Change the thread processor affinity

Public function Static

void

 

SetThreadName

(
    const TCHAR* ThreadName
)

Helper function to set thread name of the current thread.

Public function Static

void

 

SetupAudioThread()

Allow the platform to do anything it needs for audio thread

Public function Static

void

 

SetupGameThread()

Allow the platform to do anything it needs for game thread

Public function Static

void

 

SetupRenderThread()

Allow the platform to do anything it needs for render thread

Public function Static

const TCHAR ...

 

ShaderDir()

Public function Static

const FStrin...

 

ShaderWorkingDir()

Get the shader working directory.

Get the shader working directory

Public function Static

bool

 

ShouldSaveToUserDir()

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

Public function Static

bool

 

SkipWaitForStats()

Force skip calling FThreadStats::WaitForStats()

Public function Static

void

 

Sleep

(
    float Seconds
)

Sleep this thread for Seconds.

Public function Static

void

 

SleepInfinite()

Sleep this thread infinitely.

Public function Static

void

 

SleepNoStats

(
    float Seconds
)

Sleep this thread for Seconds.

Public function Static

bool

 

SupportsMultithreading()

Gets whether this platform can use multiple threads.

Public function Static

void

 

TearDown()

Tears down allocated process resources.

Public function Static

void

 

TeardownAudioThread()

Allow the platform to tear down the audio thread

Public function Static

void

 

TerminateProc

(
    FProcHandle& ProcessHandle,
    bool KillTree
)

Terminates a process

Public function Static

const TCHAR ...

 

UserDir()

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

Public function Static

const TCHAR ...

 

UserName

(
    bool bOnlyAlphaNumeric
)

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

Public function Static

const TCHAR ...

 

UserSettingsDir()

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

Public function Static

const TCHAR ...

 

UserTempDir()

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

Public function Static

EWaitAndFork...

 

WaitAndFork()

Waits for process signals and forks child processes.

Public function Static

void

 

WaitForProc

(
    FProcHandle& ProcessHandle
)

Waits for a process to stop

Public function Static

bool

 

WritePipe

(
    void* WritePipe,
    const FString& Message,
    FString* OutWritten
)

Sends the message to process through pipe

Public function Static

bool

 

WritePipe

(
    void* WritePipe,
    const uint8* Data,
    const int32 DataLength,
    int32* OutDataLength
)

Sends data to process through pipe

Classes

Name

Description

Public struct

FSemaphore

Generic representation of a interprocess semaphore

Enums

Name

Description

Public enum

EWaitAndForkResult

Deprecated Functions

Name Description

Public function Static

FEvent *

 

CreateSynchEvent

(
    bool bIsManualReset
)

Please use GetSynchEventFromPool to create a new event, and ReturnSynchEventToPool to release the event.

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss