Beispiel #1
0
TInt RConsoleProxy::DoConnect(TServerParams* aParams, const TDesC& aThreadNameBase, TInt aStackSize, TInt aHeapMinSize, TInt aHeapMaxSize, RServer2& aServer, RThread& aServerThread)
	{
	TName threadName;
	RThread server;
	TInt threadId = 0;
	_LIT(KThreadIdFmt, "%08x");
	TInt err;
	do
		{
		threadName = aThreadNameBase.Left(threadName.MaxLength()-8);
		threadName.AppendFormat(KThreadIdFmt, threadId);
		err = server.Create(threadName, &ServerThreadFunction, aStackSize, aHeapMinSize, aHeapMaxSize, aParams);
		++threadId;
		} while (err==KErrAlreadyExists);
	if (err!=KErrNone) return err;
	
	TRequestStatus rendezvous;
	server.Rendezvous(rendezvous);
	if (rendezvous == KRequestPending)
		{
		server.Resume();
		}
	User::WaitForRequest(rendezvous);
	err = rendezvous.Int();
	if (server.ExitType() != EExitPending && err >= 0) err = KErrDied;
	if (err==KErrNone)
		{
		err = Connect(aParams->iServer);
		}
	aServer = aParams->iServer;
	aServerThread = server;
	return err;
	}
// ---------------------------------------------------------------------------
// CMmLineList::RemoveObject
// Marks a line object in array as not used
// ---------------------------------------------------------------------------
//
TInt CMmLineList::RemoveLine ( 
    const TName& aLineName )
    {
    TInt ret ( KErrGeneral );

    if ( iObjectContainer )
        {
        ret = KErrNone;
        if ( 0 == aLineName.CompareF( KMmTsyVoice1LineName ) )
            {
            iIsLineInUse[ ELine0Voice1 ] = EFalse;
            }
        else if ( 0 == aLineName.CompareF( KMmTsyVoice2LineName ) )
            {
            iIsLineInUse[ ELine1Voice2 ] = EFalse;
            }
        else if ( 0 == aLineName.CompareF( KMmTsyDataLineName ) )
            {
            iIsLineInUse[ ELine2Data ] = EFalse;
            }
        else if ( 0 == aLineName.CompareF( KMmTsyFaxLineName ) )
            {
            iIsLineInUse[ ELine3Fax ] = EFalse;
            }
        else
            {
            ret = KErrNotFound;
            }
        }
    return ret;
    }
TInt CTS_MultiHomingStep::GetResolverConfig(const TInt aIndex, TName &aHostName, TInt& aProtocol,																				 
										TBool& aExpectSuccess, TBool& aExpectTimeout, TBool& aExpectNotReady, 
										TBool& aExplicitResolve, TConnDetails **aConnDetails)
/**
 * Gets resolver configuration from file, using defaults if necessary
 * @param aIndex The index for the socket configkey
 * @param aHostName The host to be resolved
 * @param aProtocol The protocol to be used
 * @param aExpectSuccess Flag indicating if name should be resolved ok
 * @param aExpectTimeout Flag indicating if name resolution should timeout
 * @param aConnDetails The connection for an explicit resolver
 * @return System wide error code
 */
	{
	TInt err=KErrNone;	
	TName resolverName;		// Create the Key for the config lookup
	resolverName = KResolver;
	resolverName.AppendNum(aIndex);
	
	TPtrC ptrBuf;
	err = GetStringFromConfig(resolverName, KDestName, ptrBuf);
	if (!err)
		{
		LogExtra((TText8*)__FILE__, __LINE__, ESevrWarn, KEConfigFile);
		iTestStepResult= EInconclusive;
		return KErrNotFound;
		}
	aHostName.Copy(ptrBuf.Ptr(), ptrBuf.Length());
		
	
	aExpectSuccess = ETrue;
	GetBoolFromConfig(resolverName, KExpectSuccess, aExpectSuccess);
	
	aExpectTimeout = EFalse;
	GetBoolFromConfig(resolverName, KExpectTimeout, aExpectTimeout);

	aExpectNotReady = EFalse;
    GetBoolFromConfig(resolverName, KExpectNoDnsServer, aExpectNotReady);

	aExplicitResolve = EFalse;
	GetBoolFromConfig(resolverName, KExplicitResolve, aExplicitResolve);
		

	err = GetStringFromConfig(resolverName, KProtocol, ptrBuf);
	if (err && (ptrBuf.Compare(KTcp)==0))
		aProtocol = KProtocolInetTcp;
	else
		aProtocol = KProtocolInetUdp;	
		
	
	err = GetStringFromConfig(resolverName, KConnName, ptrBuf);
	if (!err)
		{
		return KErrNotFound;
		}		

	*aConnDetails = iOwnerSuite->GetTConnection(ptrBuf);								

	return KErrNone;
	}
