RProcess Class Reference

class RProcess : public RHandleBase

A handle to a process.

The process itself is a kernel object.

Inherits from

Public Member Functions
RProcess()
RProcess(TInt)
IMPORT_C TIntCreate(const TDesC &, const TDesC &, TOwnerType)
IMPORT_C TIntCreate(const TDesC &, const TDesC &, const TUidType &, TOwnerType)
IMPORT_C TIntCreateWithStackOverride(const TDesC &, const TDesC &, const TUidType &, TInt, TOwnerType)
IMPORT_C TIntDataCaging(TInt)
IMPORT_C TBoolDefaultDataPaged()
IMPORT_C TAny *ExeExportData(void)
IMPORT_C TExitCategoryNameExitCategory()
IMPORT_C TIntExitReason()
IMPORT_C TExitTypeExitType()
IMPORT_C TFileNameFileName()
IMPORT_C TIntGetMemoryInfo(TModuleMemoryInfo &)
TBool HasCapability(TCapability, const char *)
TBool HasCapability(TCapability, TCapability, const char *)
IMPORT_C TProcessIdId()
TUid Identity()
IMPORT_C TBoolJustInTime()
IMPORT_C voidKill(TInt)
IMPORT_C voidLogon(TRequestStatus &)
IMPORT_C TIntLogonCancel(TRequestStatus &)
IMPORT_C TIntOpen(const TDesC &, TOwnerType)
IMPORT_C TIntOpen(TProcessId, TOwnerType)
TInt Open(const TFindProcess &, TOwnerType)
IMPORT_C voidPanic(const TDesC &, TInt)
IMPORT_C TProcessPriorityPriority()
TInt RenameMe(const TDesC &)
IMPORT_C voidRendezvous(TRequestStatus &)
IMPORT_C voidRendezvous(TInt)
IMPORT_C TIntRendezvousCancel(TRequestStatus &)
IMPORT_C voidResume()
IMPORT_C TIntSecureApi(TInt)
IMPORT_C TSecureIdSecureId()
IMPORT_C voidSetJustInTime(TBool)
IMPORT_C TIntSetParameter(TInt, RHandleBase)
IMPORT_C TIntSetParameter(TInt, const RSubSessionBase &)
IMPORT_C TIntSetParameter(TInt, const TDesC16 &)
IMPORT_C TIntSetParameter(TInt, const TDesC8 &)
IMPORT_C TIntSetParameter(TInt, TInt)
IMPORT_C TIntSetPriority(TProcessPriority)
IMPORT_C voidTerminate(TInt)
IMPORT_C TUidTypeType()
IMPORT_C TVendorIdVendorId()
Private Member Functions
IMPORT_C TBoolDoHasCapability(TCapability, const char *)
IMPORT_C TBoolDoHasCapability(TCapability)
IMPORT_C TBoolDoHasCapability(TCapability, TCapability, const char *)
IMPORT_C TBoolDoHasCapability(TCapability, TCapability)
Inherited Functions
RHandleBase::Attributes()const
RHandleBase::BTraceId()const
RHandleBase::Close()
RHandleBase::DoExtendedClose()
RHandleBase::Duplicate(const RThread &,TOwnerType)
RHandleBase::FullName()const
RHandleBase::FullName(TDes &)const
RHandleBase::Handle()const
RHandleBase::HandleInfo(THandleInfo *)
RHandleBase::Name()const
RHandleBase::NotifyDestruction(TRequestStatus &)
RHandleBase::Open(const TFindHandleBase &,TOwnerType)
RHandleBase::OpenByName(const TDesC &,TOwnerType,TInt)
RHandleBase::RHandleBase()
RHandleBase::RHandleBase(TInt)
RHandleBase::SetHandle(TInt)
RHandleBase::SetHandleNC(TInt)
RHandleBase::SetReturnedHandle(TInt)
RHandleBase::SetReturnedHandle(TInt,RHandleBase &)
Public Member Enumerations
enumTDataCaging { EDataCagingOff, EDataCagingOn, EDataCagingQuery }
enumTSecureApi { ESecureApiOff, ESecureApiOn, ESecureApiQuery }
Inherited Enumerations
RHandleBase:TAttributes
Inherited Attributes
RHandleBase::iHandle

