class User : public UserHeap |
Set of static user functions.
These functions are related to a number of System component APIs.
The majority of the functions are related to either the current thread, or its heap. Examples in this category include User::Exit(), which causes the thread to terminate, and User::Alloc(), which allocates memory from the current thread's heap.
Some of these functions are equivalent to functions in the RThread or RHeap classes. In these cases, the User function is a convenient way to access the function without first having to get a handle to the current thread.
Functions are also provided to support debugging of memory leaks. These function calls can be written explicitly or can be generated using a corresponding macro - the advantage of using a macro is that the function call is only generated for debug builds.
A final category of functions, which includes User::BinarySearch() and User::QuickSort(), are just useful functions which have no other natural home.
Private Member Functions | |
---|---|
IMPORT_C TBool | DoCreatorHasCapability(TCapability, const char *) |
IMPORT_C TBool | DoCreatorHasCapability(TCapability) |
IMPORT_C TBool | DoCreatorHasCapability(TCapability, TCapability, const char *) |
IMPORT_C TBool | DoCreatorHasCapability(TCapability, TCapability) |
Public Member Enumerations | |
---|---|
enum | TCritical { ENotCritical, EProcessCritical, EProcessPermanent, EAllThreadsCritical, ESystemCritical, ESystemPermanent } |
enum | TRealtimeState { ERealtimeStateOff, ERealtimeStateOn, ERealtimeStateWarn } |
Inherited Enumerations | |
---|---|
UserHeap:TChunkHeapCreateMode |
IMPORT_C void | After | ( | TTimeIntervalMicroSeconds32 | aInterval | ) | [static] |
TTimeIntervalMicroSeconds32 aInterval |
IMPORT_C void | AfterHighRes | ( | TTimeIntervalMicroSeconds32 | aInterval | ) | [static] |
TTimeIntervalMicroSeconds32 aInterval |
IMPORT_C TInt | AllocLen | ( | const TAny * | aCell | ) | [static] |
const TAny * aCell |
IMPORT_C TInt | AllocSize | ( | TInt & | aTotalAllocSize | ) | [static] |
TInt & aTotalAllocSize |
IMPORT_C TInt | Available | ( | TInt & | aBiggestBlock | ) | [static] |
TInt & aBiggestBlock |
IMPORT_C TInt | Beep | ( | TInt | aFrequency, |
TTimeIntervalMicroSeconds32 | aDuration | |||
) | [static] |
TInt aFrequency | |
TTimeIntervalMicroSeconds32 aDuration |
IMPORT_C TInt | BinarySearch | ( | TInt | aCount, |
const TKey & | aKey, | |||
TInt & | aPos | |||
) | [static] |
IMPORT_C void | CancelMiscNotifier | ( | TRequestStatus & | aStatus | ) | [static] |
TRequestStatus & aStatus |
IMPORT_C TInt | CountAllocCells | ( | TInt & | aFreeCount | ) | [static] |
TInt & aFreeCount |
TBool | CreatorHasCapability | ( | TCapability | aCapability, |
const char * | aDiagnostic = 0 | |||
) | [static, inline] |
Check if the process that created the current 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 creator process has the capability, EFalse otherwise.
TCapability aCapability | The capability to test. |
const char * aDiagnostic = 0 | A 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. |
TBool | CreatorHasCapability | ( | TCapability | aCapability1, |
TCapability | aCapability2, | |||
const char * | aDiagnostic = 0 | |||
) | [static, inline] |
Check if the process that created the current 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 creator process has both the capabilities, EFalse otherwise.
TCapability aCapability1 | The first capability to test. |
TCapability aCapability2 | The second capability to test. |
const char * aDiagnostic = 0 | A 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. |
IMPORT_C TSecureId | CreatorSecureId | ( | ) | [static] |
Return the Secure ID of the process that created the current process. The Secure ID.
IMPORT_C TVendorId | CreatorVendorId | ( | ) | [static] |
Return the Vendor ID of the process that created the current process. The Vendor ID.
IMPORT_C TBool | DoCreatorHasCapability | ( | TCapability | aCapability, |
const char * | aDiagnostic | |||
) | [private, static] |
TCapability aCapability | |
const char * aDiagnostic |
IMPORT_C TBool | DoCreatorHasCapability | ( | TCapability | aCapability | ) | [private, static] |
TCapability aCapability |
IMPORT_C TBool | DoCreatorHasCapability | ( | TCapability | aCapability1, |
TCapability | aCapability2, | |||
const char * | aDiagnostic | |||
) | [private, static] |
TCapability aCapability1 | |
TCapability aCapability2 | |
const char * aDiagnostic |
IMPORT_C TBool | DoCreatorHasCapability | ( | TCapability | aCapability1, |
TCapability | aCapability2 | |||
) | [private, static] |
TCapability aCapability1 | |
TCapability aCapability2 |
IMPORT_C TInt | FreeLogicalDevice | ( | const TDesC & | aDeviceName | ) | [static] |
const TDesC & aDeviceName |
IMPORT_C TInt | FreePhysicalDevice | ( | const TDesC & | aDriverName | ) | [static] |
const TDesC & aDriverName |
RHeap & | Heap | ( | ) | [static, inline] |
Gets a reference to the handle to the current thread's heap.
A reference to the handle to the current thread's heap.
IMPORT_C TInt | InfoPrint | ( | const TDesC & | aDes | ) | [static] |
const TDesC & aDes |
IMPORT_C TBool | IsExceptionHandled | ( | TExcType | aType | ) | [static] |
TExcType aType |
const TAny * | LeaveIfNull | ( | const TAny * | aPtr | ) | [static, inline] |
Leaves with the reason code KErrNoMemory, if the specified pointer is NULL.
If the pointer is not NULL, the function simply returns with the value of the pointer.
Used to check pointers to const objects.
If the function returns, the value of aPtr.
const TAny * aPtr | The pointer to be tested. |
IMPORT_C TInt | LoadLogicalDevice | ( | const TDesC & | aFileName | ) | [static] |
const TDesC & aFileName |
IMPORT_C TInt | LoadPhysicalDevice | ( | const TDesC & | aFileName | ) | [static] |
const TDesC & aFileName |
IMPORT_C TInt | MachineConfiguration | ( | TDes8 & | aConfig, |
TInt & | aSize | |||
) | [static] |
IMPORT_C void | ModifyExceptionMask | ( | TUint32 | aClearMask, |
TUint32 | aSetMask | |||
) | [static] |
IMPORT_C void | NotifyOnIdle | ( | TRequestStatus & | aStatus | ) | [static] |
TRequestStatus & aStatus |
IMPORT_C TCritical | ProcessCritical | ( | RProcess | aProcess | ) | [static] |
RProcess aProcess |
IMPORT_C TBool | QueryVersionSupported | ( | const TVersion & | aCurrent, |
const TVersion & | aRequested | |||
) | [static] |
IMPORT_C TInt | QuickSort | ( | TInt | aCount, |
const TKey & | aKey, | |||
const TSwap & | aSwap | |||
) | [static] |
IMPORT_C TInt | RaiseException | ( | TExcType | aType | ) | [static] |
TExcType aType |
IMPORT_C TAny * | ReAllocL | ( | TAny * | aCell, |
TInt | aSize, | |||
TInt | aMode = 0 | |||
) | [static] |
IMPORT_C TInt | RenameProcess | ( | const TDesC & | aName | ) | [static] |
const TDesC & aName |
IMPORT_C TInt | RenameThread | ( | const TDesC & | aName | ) | [static] |
const TDesC & aName |
IMPORT_C void | RequestComplete | ( | TRequestStatus *& | aStatus, |
TInt | aReason | |||
) | [static] |
TRequestStatus *& aStatus | |
TInt aReason |
IMPORT_C TInt | SetCritical | ( | TCritical | aCritical | ) | [static] |
TCritical aCritical |
IMPORT_C TInt | SetCurrencySymbol | ( | const TDesC & | aSymbol | ) | [static] |
const TDesC & aSymbol |
IMPORT_C TInt | SetExceptionHandler | ( | TExceptionHandler | aHandler, |
TUint32 | aMask | |||
) | [static] |
TExceptionHandler aHandler | |
TUint32 aMask |
IMPORT_C TInt | SetFloatingPointMode | ( | TFloatingPointMode | aMode, |
TFloatingPointRoundingMode | aRoundingMode = EFpRoundToNearest | |||
) | [static] |
TFloatingPointMode aMode | |
TFloatingPointRoundingMode aRoundingMode = EFpRoundToNearest |
IMPORT_C TInt | SetHomeTime | ( | const TTime & | aTime | ) | [static] |
const TTime & aTime |
IMPORT_C TInt | SetHomeTimeSecure | ( | const TTime & | aTime | ) | [static] |
const TTime & aTime |
IMPORT_C void | SetJustInTime | ( | const TBool | aBoolean | ) | [static] |
const TBool aBoolean |
IMPORT_C TInt | SetMachineConfiguration | ( | const TDesC8 & | aConfig | ) | [static] |
const TDesC8 & aConfig |
IMPORT_C void | SetPriorityControl | ( | TBool | aEnable | ) | [static] |
TBool aEnable |
IMPORT_C TInt | SetProcessCritical | ( | TCritical | aCritical | ) | [static] |
TCritical aCritical |
IMPORT_C TInt | SetRealtimeState | ( | TRealtimeState | aState | ) | [static] |
Set the current threads realtime state. TRealtimeState
KErrNone if successful. KErrArgument if aState is invalid.
TRealtimeState aState | The state |
IMPORT_C TTrapHandler * | SetTrapHandler | ( | TTrapHandler * | aHandler | ) | [static] |
TTrapHandler * aHandler |
IMPORT_C void | SetUTCOffset | ( | TTimeIntervalSeconds | aOffset | ) | [static] |
TTimeIntervalSeconds aOffset |
IMPORT_C TInt | SetUTCTime | ( | const TTime & | aUTCTime | ) | [static] |
const TTime & aUTCTime |
IMPORT_C TInt | SetUTCTimeAndOffset | ( | const TTime & | aUTCTime, |
TTimeIntervalSeconds | aOffset | |||
) | [static] |
const TTime & aUTCTime | |
TTimeIntervalSeconds aOffset |
IMPORT_C TInt | SetUTCTimeSecure | ( | const TTime & | aUTCTime | ) | [static] |
const TTime & aUTCTime |
IMPORT_C TInt | StringLength | ( | const TUint8 * | aString | ) | [static] |
const TUint8 * aString |
IMPORT_C TInt | StringLength | ( | const TUint16 * | aString | ) | [static] |
const TUint16 * aString |
IMPORT_C RAllocator * | SwitchAllocator | ( | RAllocator * | aAllocator | ) | [static] |
RAllocator * aAllocator |
RHeap * | SwitchHeap | ( | RAllocator * | aHeap | ) | [static, inline] |
Changes the current thread's heap.
A pointer to the old heap handle.
RAllocator * aHeap | A pointer to the new heap handle. |
IMPORT_C void | UnMarkCleanupStack | ( | TTrapHandler * | aHandler | ) | [static] |
TTrapHandler * aHandler |
IMPORT_C TInt | ValidateName | ( | const TDesC & | aName | ) | [static] |
const TDesC & aName |
IMPORT_C void | WaitForNRequest | ( | TRequestStatus * | aStatusArray, |
TInt | aNum | |||
) | [static] |
TRequestStatus * aStatusArray | |
TInt aNum |
IMPORT_C void | WaitForRequest | ( | TRequestStatus & | aStatus | ) | [static] |
TRequestStatus & aStatus |
IMPORT_C void | WaitForRequest | ( | TRequestStatus & | aStatus1, |
TRequestStatus & | aStatus2 | |||
) | [static] |
TRequestStatus & aStatus1 | |
TRequestStatus & aStatus2 |
IMPORT_C TUint | __DbgCheckFailure | ( | TBool | aKernel | ) | [static] |
TBool aKernel |
IMPORT_C void | __DbgMarkCheck | ( | TBool | aKernel, |
TBool | aCountAll, | |||
TInt | aCount, | |||
const TUint8 * | aFileName, | |||
TInt | aLineNum | |||
) | [static] |
IMPORT_C void | __DbgSetAllocFail | ( | TBool | aKernel, |
RAllocator::TAllocFail | aFail, | |||
TInt | aRate | |||
) | [static] |
TBool aKernel | |
RAllocator::TAllocFail aFail | |
TInt aRate |
IMPORT_C void | __DbgSetBurstAllocFail | ( | TBool | aKernel, |
RAllocator::TAllocFail | aFail, | |||
TUint | aRate, | |||
TUint | aBurst | |||
) | [static] |
TBool aKernel | |
RAllocator::TAllocFail aFail | |
TUint aRate | |
TUint aBurst |
A set of values that defines the effect that terminating a thread has, either on its owning process or on the whole system.
A thread is said to be critical if its owning process or the entire system terminates when the thread itself terminates.
The meaning of a value when passed to one function is different to its meaning when passed the other function. See the description of each individual value.
ENotCritical |
This value can be passed to both:
|
EProcessCritical |
This value can only be passed to User::SetCritical() and affects the current thread only. It means that the owning process (i.e.the current process) terminates if:
|
EProcessPermanent |
This value can only be passed to User::SetCritical() and affects the current thread only. It means that the owning process (i.e.the current process) terminates if the current thread terminates for any reason. |
EAllThreadsCritical |
This value can only be passed to User::SetProcessCritical() and affects any new threads created in the current process. It means that the current process terminates if:
|
ESystemCritical |
This value can be passed to both: User::SetCritical() and User::SetProcessCritical(). When passed to User::SetCritical(), it means that the entire system is rebooted if:
When passed to User::SetProcessCritical(), it means that the entire system is rebooted if:
Note:
|
ESystemPermanent |
This value can be passed to both: User::SetCritical() and User::SetProcessCritical(). When passed to User::SetCritical(), it means that the entire system is rebooted if the current thread exits for any reason. When passed to User::SetProcessCritical(), it means that the entire system is rebooted if any new thread subsequently created in the current process exits for any reason, or if the process itself exits for any reason. Note:
|
ERealtimeStateOff - no action.
ERealtimeStateOn - the the thread will be panicked with KERN-EXEC 61 (EIllegalFunctionForRealtimeThread).
ERealtimeStateWarn - no action. However, if the kernel trace flag KREALTIME is enabled then tracing will be emitted as if the thread state was ERealtimeStateOn.
ERealtimeStateOff |
Thread is not realtime |
ERealtimeStateOn |
Thread is realtime |
ERealtimeStateWarn |
Thread is realtime but doesn't want this enforced |