// ---------------------------------------------------------------------------
// CMmLineList::AddLineObject
// Adds a TSY to the Line list
// ---------------------------------------------------------------------------
//
TInt CMmLineList::AddLineObject ( 
    CTelObject* aTsyObject, const TName& aLineName )
    {
    TInt ret ( KErrGeneral );
    
OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMLINELIST_ADDLINEOBJECT_1, "TSY: CMmLineList::AddLineObject");
    if ( iObjectContainer )
        {
OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMLINELIST_ADDLINEOBJECT_2, "TSY: CMmLineList::AddLineObject:iObjectContainer->Count()=%d", iObjectContainer->Count());

        
        TInt trapError( KErrNone );    

        if ( 0 == aLineName.CompareF( KMmTsyVoice1LineName ) )
            {
            iIsLineInUse[ ELine0Voice1 ] = ETrue;
            iObjectContainer->Delete( ELine0Voice1 );
            iObjectContainer->Compress();
            TRAP( trapError, iObjectContainer->InsertL( ELine0Voice1, 
                                                        aTsyObject ) );
            }
        else if ( 0 == aLineName.CompareF( KMmTsyVoice2LineName ) )
            {
            iIsLineInUse[ ELine1Voice2 ] = ETrue;
            iObjectContainer->Delete( ELine1Voice2 );
            iObjectContainer->Compress();
            TRAP( trapError, iObjectContainer->InsertL( ELine1Voice2, 
                                                        aTsyObject ) );
            }
        else if ( 0 == aLineName.CompareF( KMmTsyDataLineName ) )
            {
            iIsLineInUse[ ELine2Data ] = ETrue;
            iObjectContainer->Delete( ELine2Data );
            iObjectContainer->Compress();
            TRAP( trapError, iObjectContainer->InsertL( ELine2Data,
                                                        aTsyObject ) );
            }
        else if ( 0 == aLineName.CompareF( KMmTsyFaxLineName ) )
            {
            iIsLineInUse[ ELine3Fax ] = ETrue;
            iObjectContainer->Delete( ELine3Fax );
            iObjectContainer->Compress();
            TRAP( trapError, iObjectContainer->InsertL( ELine3Fax,
                                                        aTsyObject ) );
            }
        //Check the trap error
        if ( KErrNone != trapError )
            {
            //change return value to indicate out of memory error
            ret = KErrNoMemory;
            }
        else
            {
            //success return value
            ret = KErrNone;
            iInitialised = ETrue;
            }
        }
    return ret;
    }
// ---------------------------------------------------------------------------
// CMmCallList::RemoveCallsByLine
// Removes Call objects from Call list that has been opened 
// from the Line (which name is given as a input parameter).
// ---------------------------------------------------------------------------
//
void CMmCallList::RemoveCallsByLine(
    const TName* aLineName )
    {
    //if call list exists
    if ( iObjectContainer )
        {
        TInt callCount = iObjectContainer->Count();
        TInt index( 0 );
        //search through call list
        for ( TInt i = 0; i < callCount; i++ )
            {
            //get current call
            CMmCallTsy* mmCall = 
              reinterpret_cast<CMmCallTsy*>( iObjectContainer->At( index ) );

            //get the name of the line from which this call has been opened.
            //see class CMmLineTsy to see how the call object naming works.
            TName curLineName = mmCall->
                                    CallName().Left( aLineName->Length() );

            //if the name is the same as the line name given as input param.
            if ( curLineName.Compare( *aLineName ) == 0 )
                {
                //close this call
                mmCall->Close();
                index--;
                }
            index++;
            }
        }
    }