Constructor & Destructor Documentation

RProcess()

RProcess()[inline]

Default constructor.

The constructor exists to initialise private data within this handle; it does not create the process object.

Specifically, it sets the handle-number to the value KCurrentProcessHandle. In effect, the constructor creates a default process handle.

RProcess(TInt)

RProcess(TIntaHandle)[inline]

Constructor taking a handle number.

Parameters

TInt aHandleThe handle number to be used to construct this RProcess handle.

Member Functions Documentation

Create(const TDesC &, const TDesC &, TOwnerType)

IMPORT_C TIntCreate(const TDesC &aFileName,
const TDesC &aCommand,
TOwnerTypeaType = EOwnerProcess
)

Parameters

const TDesC & aFileName
const TDesC & aCommand
TOwnerType aType = EOwnerProcess

Create(const TDesC &, const TDesC &, const TUidType &, TOwnerType)

IMPORT_C TIntCreate(const TDesC &aFileName,
const TDesC &aCommand,
const TUidType &aUidType,
TOwnerTypeaType = EOwnerProcess
)

Parameters

const TDesC & aFileName
const TDesC & aCommand
const TUidType & aUidType
TOwnerType aType = EOwnerProcess

CreateWithStackOverride(const TDesC &, const TDesC &, const TUidType &, TInt, TOwnerType)

IMPORT_C TIntCreateWithStackOverride(const TDesC &aFileName,
const TDesC &aCommand,
const TUidType &aUidType,
TIntaMinStackSize,
TOwnerTypeaType
)

Parameters

const TDesC & aFileName
const TDesC & aCommand
const TUidType & aUidType
TInt aMinStackSize
TOwnerType aType

DataCaging(TInt)

IMPORT_C TIntDataCaging(TIntaState)

Legacy Platform Security development and migration support No replacement

Parameters

TInt aState

DefaultDataPaged()

IMPORT_C TBoolDefaultDataPaged()const

DoHasCapability(TCapability, const char *)

IMPORT_C TBoolDoHasCapability(TCapabilityaCapability,
const char *aDiagnostic
)const [private]

Parameters

TCapability aCapability
const char * aDiagnostic

DoHasCapability(TCapability)

IMPORT_C TBoolDoHasCapability(TCapabilityaCapability)const [private]

Parameters

TCapability aCapability

DoHasCapability(TCapability, TCapability, const char *)

IMPORT_C TBoolDoHasCapability(TCapabilityaCapability1,
TCapabilityaCapability2,
const char *aDiagnostic
)const [private]

Parameters

TCapability aCapability1
TCapability aCapability2
const char * aDiagnostic

DoHasCapability(TCapability, TCapability)

IMPORT_C TBoolDoHasCapability(TCapabilityaCapability1,
TCapabilityaCapability2
)const [private]

Parameters

TCapability aCapability1
TCapability aCapability2

ExeExportData(void)

IMPORT_C TAny *ExeExportData(void)[static]

Parameters

void

ExitCategory()

IMPORT_C TExitCategoryNameExitCategory()const

ExitReason()

IMPORT_C TIntExitReason()const

ExitType()

IMPORT_C TExitTypeExitType()const

FileName()

IMPORT_C TFileNameFileName()const

GetMemoryInfo(TModuleMemoryInfo &)

IMPORT_C TIntGetMemoryInfo(TModuleMemoryInfo &aInfo)const

Parameters

TModuleMemoryInfo & aInfo

HasCapability(TCapability, const char *)

TBool HasCapability(TCapabilityaCapability,
const char *aDiagnostic = 0
)const [inline]

Check if the process has a given capability

When a check fails the action taken is determined by the system wide Platform Security configuration. If PlatSecDiagnostics is ON, then a diagnostic message is emitted. If PlatSecEnforcement is OFF, then this function will return ETrue even though the check failed.

