void CheckForPhbkSyncPluginL()
	{
	test.Next(_L("Check for PhbkSync test plug-in"));

	RImplInfoPtrArray	implInfoArray;
	CleanupResetAndDestroyPushL(implInfoArray);
	REComSession::ListImplementationsL(KUidEcomCntPhBkSyncInterface, implInfoArray);
	//Find implementations of KUidEcomCntPhBkSyncInterface
	TInt availCount = implInfoArray.Count(); 
	TInt count;
	for(count = 0; count < availCount; count++)
		{
		const TUid firstImplementationFound = implInfoArray[count]->ImplementationUid();
		CImplementationInformation *info = implInfoArray[count];
		test.Printf(_L("\n"));
		test.Printf(_L("PhbkSync plugin #%i, Implementation UID 0x%08X version %i\n"),
			count + 1, info->ImplementationUid(), info->Version());
		test.Printf(_L("Plugin name = \"%S\"\n"), &(info->DisplayName()));
		}

	// is telephony's plug-in in the list?
	for(count = 0; count < availCount; count++)
		{
		const TUid firstImplementationFound = implInfoArray[count]->ImplementationUid();
		CImplementationInformation *info = implInfoArray[count];
		if(info->DisplayName() == KTestPluginName)
			{
			test.Printf(_L("\n"));
			test.Printf(_L("This test has now loaded the test plugin"));
			test.Printf(_L("\n"));
			availCount = 1;
			break;
			}		
		
		if(info->DisplayName() == KPluginName)
			{
			test.Printf(_L("\n"));
			test.Printf(_L("This test only works with Contacts the test plugin and not the original phonebooksync plugin."));
			test.Printf(_L("Depending on the build to removed the plugin in different ways:"));
			test.Printf(_L("hardware - delete the line \"ECOM_PLUGIN(phbksyncplugin.dll,1020428c.rsc)\" from phbksync.iby"));
			test.Printf(_L("winscw - delete phbksyncplugin.dll from %epocroot%/epoc32/release/winscw/udeb or similarly named directory"));
			test.Printf(_L("\n"));
			test(0);  // stop
			break;
			}
		}

	// only continue test if there is exactly one plug-in present
	test(availCount == 1);	

	CleanupStack::PopAndDestroy(&implInfoArray);
	}
OMX_ERRORTYPE CSymbianOmxComponentLoader::InitializeComponentLoader()
	{
	RImplInfoPtrArray ecomArray;
	TRAPD(error,REComSession::ListImplementationsL(TUid::Uid(KUidOmxILSymbianComponentIf),ecomArray));
	if( error != KErrNone )
		{
		ecomArray.ResetAndDestroy();
		return OMX_ErrorInsufficientResources;
		}
	TInt index;
	CImplementationInformation* info;

	TOmxComponentInfo component;
	
	iComponentNameList.Reset();
	
	const TInt KEcomArrayCount = ecomArray.Count();
	for( index=0; index<KEcomArrayCount && error == KErrNone; ++index )
		{
		info = ecomArray[index];
		component.iUid = info->ImplementationUid();
		if( info->DisplayName().Length() >= OMX_MAX_STRINGNAME_SIZE || 
			info->DataType().Length() >= OMX_MAX_ROLESBUFFER_SIZE )
			{
			error = KErrBadName;
			break;
			}

		component.iComponentName.Copy(info->DisplayName());
		component.iRoles.Copy(info->DataType());

		error = iComponentNameList.Append(component);
		if(error)
			{
			break;
			}
		}
	ecomArray.ResetAndDestroy();
	if( error != KErrNone )
		{
		if( error == KErrNoMemory )
			{
			return OMX_ErrorInsufficientResources;
			}

		return OMX_ErrorUndefined;
		}
	return OMX_ErrorNone;
	}
void CMMFControllerImplementationInformation::ConstructL(const CImplementationInformation& aImplInfo)
	{
	iUriSchemes = new(ELeave) CDesC8ArrayFlat(KDesCArrayGranularity);
	iUid = aImplInfo.ImplementationUid();
	iDisplayName = aImplInfo.DisplayName().AllocL();
	iVersion = aImplInfo.Version();

	// Parse the opaque data...
	TaggedDataParser::ParseTaggedDataL(aImplInfo.OpaqueData(), *this);
	}
void CMMFFormatImplementationInformation::ConstructL(const CImplementationInformation& aImplInfo)
	{
	iUid = aImplInfo.ImplementationUid();
	iDisplayName = aImplInfo.DisplayName().AllocL();

	iBody = CMMFFormatImplementationInformation::CBody::NewL();

	// Extract the rest of the data from the opaque data field of aImplInfo...
	// Parse the opaque data...
	TaggedDataParser::ParseTaggedDataL(aImplInfo.OpaqueData(), *this);
	}
