Filtering Implementations by Vendor ID

The Plug-in framework clients can be restricted to use plug-ins supplied by a particular company. This enables to enhance security and improve functionality of the framework.

Context

Platform security provides a mechanism to mark the plug-ins with a vendor identifier by using the vendorid keyword in the project file. This information is used for plug-in selection.

To filter implementations by vendor id there is no need to use the TEComResolverParams object. Instead, follow the steps described below:

Steps

  1. Retrieve the list of available implementations of an interface using REComSession::ListImplementationsL().
  2. Retrieve the vendor ID of the implementation, using CImplementationInformation::VendorId(). If the matching vendor ID is returned, use the plug-in as required.

Filtering implementations by vendor ID example

// Specify interface for which to get implementations
TUid interfaceUid={0111111111};
RImplInfoPtrArray implArray;
// get list of implementations into the array
REComSession::ListImplementationsL(interfaceUid, implArray);

// loop through implementations
TInt implCount = implArray.Count();
for(TInt count = 0; count < implCount; count++)
  {
  // read vendor ID
  const CImplementationInformation* implInfo = implArray[count];
  TVendorId vid = implInfo->VendorId();

   . . .

  }

   . . .

implArray.ResetAndDestroy();
REComSession::FinalClose();