// -----------------------------------------------------------------------------
// TMSCallServer::StartThreadL
//
// -----------------------------------------------------------------------------
//
void TMSCallServer::StartThreadL(TMSCallServerStartParam& aStart)
    {
    TRACE_PRN_FN_ENT;

    CActiveScheduler* sched = new (ELeave) CActiveScheduler;
    CleanupStack::PushL(sched);

    CActiveScheduler::Install(sched);
    TMSCallServer* server = TMSCallServer::NewL(aStart.iTMSServer);
    CleanupStack::PushL(server);

    //Rename tmscall server name
    RThread tmscallServerThread;
    TThreadId threadId;
    TName name;
    name.Append(KTMSCallServerName);
    threadId = tmscallServerThread.Id();
    name.AppendNum(threadId.Id(), EHex);
    //We are ignoring the error code returned from User::RenameThread
    //as it is not important here, may be for profiling
    User::RenameThread(name);

    aStart.iTMSCallServerHandle = server->Server();
    // Sync with the client and enter the active scheduler
    RThread::Rendezvous(KErrNone);
    sched->Start();

    CleanupStack::PopAndDestroy(server); // server
    CleanupStack::PopAndDestroy(sched); // sched

    TRACE_PRN_FN_EXT;
    }
enum TVerdict CTestIdna07::doTestStepL()
	{

	INFO_PRINTF1(_L(" Testing Punycode to IDN Conversion functionality   "));
	INFO_PRINTF1(_L("****************************************************"));
	
	SetTestStepResult(EFail); // By default start the test case with failure.	
	
	_LIT8(KPunyCodeName,"xn--rksmrgs-5wao1o.josefsson.org");
	TPunyCodeDndName punyCodeName;
	punyCodeName.Copy(KPunyCodeName());
	
	_LIT(KIDNName1,"räksmörgås.josefsson.org");
	
	TName myHostName ;
	TInt start =0;
	
	TInt err=punyCodeName.PunycodeToIdn(myHostName,start);
	if(err != KErrNone)
		{
		User::LeaveIfError(KErrNone); // just to suppress the LeaveScan warning
		INFO_PRINTF1(_L("Conversion of Punycode to IDN is NOT successful "));
		SetTestStepResult(EFail);
		return TestStepResult();
		}
	
	if( myHostName.Compare(KIDNName1()) == 0)
		{
		INFO_PRINTF1(_L(" Conversion of Punycode to IDN is successful"));
		SetTestStepResult(EPass);
		}
	
	return TestStepResult();
	}
Beispiel #8
0
/**
*   Load network iformation (hosts names) from ini file.
*
*   @param aNetworkInfo ref. to the TNetworkInfo structure, which will be populated
*/
void   CTestStepLLMNR_Init::LoadNetworkConfigFromIniL(TNetworkInfo&  aNetworkInfo)
    {
    TName   tmpBuf;
    TInt    nRes;
    
    //-- get number of hosts which are supposed to be running
    //-- there should be at last 2 host names in the list
    TESTL(GetIntFromConfig(KNodesSection, _L("NumNodes"), nRes) && nRes >= KMinNodes);
    const TInt numNodes = nRes;  
    
    //-- get maximal number of trials of host hame resolution
    TESTL(GetIntFromConfig(KNodesSection, _L("ConnectTrials"), nRes) && nRes >= 1);
    const TInt maxTrials = nRes;  
    
    //-- populate NetworkInfo array with information from ini file.
    TNodeInfo nodeInfo;
    
    for(TInt i=0; i<numNodes; ++i)
        {
        //-- get host name from ini file
        tmpBuf.Format(_L("HostName%d"),i+1);
        if(!GetIniFileString(KNodesSection, tmpBuf, nodeInfo.iHostName))  
            continue;
        
        //-- put host info to the array
        nodeInfo.iCntTrials = maxTrials;
        aNetworkInfo.AppendNode(nodeInfo);
        }
    
    //-- check number of hosts to communicate with.
    TESTL(aNetworkInfo.NodesCount() >= KMinNodes);
    }
