RLibrary Class Reference

#include <e32std.h>

class RLibrary : public RHandleBase

Inherits from

Public Member Type Definitions
typedef TPckgBuf< SInfo > SInfoBuf
typedef TPckgBuf< TInfo > TInfoBuf
typedef TPckgBuf< TInfoV2 > TInfoBufV2
Public Member Enumerations
enumTRequiredImageHeaderSize { KRequiredImageHeaderSize }
Public Member Functions
IMPORT_C voidClose()
IMPORT_C TFileNameFileName()
IMPORT_C TIntGetInfo(const TDesC &, TDes8 &)
IMPORT_C TIntGetInfoFromHeader(const TDesC8 &, TDes8 &)
IMPORT_C TIntGetRamSizes(TInt &, TInt &)
IMPORT_C TIntInit()
IMPORT_C TIntLoad(const TDesC &, const TUidType &)
IMPORT_C TIntLoad(const TDesC &, const TDesC &)
IMPORT_C TIntLoad(const TDesC &, const TDesC &, const TUidType &)
IMPORT_C TIntLoad(const TDesC &, const TDesC &, const TUidType &, TUint32)
IMPORT_C TIntLoadRomLibrary(const TDesC &, const TDesC &)
IMPORT_C TLibraryFunctionLookup(TInt)
IMPORT_C TUidTypeType()
Inherited Attributes
RHandleBase::iHandle
Inherited Enumerations
RHandleBase:TAttributes
Inherited Functions
RHandleBase::Attributes()const
RHandleBase::BTraceId()const
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 &)

Detailed Description

A handle to a dynamically loadable DLL.

The class is not intended for user derivation.

Member Type Definition Documentation

Typedef SInfoBuf

typedef TPckgBuf< SInfo >SInfoBuf

DeprecatedUse TInfoBuf

Typedef TInfoBuf

typedef TPckgBuf< TInfo >TInfoBuf

Type representing a TInfo struct packaged as a descriptor.

Typedef TInfoBufV2

typedef TPckgBuf< TInfoV2 >TInfoBufV2

Type representing a TInfo struct packaged as a descriptor, version 2.

Member Enumeration Documentation

Enum TRequiredImageHeaderSize

EnumeratorValueDescription
KRequiredImageHeaderSize9*1024

Member Function Documentation

Close ( )

IMPORT_C voidClose()

Reimplemented from RHandleBase::Close()

Closes the DLL.

The function decrements the usage count by one.

This handle must have been used to load the DLL using one of the Load() functions.

FileName ( )

IMPORT_C TFileNameFileName()const

Gets the name of the DLL's file.

Return Value
The DLL's filname.

GetInfo ( const TDesC &, TDes8 & )

IMPORT_C TIntGetInfo(const TDesC &aFileName,
TDes8 &aInfoBuf
)[static]

Gets information about the specified DLL.

Parameters
aFileNameA descriptor containing the name of the DLL to be checked. The length of the file name must not be greater than KMaxFileName.
aInfoBufOn return, contains information about the DLL (RLibrary::TInfo)
Return Value
KErrNone, if successful; KErrBadName, if the length of aFileName is greater than KMaxFileName; otherwise one of the other system wide error codes.

GetInfoFromHeader ( const TDesC8 &, TDes8 & )

IMPORT_C TIntGetInfoFromHeader(const TDesC8 &aHeader,
TDes8 &aInfoBuf
)[static]

Gets information about an executable binary, (DLL or EXE), based on header data from that binaries image.

Parameters
aHeaderA descriptor containing the data from the start of the binaries image. This data should be of size RLibrary::KRequiredImageHeaderSize or the total length of the binary image, whichever is smallest.
aInfoBufA descriptor which will be filled with the extracted information. This information will be in the form of a RLibrary::TInfo structure. This should usually be an object of type RLibrary::TInfoBuf.
Return Value
KErrNone, if successful; KErrUnderflow, if the size of aHeader is too small; KErrCorrupt, if the data in aHeader isn't a valid executable image header; Otherwise one of the other system wide error codes.

GetRamSizes ( TInt &, TInt & )

IMPORT_C TIntGetRamSizes(TInt &aCodeSize,
TInt &aConstDataSize
)

Gets the current size of the code and the const data for this DLL.

This function can be called on a RAM loaded DLL or a ROM based DLL.