ETrue if the process has the capability, EFalse otherwise.

Parameters

TCapability aCapabilityThe capability to test.
const char * aDiagnostic = 0A string that will be emitted along with any diagnostic message that may be issued if the test finds the capability is not present. This string must be enclosed in the __PLATSEC_DIAGNOSTIC_STRING macro which enables it to be easily removed from the system.

HasCapability(TCapability, TCapability, const char *)

TBool HasCapability(TCapabilityaCapability1,
TCapabilityaCapability2,
const char *aDiagnostic = 0
)const [inline]

Check if the process has both of the given capabilities

When a check fails the action taken is determined by the system wide Platform Security configuration. If PlatSecDiagnostics is ON, then a diagnostic message is emitted. If PlatSecEnforcement is OFF, then this function will return ETrue even though the check failed.

ETrue if the process has both the capabilities, EFalse otherwise.

Parameters

TCapability aCapability1The first capability to test.
TCapability aCapability2The second capability to test.
const char * aDiagnostic = 0A string that will be emitted along with any diagnostic message that may be issued if the test finds a capability is not present. This string must be enclosed in the __PLATSEC_DIAGNOSTIC_STRING macro which enables it to be easily removed from the system.

Id()

IMPORT_C TProcessIdId()const

Identity()

TUid Identity()const [inline]

Use RProcess::SecureId() instead

JustInTime()

IMPORT_C TBoolJustInTime()const

Kill(TInt)

IMPORT_C voidKill(TIntaReason)

Parameters

TInt aReason

Logon(TRequestStatus &)

IMPORT_C voidLogon(TRequestStatus &aStatus)const

Parameters

TRequestStatus & aStatus

LogonCancel(TRequestStatus &)

IMPORT_C TIntLogonCancel(TRequestStatus &aStatus)const

Parameters

TRequestStatus & aStatus

Open(const TDesC &, TOwnerType)

IMPORT_C TIntOpen(const TDesC &aName,
TOwnerTypeaType = EOwnerProcess
)

Parameters

const TDesC & aName
TOwnerType aType = EOwnerProcess

Open(TProcessId, TOwnerType)

IMPORT_C TIntOpen(TProcessIdaId,
TOwnerTypeaType = EOwnerProcess
)

Parameters

TProcessId aId
TOwnerType aType = EOwnerProcess

Open(const TFindProcess &, TOwnerType)

TInt Open(const TFindProcess &aFind,
TOwnerTypeaType = EOwnerProcess
)[inline]

Opens a handle to the process found by pattern matching a name.

A TFindProcess object is used to find all processes whose full names match a specified pattern.

By default, ownership of this process handle is vested in the current process, but can be vested in the current thread by passing EOwnerThread as the second parameter to this function.

KErrNone if successful, otherwise one of the other system-wide error codes.

Parameters

const TFindProcess & aFindA reference to the TFindProcess object used to find the process.
TOwnerType aType = EOwnerProcessAn enumeration whose enumerators define the ownership of this process handle. If not explicitly specified, EOwnerProcess is taken as default.

Panic(const TDesC &, TInt)

IMPORT_C voidPanic(const TDesC &aCategory,
TIntaReason
)

Parameters

const TDesC & aCategory
TInt aReason

Priority()

IMPORT_C TProcessPriorityPriority()const

RenameMe(const TDesC &)

TInt RenameMe(const TDesC &aName)[static, inline]

Use User::RenameProcess() instead

Parameters

const TDesC & aName

Rendezvous(TRequestStatus &)

IMPORT_C voidRendezvous(TRequestStatus &aStatus)const

Parameters

TRequestStatus & aStatus

Rendezvous(TInt)

IMPORT_C voidRendezvous(TIntaReason)[static]

Parameters

TInt aReason

RendezvousCancel(TRequestStatus &)

IMPORT_C TIntRendezvousCancel(TRequestStatus &aStatus)const