/**
Function to initialize the phone settings
@return TBool
*/
TBool CMBMSEngine::InitialisePhoneL()
	{
#ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
	CMDBSession* dbSession = CMDBSession::NewL(KCDVersion1_2);
#else
	CMDBSession* dbSession = CMDBSession::NewL(KCDVersion1_1);
#endif
    CleanupStack::PushL(dbSession);

	CMDBRecordSet<CCDGlobalSettingsRecord> globalSettingsRecord(KCDTIdGlobalSettingsRecord);
    TRAPD(err, globalSettingsRecord.LoadL(*dbSession));
    if(err != KErrNone)
      {
      User::Leave(KErrNotFound);
      }

    CCDModemBearerRecord *modemBearerRecord = static_cast<CCDModemBearerRecord*>(CCDRecordBase::RecordFactoryL(KCDTIdModemBearerRecord));
    CleanupStack::PushL(modemBearerRecord);

    modemBearerRecord->SetRecordId(((CCDGlobalSettingsRecord*)globalSettingsRecord.iRecords[0])->iModemForPhoneServicesAndSMS);
    TRAPD(err1,modemBearerRecord->LoadL(*dbSession));

    if(err1 != KErrNone)
      {
      User::Leave(KErrNotFound);
      }

    TName tsyName;
    tsyName = modemBearerRecord->iTsyName;
    //leave if not able to read Tsy name.
    if(tsyName.Length() == 0)
	  {
      User::Leave(KErrNotFound);
	  }

    CleanupStack::PopAndDestroy(modemBearerRecord);
    CleanupStack::PopAndDestroy(dbSession);

    User::LeaveIfError(iTelServer.Connect());
	User::LeaveIfError(iTelServer.LoadPhoneModule(tsyName));
	User::LeaveIfError(iTelServer.SetExtendedErrorGranularity(RTelServer::EErrorExtended));

	//Open telephony server
	GetPhoneInfoL(iTelServer,tsyName,iPhoneInfo);

	//Open phone
	User::LeaveIfError(iPhone.Open(iTelServer,iPhoneInfo.iName));
	//Get phone status
	User::LeaveIfError(iPhone.GetStatus(iPhoneStatus));

	SetActive();
	iPhoneState = EInitialising;

	TRequestStatus* status = &iStatus;
	User::RequestComplete(status, KErrNone);

	return ETrue;
	}
Beispiel #10
0
void CTestList::SelectedL(TInt aIndex)
{
#if USE_PROCESS
    TThreadParams params;
    params.iIndex=aIndex;
    TName name;
    name.Format(_L("TimeTest-%x"),iCount++);
    params.iGroupId=Client()->iGroup->GroupWin()->Identifier();
    User::LeaveIfError(iTimeTest.Create(name,TimeThread,KDefaultStackSize*2,KHeapSize,KHeapSize,&params,EOwnerThread));
    TRequestStatus status;
    iTimeTest.Logon(status);
    __PROFILE_RESET(8);
    iTimeTest.Resume();
    User::WaitForRequest(status);
#else
    TThreadParams params;
    params.iIndex=aIndex;
    TimeThread(&params);
#endif
    TBuf<64> buf;
    TBuf<64> buf2;
    TBuf<64> buf3;
    CResultDialog *dialog=new(ELeave) CResultDialog(Client()->iGroup, iGc);
    dialog->ConstructLD();
#if USE_PROCESS
    if (status.Int()==KErrNone)
    {
#endif
#if !defined(__PROFILING__)
        buf=_L("Profiling information not available");
#else
        TProfile profile[6];
        __PROFILE_DISPLAY(6);
        for (TInt index=1; index<6; index++)
            AppendProfileNum(buf2,profile[index].iTime);
        for (TInt index2=1; index2<6; index2++)
            AppendProfileCount(buf3,profile[index2].iCount);
        buf.Format(_L("Time=%d.%2d"),profile[0].iTime/1000000,(profile[0].iTime%1000000)/10000);
#endif
        dialog->SetTitle(buf);
#if USE_PROCESS
    }
    else
    {
        dialog->SetTitle(_L("Error in test"));
        buf.Format(_L("Error=%d"),status.Int());
        buf2=iTimeTest.ExitCategory();
    }
#endif
    dialog->SetLine1(buf2);
    dialog->SetLine2(buf3);
    dialog->SetNumButtons(1);
    dialog->SetButtonText(0,_L("Okay"));
    if (dialog->Display()!=0)
        Panic(0);
}
Beispiel #11
0
TString TOutputGLSLBase::hashFunctionNameIfNeeded(const TName &mangledName)
{
    TString mangledStr = mangledName.getString();
    TString name = TFunction::unmangleName(mangledStr);
    if (mSymbolTable.findBuiltIn(mangledStr, mShaderVersion) != nullptr || name == "main")
        return translateTextureFunction(name);
    if (mangledName.isInternal())
        return name;
    else
        return hashName(name);
}
Beispiel #12
0
TString DecorateIfNeeded(const TName &name)
{
    if (name.isInternal())
    {
        return name.getString();
    }
    else
    {
        return Decorate(name.getString());
    }
}
Beispiel #13
0
TString DecorateFunctionIfNeeded(const TName &name)
{
    if (name.isInternal())
    {
        return TFunction::unmangleName(name.getString());
    }
    else
    {
        return Decorate(TFunction::unmangleName(name.getString()));
    }
}
// -----------------------------------------------------------------------------
// MceServerStarter::CreateServerProcess
// -----------------------------------------------------------------------------
//
TInt MceServerStarter::CreateServerProcess (RSemaphore& aSemaphore)
	{
	const TUidType serverUid (KNullUid, KNullUid, KServerUid3);


#if ((defined (__WINS__) || defined(__WINSCW__)) && !defined (EKA2))

	RLibrary lib;
    RETURN_IF_ERROR (lib.Load(KMceServerFilename,serverUid))

    //  Get the WinsMain function
	TLibraryFunction functionWinsMain = lib.Lookup (1);

    //  Call it and cast the result to a thread function
	TThreadFunction serverThreadFunction = 
        reinterpret_cast<TThreadFunction> (functionWinsMain());

	TName threadName (KSipServerName);

	// Append a random number to make it unique
	threadName.AppendNum (Math::Random(), EHex);

	RThread server;
    TInt err = server.Create (threadName,
                              serverThreadFunction, // thread's main function
                              KDefaultStackSize,
                              NULL,
                              &lib,
                              NULL,
                              KServerMinHeapSize,
                              KServerMaxHeapSize,
                              EOwnerProcess );

	lib.Close ();	// if successful, server thread has handle to library now
    RETURN_IF_ERROR (err)

	server.SetPriority (EPriorityMore);

#else // HW build

	RProcess server;
	RETURN_IF_ERROR (server.Create( KMceServerName, KNullDesC, serverUid ) )

#endif


	server.Resume ();
	aSemaphore.Wait();
	TInt exitReason = server.ExitReason();
	server.Close ();

    return exitReason;
	}