Parameters
aCodeSizeThe current size of the code for a RAM loaded DLL. This is zero for a ROM based DLL.
aConstDataSizeThe current size of the const data for a RAM loaded DLL. This is zero for a ROM based DLL.
Return Value
KErrNone if successful, otherwise one of the system-wide error codes.

Init ( )

IMPORT_C TIntInit()

Load ( const TDesC &, const TUidType & )

IMPORT_C TIntLoad(const TDesC &aFileName,
const TUidType &aType
)

Loads the named DLL which matches the specified UID type.

If successful, the function increments the usage count by one. No additional search paths can be specified with this function.

Parameters
aFileNameA descriptor containing the name of the DLL to be loaded. The length of the file name must not be greater than KMaxFileName.
aTypeA UID type (a triplet of UIDs) which the DLL must match. Individual UIDs can contain the KNullUid wild card.
Return Value
KErrNone, if successful; KErrBadName, if the length of aFileName is greater than KMaxFileName; otherwise one of the other system wide error codes.

Load ( const TDesC &, const TDesC & )

IMPORT_C TIntLoad(const TDesC &aFileName,
const TDesC &aPath = KNullDesC
)

Loads the named DLL.

If successful, the function increments the usage count by one.

Parameters
aFileNameA descriptor containing the name of the DLL to be loaded. The length of the file name must not be greater than KMaxFileName.
aPathA descriptor containing a list of path names, each separated by a semicolon. When specified, these paths are searched for the DLL before the standard search locations. By default, no pathnames are specified.
Return Value
KErrNone, if successful; KErrBadName, if the length of aFileName is greater than KMaxFileName; otherwise one of the other system wide error codes.

Load ( const TDesC &, const TDesC &, const TUidType & )

IMPORT_C TIntLoad(const TDesC &aFileName,
const TDesC &aPath,
const TUidType &aType
)

Loads the named DLL that matches the specified UID type.

If successful, the function increments the usage count by one.

Parameters
aFileNameA descriptor containing the name of the DLL to be loaded. The length of the file name must not be greater than KMaxFileName.
aPathA descriptor containing a list of path names, each separated by a semicolon. When specified, these paths are searched for the DLL before the standard search locations.
aTypeA UID type (a triplet of UIDs) that the DLL must match. Individual UIDs can contain the KNullUid wild card.
Return Value
KErrNone, if successful; KErrBadName, if the length of aFileName is greater than KMaxFileName; otherwise one of the other system wide error codes.

Load ( const TDesC &, const TDesC &, const TUidType &, TUint32 )

IMPORT_C TIntLoad(const TDesC &aFileName,
const TDesC &aPath,
const TUidType &aType,
TUint32aModuleVersion
)

Loads the named DLL that matches the specified UID type and version.

If successful, the function increments the usage count by one.

Parameters
aFileNameA descriptor containing the name of the DLL to be loaded. The length of the file name must not be greater than KMaxFileName.
aPathA descriptor containing a list of path names, each separated by a semicolon. When specified, these paths are searched for the DLL before the standard search locations.
aTypeA UID type (a triplet of UIDs) that the DLL must match. Individual UIDs can contain the KNullUid wild card.
aModuleVersionA version specification that the DLL must match. Major version must match exactly and minor version must be >= the specified minor version.
Return Value
KErrNone, if successful; KErrBadName, if the length of aFileName is greater than KMaxFileName; otherwise one of the other system wide error codes.

LoadRomLibrary ( const TDesC &, const TDesC & )

IMPORT_C TIntLoadRomLibrary(const TDesC &aFileName,
const TDesC &aPath
)

Lookup ( TInt )

IMPORT_C TLibraryFunctionLookup(TIntanOrdinal)const

Gets a pointer to the function at the specified ordinal within this DLL.

Parameters
anOrdinalThe ordinal of the required function in this DLL. This value must be positive.
Return Value
A pointer to the function at position anOrdinal in this DLL. The value is NULL if there is no function at that ordinal.
Panic Codes
USER116 if anOrdinal is negative

Type ( )

IMPORT_C TUidTypeType()const

Gets this DLL's UID type.

The UID type is a property of a Symbian OS file; for a DLL, its value is set during the building of that DLL.

Return Value
The UID type of this DLL. Note that the first TUid component of the TUidType has the value KDynamicLibraryUid.