os/mm/devsound/a3fsrvstart/src/mmfaudioserverstart/mmfaudioserverstart.cpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/mm/devsound/a3fsrvstart/src/mmfaudioserverstart/mmfaudioserverstart.cpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,74 @@
     1.4 +// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +//
    1.18 +
    1.19 +// INCLUDE FILES
    1.20 +#include <e32std.h>
    1.21 +#include <a3f/mmfaudioserverinterface.h>
    1.22 +
    1.23 +// -----------------------------------------------------------------------------
    1.24 +// MainL
    1.25 +// Just an E32Main and a MainL()
    1.26 +// -----------------------------------------------------------------------------
    1.27 +//
    1.28 +LOCAL_C void MainL()
    1.29 +/**
    1.30 + * Much simpler, uses the new Rendezvous() call to sync with the client
    1.31 + */
    1.32 +	{
    1.33 +	// Leave the hooks in for platform security
    1.34 +#if (defined __DATA_CAGING__)
    1.35 +	RProcess().DataCaging(RProcess::EDataCagingOn);
    1.36 +	RProcess().SecureApi(RProcess::ESecureApiOn);
    1.37 +#endif
    1.38 +	CActiveScheduler* sched=NULL;
    1.39 +	sched=new(ELeave) CActiveScheduler;
    1.40 +	CActiveScheduler::Install(sched);
    1.41 +	CAudioSvrLoader* server = NULL;
    1.42 +	TRAPD(err,server = CAudioSvrLoader::NewL() );
    1.43 +	// Sync with the client
    1.44 +	RProcess::Rendezvous(err);
    1.45 +	if(err == KErrNone)
    1.46 +		{
    1.47 +		// enter the active scheduler
    1.48 +		sched->Start();
    1.49 +		}
    1.50 +	delete server;
    1.51 +	server = NULL;
    1.52 +	delete sched;
    1.53 +	sched = NULL;
    1.54 +	}
    1.55 +
    1.56 +// -----------------------------------------------------------------------------
    1.57 +// E32Main
    1.58 +// Just an E32Main and a MainL()
    1.59 +// -----------------------------------------------------------------------------
    1.60 +//
    1.61 +GLDEF_C TInt E32Main()
    1.62 +/**
    1.63 + * @return - Standard Epoc error code on exit
    1.64 + */
    1.65 +	{
    1.66 +	CTrapCleanup* cleanup = CTrapCleanup::New();
    1.67 +	if(!cleanup)
    1.68 +		{
    1.69 +		return KErrNoMemory;
    1.70 +		}
    1.71 +	TRAP_IGNORE(MainL());
    1.72 +	delete cleanup;
    1.73 +	cleanup = NULL;
    1.74 +	return KErrNone;
    1.75 +	}
    1.76 +
    1.77 +// End of file