Parameters

TRequestStatus & aStatus

Resume()

IMPORT_C voidResume()

SecureApi(TInt)

IMPORT_C TIntSecureApi(TIntaState)

Legacy Platform Security development and migration support No replacement

Parameters

TInt aState

SecureId()

IMPORT_C TSecureIdSecureId()const

Return the Secure ID of the process.

If an intended use of this method is to check that the Secure ID is a given value, then the use of a TSecurityPolicy object should be considered. E.g. Instead of something like:

		RProcess& process;
		TInt error = process.SecureId()==KRequiredSecureId ? KErrNone : KErrPermissionDenied;

this could be used;

		RProcess& process;
		static _LIT_SECURITY_POLICY_S0(mySidPolicy, KRequiredSecureId);
		TBool pass = mySidPolicy().CheckPolicy(process);

This has the benefit that the TSecurityPolicy::CheckPolicy methods are configured by the system wide Platform Security configuration. I.e. are capable of emitting diagnostic messages when a check fails and/or the check can be forced to always pass.

TSecurityPolicy::CheckPolicy(RProcess aProcess, const char* aDiagnostic) const

_LIT_SECURITY_POLICY_S0

The Secure ID.

SetJustInTime(TBool)

IMPORT_C voidSetJustInTime(TBoolaBoolean)const

Parameters

TBool aBoolean

SetParameter(TInt, RHandleBase)

IMPORT_C TIntSetParameter(TIntaIndex,
RHandleBaseaHandle
)

Parameters

TInt aIndex
RHandleBase aHandle

SetParameter(TInt, const RSubSessionBase &)

IMPORT_C TIntSetParameter(TIntaSlot,
const RSubSessionBase &aSession
)

Parameters

TInt aSlot
const RSubSessionBase & aSession

SetParameter(TInt, const TDesC16 &)

IMPORT_C TIntSetParameter(TIntaSlot,
const TDesC16 &aDes
)

Parameters

TInt aSlot
const TDesC16 & aDes

SetParameter(TInt, const TDesC8 &)

IMPORT_C TIntSetParameter(TIntaSlot,
const TDesC8 &aDes
)

Parameters

TInt aSlot
const TDesC8 & aDes

SetParameter(TInt, TInt)

IMPORT_C TIntSetParameter(TIntaSlot,
TIntaData
)

Parameters

TInt aSlot
TInt aData

SetPriority(TProcessPriority)

IMPORT_C TIntSetPriority(TProcessPriorityaPriority)const

Parameters

TProcessPriority aPriority

Terminate(TInt)

IMPORT_C voidTerminate(TIntaReason)

Parameters

TInt aReason

Type()

IMPORT_C TUidTypeType()const

VendorId()

IMPORT_C TVendorIdVendorId()const

Return the Vendor ID of the process.

If an intended use of this method is to check that the Vendor ID is a given value, then the use of a TSecurityPolicy object should be considered. E.g. Instead of something like:

		RProcess& process;
		TInt error = process.VendorId()==KRequiredVendorId ? KErrNone : KErrPermissionDenied;

this could be used;

		RProcess& process;
		static _LIT_SECURITY_POLICY_V0(myVidPolicy, KRequiredVendorId);
		TBool pass = myVidPolicy().CheckPolicy(process);

This has the benefit that the TSecurityPolicy::CheckPolicy methods are configured by the system wide Platform Security configuration. I.e. are capable of emitting diagnostic messages when a check fails and/or the check can be forced to always pass.

TSecurityPolicy::CheckPolicy(RProcess aProcess, const char* aDiagnostic) const

_LIT_SECURITY_POLICY_V0

The Vendor ID.

Member Enumerations Documentation

Enum TDataCaging

Legacy Platform Security development and migration support No replacement

Enumerators

EDataCagingOff
EDataCagingOn
EDataCagingQuery

Enum TSecureApi

Legacy Platform Security development and migration support No replacement

Enumerators

ESecureApiOff
ESecureApiOn
ESecureApiQuery