MTM Capabilities

This section provides guidelines to the MTM implementors for assigning the capability set for different types of MTMs.

Description

MTMs are implemented as DLLs. According to the Symbian platform security model a DLL can be loaded by a process only if the DLL has a capability set equal to or greater than the capability set of the process loading it.

The characteristics of a plug-in module are described by its set of capabilities. The standard capabilities are characteristics, such as the maximum message body size, the maximum total size of a message, the character widths supported by a message type, presence or absence of support for attachments, presence or absence of support for the subject field, folders and so on. Capabilities are referenced by unique identifiers, which are managed by Symbian.

The capability set is defined in the MMP files of the MTMs. The following sections list the capability set required by the Symbian platform for each type of MTM.

Server MTM

A Server MTM is always loaded by the Messaging Server. It is therefore necessary for the Server MTMs to have the following capability set assigned.

ReadDeviceData WriteDeviceData ProtServ NetworkControl NetworkServices LocalServices ReadUserData WriteUserData

Client MTMs, UI MTMs and UI Data MTMs

These MTMs are used by modules both within and outside of the Messaging Framework. If a Client MTM is to provide all the supported Messaging functionality it must have at least the minimum capabilities listed below.

ReadDeviceData WriteDeviceData NetworkServices LocalServices ReadUserData WriteUserData

If a Client MTM does not need to provide the complete set of Messaging functionality then a subset of the capabilities mentioned above may be selected. For example, if a Client MTM communicates over a local connection, such as IR or Bluetooth, it needs the LocalServices capability only and does not need the NetworkServices capability. Refer to the Platform Security Engineering Guide to understand the requirements for each capability recommended above.

Authors of Client MTMs that are loaded by the standard Messaging applications must give their MTMs the capabilities that those applications have, that is, the capabilities of Client MTMs are determined by the processes that load them.

The capabilities that need to be selected for applications that use Client MTMs depends on the functionality that those applications provide. If the Client MTM does not have those capabilities, the application will not be able to load the MTM. It is up to the creator of the MTM to make sure that it is assigned enough capabilities to be loaded into applications that require that MTM.

Security capability specification

With the introduction of platform security, individual MTMs are required to specify the additional security capabilities that Messaging client applications require in order to send messages by that MTM. These capabilities must be set in the MTM resource file that describes the MTM's properties.

This is done using the resource structure MTM_SECURITY_CAPABILITY_SET. This has a single array member capabilities that specifies the required capabilities: each value must be a capability as defined in TCapability. For example, this resource specifies that the client must have the local services (for example, Bluetooth) capability:

RESOURCE MTM_SECURITY_CAPABILITY_SET 
    {
    capabilities = { ECapabilityLocalServices }; 
    }

An MTM_SECURITY_CAPABILITY_SET must be the third resource in the resource file (following the MTM_INFO_FILE and MTM_CAPABILITIES resources), even if the MTM requires no additional capabilities to be defined.

MTM_CAPABILITIES has nothing to do with platform security, but specifies flags used by SendAs. If the MTM can support SendAs, it should define the resource as:

RESOURCE MTM_CAPABILITIES 
    {
    send_capability=1; 
    body_capability=1; 
    }

If the MTM does not support SendAs, use the following:

RESOURCE MTM_CAPABILITIES 
    {
    }

Specifying the capability set

Developers are advised that keywords such as ReadDeviceData are case sensitive, and care should be taken when specifying them in the MMP file. For example a server side MTM will have the capability set defined in the MMP file as follows:

CAPABILITY ReadDeviceData WriteDeviceData ProtServ NetworkControl NetworkServices LocalServices ReadUserData WriteUserData

Example

// TXUT.MMP
//
// Copyright © 2000 Symbian Ltd.  All rights reserved.

target          TXUT.dll
targettype      dll
uid      0x1000008d 0x10003C75
VENDORID 0x70000001
CAPABILITY   ReadDeviceData WriteDeviceData ProtServ NetworkControl NetworkServices LocalServices ReadUserData WriteUserData LocalServices ReaduserData WriteUserData

source          txut.cpp txutdll.cpp

userinclude     .
systeminclude   \Epoc32\include

library         euser.lib estor.lib msgs.lib efsrv.lib 
library         centralrepository.lib  

// v2 def files

#if defined(WINS)
    deffile .\txutWINS.def
#else
    deffile .\txutEABI.def    
#endif

nostrictdef