/**
@SYMTestCaseID          SYSLIB-STORE-CT-1191
@SYMTestCaseDesc	    Lock out of dictionary files test
@SYMTestPriority 	    High
@SYMTestActions  	    Attempt for opening of same dictionary file.Tests for file in use error
@SYMTestExpectedResults Test must not fail
@SYMREQ                 REQ0000
*/
void ContentionTestL()
	{
	test.Start(_L(" @SYMTestCaseID:SYSLIB-STORE-CT-1191 Contention tests "));
	
	TDriveUnit drive(static_cast<TUint>(RFs::GetSystemDrive()));	
	TParse testIniFile;
	testIniFile.Set(drive.Name(), &KTestIniFile, NULL);
	
	CDictionaryStore* dict=CDictionaryFileStore::OpenLC(TheFs,testIniFile.FullName(),KTestUid);
	TIniData data;
	data.SaveL(*dict);
	CleanupStack::PopAndDestroy(); // dict

	test.Next(_L("Lock-out test"));
	CDictionaryFileStore::OpenLC(TheFs,testIniFile.FullName(),KTestUid);
	TUint tick=User::TickCount();
	TRAPD(r,CDictionaryFileStore::OpenL(TheFs,testIniFile.FullName(),KTestUid));
	tick=User::TickCount()-tick;
	test (r==KErrInUse);
	test.Printf(_L("Lock-out discovered: %d ticks\r\n"),tick);
	CleanupStack::PopAndDestroy();

	test.Next(_L("Creating threads"));
	RThread threads[KNumThreads];
	TRequestStatus status[KNumThreads];
	TInt ii;
	for (ii=0;ii<KNumThreads;++ii)
		{
		TName name;
		name.Format(_L("Test_%d"),ii);
		test (threads[ii].Create(name,ThreadTest,KThreadStack,KThreadHeap,KThreadHeapMax,(TAny*)ii,EOwnerThread)==KErrNone);
		threads[ii].SetPriority(EPriorityLess);
		threads[ii].Logon(status[ii]);
		test (status[ii]==KRequestPending);
		}

	for (ii=0;ii<KNumThreads;++ii)
		threads[ii].Resume();

	test.Next(_L("Waiting for completion"));
	for (ii=0;ii<KNumThreads;++ii)
		User::WaitForAnyRequest();
	TInt success=0;
	for (ii=0;ii<KNumThreads;++ii)
		{
		test (status[ii]!=KRequestPending);
		if (status[ii].Int()==KErrNone)
			++success;
		}
	test.Printf(_L("Thread success: %d of %d\r\n"),success,KNumThreads);
	test.End();
	}