// ---------------------------------------------------------------------------
// Prepares filename from the displayname of the implementation.
// ---------------------------------------------------------------------------
//
void COMASuplPosTesterModuleCfg::PrepareFileName(TFileName& aOutputFileName, 
							const CImplementationInformation& aImplInfo)
	{
	TInt count = 0;
	TInt displayNameLength = aImplInfo.DisplayName().Length();

	for(count = 0; count < displayNameLength 
					&& count < KMaxFileName - 12; count++)
		{
		if(IsValidFileNameChar(aImplInfo.DisplayName().Ptr() + count))
			{
			aOutputFileName.Append(aImplInfo.DisplayName().Ptr() + count, 1);
			}
		}

	aOutputFileName.Append(_L("_"));
	aOutputFileName.Append(aImplInfo.ImplementationUid().Name().Ptr() + 1
					, aImplInfo.ImplementationUid().Name().Length() - 2);
	//Append file extension
	aOutputFileName.Append(_L(".txt"));
	}
// -----------------------------------------------------------------------------
// Load EBootstrapCallProvider marked or enabled plugins
// -----------------------------------------------------------------------------
//
void CCCEPluginManager::LoadBootPluginsL()
    {
    //List implementations
#ifdef _DEBUG
    RImplInfoPtrArray implementations;
    CConvergedCallProvider::ListImplementationsL(implementations);
    CCELOGSTRING2("CCCEPluginManager::GetPluginL: %d Implementation(s) found", 
        implementations.Count() );
        
    for( TInt i=0; i<implementations.Count(); i++ )
        {
        CImplementationInformation *info = implementations[i];
        
        CCELOGSTRING3("CCCEPluginManager::GetPluginL: Uid = %d, Name = %S", 
            info->ImplementationUid().iUid, &info->DisplayName() );
        CCELOGSTRING3("CCCEPluginManager::GetPluginL: ->RomBased = %d, RomOnly = %d", 
            info->RomBased(), info->RomOnly() );
        }
  
    implementations.ResetAndDestroy();
    implementations.Close();
#endif // _DEBUG
    
    RIdArray serviceIDArray;
    CleanupClosePushL( serviceIDArray );
    iSPSettings->GetServicesL( serviceIDArray );
    const TInt serviceCount = serviceIDArray.Count();
    iPrimaryEmergencyCallPlugin = NULL;
    TInt err = KErrNone;
    
    CCELOGSTRING2("CCCEPluginManager::LoadBootPluginsL: Service count: %d", serviceCount );
    for( TInt service = 0; service < serviceCount; service++ )
        {
        CCELOGSTRING2("CCCEPluginManager::LoadBootPluginsL: Processing service: %d", service );
        CCELOGSTRING2("CCCEPluginManager::LoadBootPluginsL: ServiceID: %d", serviceIDArray[service] );
        
        TRAP( err, LoadBootPluginL( serviceIDArray[service] ) )
        
        CCELOGSTRING2("CCCEPluginManager::LoadBootPluginsL: Result %i", err );
        }

    CleanupStack::PopAndDestroy();
    }
/**
CContactSynchroniser object factory method.

This class is copied from the Persistence Layer.  It should be refactored into
a shared library if possible.

@return CContactSynchroniser object.
*/
CContactSynchroniser* CContactSynchroniser::NewL()
	{
	RImplInfoPtrArray implInfoArray;
	CleanupResetAndDestroyPushL(implInfoArray);
	REComSession::ListImplementationsL(KUidEcomCntPhBkSyncInterface, implInfoArray);
	
	const TInt count = implInfoArray.Count(); 
	__ASSERT_ALWAYS(count > 0, User::Leave(KErrNotSupported));

	TInt pluginToBeUsed = 0;
	CImplementationInformation *info;

	// Scan the list of plugins for the test plugin.
	for (TInt plugIn = 0 ; plugIn < count ; ++plugIn)
	{
		info = implInfoArray[plugIn];
		if(info->DisplayName() == KTestPluginName)
		{
			// We have found the test plugin so use it rather than any other
			// plugin.
			pluginToBeUsed = plugIn;
			break;
		}
	}

	// Create the implementation found for KUidEcomCntPhBkSyncInterface.
	const TUid theImplementationID = implInfoArray[pluginToBeUsed]->ImplementationUid();
	
	TAny* ptr(NULL);
	ptr = REComSession::CreateImplementationL(theImplementationID, _FOFF(CContactSynchroniser,iDtor_ID_Key));

#ifdef __VERBOSE_DEBUG__
	RDebug::Print(_L("[CNTMODEL] CContactSynchroniser::NewL(): Create sync plugin: %S\n"), &info->DisplayName());
#endif

	CleanupStack::PopAndDestroy(&implInfoArray);

	return reinterpret_cast<CContactSynchroniser*>(ptr);
	}