|
||
To maintain security or improve functionality, you can restrict clients to using only plug-ins supplied by a particular company. Platform security provides a mechanism for executables to be marked with a vendor identifier, by using the vendorid keyword in its project file, and this information can be used in the selection of plug-ins.
To do this, you do not use the usual plug-in selection technique of
supplying a data to a resolver using an
TEComResolverParams
object (as described in
How to define instantiation functions). Instead, you should:
Get a list of available implementations of an interface using
REComSession::ListImplementationsL()
,
Get the vendor ID of each implementation in turn, using
CImplementationInformation::VendorId()
.
If the correct vendor ID is found, read other information, such as
the plug-in implementation UID, from the
CImplementationInformation
object, and use this as required.
// Specify interface for which to get implementations
TUid interfaceUid={0xxxxxxxxx};
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();
< . . . more statements . . . >
}
< . . . more statements . . . >
implArray.ResetAndDestroy();
REComSession::FinalClose();