Beispiel #16
0
TString DecorateVariableIfNeeded(const TName &name)
{
    if (name.isInternal())
    {
        // The name should not have a prefix reserved for user-defined variables or functions.
        ASSERT(name.getString().compare(0, 2, "f_") != 0);
        ASSERT(name.getString().compare(0, 1, "_") != 0);
        return name.getString();
    }
    else
    {
        return Decorate(name.getString());
    }
}
Beispiel #17
0
void TestRename()
	{
	TName name;

	test.Start(_L("Renaming the current process with User::RenameProcess"));
	name = RProcess().Name();
	name.SetLength(KTestProcessName().Length());
	test(name.CompareF(KTestProcessName)!=0);
	User::RenameProcess(KTestProcessName);
	name = RProcess().Name();
	name.SetLength(KTestProcessName().Length());
	test(name.CompareF(KTestProcessName)==0);


	test.End();
	}
/**
Wait for message completion by the helper process

@param  aProcessLog if ETrue, log messages from the helper process will be logged by TEF
@return             error code, result of the message processing.
*/
TInt CSyncMessageSender::WaitForMsgComplete(TBool aProcessLog/*=ETrue*/)
{
    if( !aProcessLog )
    {   //-- don't need to process messages from the helper process
        User::WaitForRequest(iMsgRqStat);
        return iMsgRqStat.Int();
    }

    //-- wait for message completion processing logs from the helper process
    TName logBuf;

    for(;;)
    {
        iLogMsgQueue.NotifyDataAvailable(iLogRqStat);
        User::WaitForRequest(iMsgRqStat, iLogRqStat);

        if(iLogRqStat.Int() == KRequestPending)
        {   //-- iMsgRqStat has been completed, the pessage has been processed
            //-- cancel waiting for the log messages.
            iLogMsgQueue.CancelDataAvailable();
            User::WaitForRequest(iLogRqStat);
            break;
        }
        else
        {   //-- log message has been posted to the queue, pull all log messages up and process them
            TIPLogMsg   logMsg;
            TInt        nRes;

            for(;;)
            {
                nRes = iLogMsgQueue.Receive(logMsg);
                if(nRes != KErrNone)
                    break;

                if(ipLogger)
                {   //-- logger is available, log the message.
                    logBuf.Copy(_L("\t~helper: "));
                    logBuf.Append(logMsg.iLogMsg);
                    ipLogger->Write(logBuf);
                }
            }//for(;;)
        }
    }//for(;;)


    return iMsgRqStat.Int();
}
/**
@SYMTestCaseID BA-CTSY-SESMG-TGTN-0001
@SYMComponent  telephony_ctsy
@SYMTestCaseDesc Test support in CTSY for RTelServer::GetTsyName
@SYMTestPriority High
@SYMTestActions Invokes RTelServer::GetTsyName
@SYMTestExpectedResults Pass
@SYMTestType CT
*/
void CCTsySessionManagementFU::TestGetTsyName0001L()
	{

	OpenEtelServerL(EUseExtendedError);
	CleanupStack::PushL(TCleanupItem(Cleanup,this));

	TInt index(0);
	TName tsyName;
	
	_LIT(KTsyName, "PHONETSY");
	
	TInt ret = iTelServer.GetTsyName(index, tsyName);
	ASSERT_EQUALS(KErrNone, ret);
	ASSERT_EQUALS(0, tsyName.Compare(KTsyName));
	
	CleanupStack::PopAndDestroy(1, this);
	
	}
