BSUL

Link against: bsul.lib

Public Member Type Definitions
typedefvoid(* TCustomValidationFn
typedefCMessageParameterBase *(* TMessageParameterFactoryFn
Public Attributes
const TIntKClientMessageVersion
const TIntKErrBadMessageSchema
const TIntKErrBadParameter
const TIntKErrInvalidFunction
const TIntKErrNotInitialised
const TIntKErrNotValidated
const TIntKErrWrongParameterType
const TIntKMaxParameters
const TParameterDetailsKNoParams
const TIntKParamTypeMask
const TIntKShift16Bit
const TIntKValidationFnIndexMask
Public Member Enumerations
enumanonymous { ECMPanicWrongParameterType, ECMPanicBadDescriptor, ECMPanicBadMessageSchema }
enumTFlagValues { EFlagParam0Validated, EFlagParam1Validated, EFlagParam2Validated, EFlagParam3Validated, ..., EFlagLogBadMessages }
enumTParamType { EParamNull, EParamInt, EParamDes8Read, EParamDes8, ..., EParamPtr }
enumTServerFlags { ESrvFlagNone, ESrvFlagDoNotPanicClientOnBadMessageErrors, ESrvFlagLogBadMessages }
Public Member Functions
NONSHARABLE_CLASS(CClientMessage)
NONSHARABLE_CLASS(CDes16Parameter)
NONSHARABLE_CLASS(CDes16ReadParameter)
NONSHARABLE_CLASS(CDes8Parameter)
NONSHARABLE_CLASS(CDes8ReadParameter)
NONSHARABLE_CLASS(CIntParameter)
NONSHARABLE_CLASS(CMessageParameterBase)
NONSHARABLE_CLASS(CPckgParameter)
NONSHARABLE_CLASS(CPtrParameter)

Member Type Definition Documentation

Typedef TCustomValidationFn

typedef void(*TCustomValidationFn

This typedef is used to simplify the declaration of custom parameter validation functions

Typedef TMessageParameterFactoryFn

typedef CMessageParameterBase *(*TMessageParameterFactoryFn

This typedef is used to simplify the declaration of the message schema table defined by the server.

Member Attribute Documentation

KClientMessageVersion

const TIntKClientMessageVersion

KErrBadMessageSchema

const TIntKErrBadMessageSchema

Returned to caller in UREL mode when a message is found to be incorrectly defined in the message schema.

KErrBadParameter

const TIntKErrBadParameter

Returned to caller if a message is passed in containing a non-descriptor parameter which doesn't meet the constraints specified in the schema

KErrInvalidFunction

const TIntKErrInvalidFunction

Returned to caller to indicate that the requested message number is not supported by the current server

KErrNotInitialised

const TIntKErrNotInitialised

Returned to caller to indicate that the ClientMessage framework has not yet been initialised

KErrNotValidated

const TIntKErrNotValidated

Returned to caller to indicate that the requested parameter has not yet been validated

KErrWrongParameterType

const TIntKErrWrongParameterType

Returned to caller in UREL mode when the server attempts to call a CMessageParameterBase function which is not defined for the given parameter type. E.g. calling GetIntL() on a Descriptor parameter.

KMaxParameters

const TIntKMaxParameters

This defines the maximum number of parameters that can be stored in a TClientMessageSchema structure. This corresponds to the maximum number of arguments in an RMessage2

KNoParams

const TParameterDetailsKNoParams

This TParameterDetails structure is used to represent a message with no parameters. This is required as the schema expects a const TParameterDetails*.

KParamTypeMask

const TIntKParamTypeMask

This mask is used to select the parameter type from TParameterDetails.iType

KShift16Bit

const TIntKShift16Bit

This is used to shift down the value masked using KValidationFnIndexMask

KValidationFnIndexMask

const TIntKValidationFnIndexMask

This mask is used to select the validation function index from TParameterDetails.iType

Member Enumeration Documentation

Enum anonymous

This is the list of Panic codes used by the ClientMessage framework

EnumeratorValueDescription
ECMPanicWrongParameterType0

This panic is raised in UDEB mode when the server attempts to call a CMessageParameterBase function which is not defined for the given parameter type. E.g. calling GetIntL() on a Descriptor parameter.

ECMPanicBadDescriptor

This panic is raised when the server attempts to read from a descriptor in the clients process and supplies a target descriptor that is smaller than the client descriptor.

ECMPanicBadMessageSchema

This panic is raised when a TParameterDetails structure for a given parameter is incorrectly defined in the message schema

Enum TFlagValues

This enum lists the flags currently represented by the TBitFlags32 CClientMessage::iFlags

EnumeratorValueDescription
EFlagParam0Validated0
EFlagParam1Validated
EFlagParam2Validated
EFlagParam3Validated
EFlagPanicClient

Informs CompleteRequestL() that message not valid as client has already been panicked.

EFlagDoNotPanicClientOnBadMessageErrors30

Setting this flag indicates that for bad message errors, request should be completed with error code rather than panicking the client

EFlagLogBadMessages31

Enum TParamType

This Enum lists the currently supported Parameter types. These enum values are used as indices to the Parameter Factory Function which instantiates the appropriate CMessageParammeterBase derived object to represent a given message parameter.

Enum TServerFlags

This enum lists the currently supported flags that can be passed to the server in TClientMessageServerData::iFlags. Note that internally this value is stored in a TBitFlags32 type but this type cannot be statically initialised in a dll so the value is passed to the framework in a TInt. The bottom 16 bit flags are reserved for the framework's internal use.

EnumeratorValueDescription
ESrvFlagNone0

Default empty flag

ESrvFlagDoNotPanicClientOnBadMessageErrors0x40000000

Setting this flag indicates that for bad message errors, request should be completed with error code rather than panicking the client

ESrvFlagLogBadMessages0x80000000

Indicates that bad messages should be logged in UDEB

Member Function Documentation

NONSHARABLE_CLASS ( CClientMessage )

NONSHARABLE_CLASS(CClientMessage)

This class is used by a server to sanitise incoming messages. The class provides a wrapper around an RMessage2 object and provides a method for validation of the message against the constraints defined in the message schema. This class also provides methods for safely accessing the message arguments, and for error handling and logging of bad messages. This class is not intended for derivation.

NONSHARABLE_CLASS ( CDes16Parameter )

NONSHARABLE_CLASS(CDes16Parameter)

This class implements the behaviour for a read 16 bit descriptor parameter type. The ValidateL function checks that the MaxLength of the descriptor in the client s process is not less than iMin and that the length of the descriptor does not exceed iMax defined in the message schema.

NONSHARABLE_CLASS ( CDes16ReadParameter )

NONSHARABLE_CLASS(CDes16ReadParameter)

This class implements the behaviour for a read only 16 bit descriptor parameter type. The ValidateL function checks that the length of the descriptor argument in the client s process does not exceed iMax defined in the message schema.

NONSHARABLE_CLASS ( CDes8Parameter )

NONSHARABLE_CLASS(CDes8Parameter)

This class implements the behaviour for a read 8 bit descriptor parameter type. The ValidateL function checks that the MaxLength of the descriptor in the client s process is not less than iMin and that the length of the descriptor does not exceed iMax defined in the message schema.

NONSHARABLE_CLASS ( CDes8ReadParameter )

NONSHARABLE_CLASS(CDes8ReadParameter)

This class implements the behaviour for a read only 8 bit descriptor parameter type. The ValidateL function checks that the length of the descriptor argument in the client s process does not exceed iMax defined in the message schema.

NONSHARABLE_CLASS ( CIntParameter )

NONSHARABLE_CLASS(CIntParameter)

This class implements the behaviour for a TInt parameter type. The ValidateL function reads the Int value from the clients message and checks that the value read is between the iMax and iMin constraints defined in the message schema.

NONSHARABLE_CLASS ( CMessageParameterBase )

NONSHARABLE_CLASS(CMessageParameterBase)

This is the abstract base class for all message parameter classes. The class defines one pure virtual function, ValidateL, which all derived classes must implement. This class also defines default implementation for the access methods which should be properly defined in all derived classes. This class is not intended for external derivation.

NONSHARABLE_CLASS ( CPckgParameter )

NONSHARABLE_CLASS(CPckgParameter)

This class implements the behaviour for a generic TPckg<> parameter type. The ValidateL function calls the custom validation function passed in to the object on creation.

NONSHARABLE_CLASS ( CPtrParameter )

NONSHARABLE_CLASS(CPtrParameter)

This class implements the behaviour for a Ptr parameter type. The ValidateL function reads the TAny* from the clients message and stores it for retrieval.