Beispiel #20
0
TString DecorateUniform(const TName &name, const TType &type)
{
    if (type.getBasicType() == EbtSamplerExternalOES)
    {
        return "ex_" + name.getString();
    }

    return DecorateIfNeeded(name);
}
Beispiel #21
0
void CTsyConfig::GetRequestedTableViewsL()
	{
	
	if (iDbSession == NULL)
		{
#ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
		iDbSession = CMDBSession::NewL(KCDVersion1_2);
#else
		iDbSession = CMDBSession::NewL(KCDVersion1_1);
#endif
		__ASSERT_DEBUG(iDbSession,Panic(ETsyConfigNullDBPointer));
				
		iModemBearer = 0;

		CMDBField<TUint32>* bearerField = new(ELeave) CMDBField<TUint32>(KCDTIdIAPBearer);
		CleanupStack::PushL(bearerField);
		bearerField->SetRecordId(iMMTableSettings.iLocId);
		bearerField->LoadL(*iDbSession);
		iModemBearer = *bearerField;
		CleanupStack::PopAndDestroy(bearerField);
		}
		
		TName modem;
		CMDBField<TDesC>* tsyField = new(ELeave) CMDBField<TDesC>(KCDTIdTsyName);
		CleanupStack::PushL(tsyField);
		tsyField->SetRecordId(iModemBearer);
		tsyField->SetMaxLengthL(KMaxTextLength);
		tsyField->LoadL(*iDbSession);
		modem = *tsyField;
		CleanupStack::PopAndDestroy(tsyField);
		

		if(modem.Compare(_L("MM"))!=KErrNone)
			{
			// Selected bearer does not mention the MMTSY
			LOCAL_LOGTEXT("GetCurrentSettingsL","Bearer for selected IAP does not use MMTSY");
			__ASSERT_DEBUG(EFalse,Panic(ETsyConfigMMTSYNotInModemTables));
			User::Leave(KErrNotFound);
			}



	}
Beispiel #22
0
TBool CFsObjectCon::NamesMatch(const TName& anObjectName, const CFsObject* aCurrentObject) const
//
// 
//
	{

	if (aCurrentObject->iName==NULL) // current object has no name, therefore not the same
		return(EFalse);
	return(anObjectName.Compare(*aCurrentObject->iName)==0); // short names are different, therefore not the same
	}
// ---------------------------------------------------------------------------
// Creates server name
// ---------------------------------------------------------------------------
//    
EXPORT_C void RAlfClientBase::ConstructServerName( TName& aServerName, 
                                        TUid aAppServerUid, 
                                        TUint aServerDifferentiator )
    {

    _LIT(KServerNameFormat, "%08x_%08x_AppServer");
    aServerName.Format( 
        KServerNameFormat, 
        aServerDifferentiator, 
        aAppServerUid.iUid );
    }    
// ---------------------------------------------------------------------------
// CMmCallList::GetMmCallByIndexAndLine
// Returns call object by index and line.
// ---------------------------------------------------------------------------
//
CMmCallTsy* CMmCallList::GetMmCallByIndexAndLine(
    TInt aIndex,
    const TName* aLineName )
    {

    CMmCallTsy* mmCall = NULL;
    CMmCallTsy* mmCallSeek = NULL;

    TInt callCount = iObjectContainer->Count();
    TInt index( 0 );

    //search through call list
    for ( TInt i = 0; i < callCount; i++ )
        {
        //get current call
        mmCallSeek = reinterpret_cast<CMmCallTsy*>(
            iObjectContainer->At( i ) );

        //get the name of the line from which this call has been opened.
        //see class CMmLineTsy to see how the call object naming works.
        TName curLineName = mmCallSeek->
                                CallName().Left( aLineName->Length() );

        //if the name is the same as the line name given as input parameter
        if ( curLineName.Compare( *aLineName ) == 0 )
            {
            if ( index == aIndex )
                {
                //Break out
                mmCall = mmCallSeek;
                i = callCount;
                }
            else
                {
                index++;
                }
            }
        }

    return mmCall;
    }
// -----------------------------------------------------------------------------
// CHttpConnHandler::ConnectionNameL
// ?implementation_description
// (other items were commented in a header).
// -----------------------------------------------------------------------------
//
HBufC* CHttpConnHandler::ConnectionNameL( TBool& aDelete )
    {
    if( iConnName )
        {
        aDelete = EFalse;
        return iConnName;
        }
    else if( iConnection.SubSessionHandle() )
        {
        TName connName;

        aDelete = ETrue;

        iConnection.Name( connName );

        return connName.AllocL();
        }

    aDelete = EFalse;
    return NULL;
    }
void CTestConfig::ParseAndSetItemValueL(const TDesC8& aText, const TLex8& aInput, TInt aCurrentItemStart, CTestConfigItem*& arCurrentItem)
	{
	if (arCurrentItem)
		{
		delete arCurrentItem->iValue;
		arCurrentItem->iValue = NULL;

		TPtrC8 val(ParseValue(aText, aInput, aCurrentItemStart));
		arCurrentItem->iValue = ReplaceLC(KScriptCRLF, KScriptLF, val);
		arCurrentItem->iValue->Des().Trim();
		CleanupStack::Pop(arCurrentItem->iValue);

		if (arCurrentItem->Item().CompareF(KScriptDefaults) == 0)
			{
			TName filename;
			filename.Copy(arCurrentItem->Value());
			CopyInDefaultsL(arCurrentItem->iParent, filename);
			}
		}

	arCurrentItem = NULL;
	}
Beispiel #27
0
EXPORT_C TInt TFsPluginRequest::FileName(TDes& aName)
	{
	//Special handling required for directories.
	switch(Function())
		{
		case EFsDirOpen:
		case EFsSetEntry:
			{
			aName.Copy(Request()->Src().FullName());
			break;
			}
		case EFsDirReadOne:
		case EFsDirReadPacked:
		case EFsDirSubClose:
			{
			//Get the name from CDirCB::iName
			CDirCB* dir = (CDirCB*) ScratchValue();
			__ASSERT_ALWAYS(dir!= NULL, Fault(EPluginOpError));
			TName name = dir->Name();
			if(name.Size() == 0)
				{
				return KErrNotFound;
				}
			aName.Copy(name);
			break;
			}
		default:
			{
			CFileShare* share;
			TInt err = ShareFromClientHandle(share);
			if(err != KErrNone || share == NULL)
				return(err);
			
			NameFromShare(*share, aName);
			}
		}
	return KErrNone;
	}
void CMMFAudioPolicyServer::StartThreadL(TServerStart& aStart)
{
    CActiveScheduler* sched = new(ELeave) CActiveScheduler;
    CleanupStack::PushL(sched);

    CActiveScheduler::Install(sched);
    //Rename Audio Policy server name
    RThread audioPolicyThread;
    TName name;
    name.Append(KMMFAudioPolicyServerName);
    //We are ignoring the error code returned from User::RenameThread
    //as it is not important here, may be for profiling
    User::RenameThread(name);
    CMMFAudioPolicyServer* server = CMMFAudioPolicyServer::NewL();
    CleanupStack::PushL(server);

    aStart.iPolicyServerHandle = server->Server();
    // Sync with the client and enter the active scheduler
    RThread::Rendezvous(KErrNone);
    sched->Start();

    CleanupStack::PopAndDestroy(2, sched); // sched, server
}
// ---------------------------------------------------------------------------
// CMmCallList::GetMmCallByName
// Returns call object by name.
// ---------------------------------------------------------------------------
//
CMmCallTsy* CMmCallList::GetMmCallByName(
    const TName* aName )
    {
    CMmCallTsy* mmCall = NULL;
    CMmCallTsy* mmCallSeek = NULL;

    if ( iObjectContainer )
        {
        for ( TInt i = 0; i < iObjectContainer->Count(); i++ )
            {
            mmCallSeek = reinterpret_cast<CMmCallTsy*>(
                iObjectContainer->At( i ) );  

            TName aCurrCallName = mmCallSeek->CallName();
            if ( aCurrCallName.Compare( *aName ) == KErrNone )
                {
                mmCall = mmCallSeek;
                break;
                }
            }
        }

    return mmCall;
    }
void CListCertificates::TestAction()
	{
	TInt count = iCertInfos.Count();
	if (count == iExpectedLabels.Count())
		{
		TInt i;
		for (i = 0; i < count; i++)
			{
			TName expected;
			TName retrieved;
			expected.Copy(iExpectedLabels[i].iName.Ptr());
			retrieved.Copy(iCertInfos[i]->Label());
			if (expected.Compare(retrieved))
				{
				break;
				}

			// this fails the test if any of the certs are marked as not
			// deletable
			if (iCertInfos[i]->IsDeletable() != !iExpectedLabels[i].iReadOnly)
				break;
			}
		if (i == count)
			{
			iResult = ETrue;
			}
		else 
			{
			iResult = EFalse;
			}
		}
	else
		{
		iResult = EFalse;
		}
	}