os/mm/devsound/devsoundrefplugin/src/platsec/server/AudioServer/MmfAudioServerStart.cpp
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/mm/devsound/devsoundrefplugin/src/platsec/server/AudioServer/MmfAudioServerStart.cpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,64 @@
1.4 +// Copyright (c) 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 <e32std.h>
1.20 +#include "MmfAudioServerStart.h"
1.21 +#include "MmfAudioServer.h"
1.22 +
1.23 +
1.24 +// EKA2 much simpler
1.25 +// Just an E32Main and a MainL()
1.26 +LOCAL_C void MainL()
1.27 +/**
1.28 + * Much simpler, uses the new Rendezvous() call to sync with the client
1.29 + */
1.30 + {
1.31 + // Leave the hooks in for platform security
1.32 +#if (defined __DATA_CAGING__)
1.33 + RProcess().DataCaging(RProcess::EDataCagingOn);
1.34 + RProcess().SecureApi(RProcess::ESecureApiOn);
1.35 +#endif
1.36 + CActiveScheduler* sched=NULL;
1.37 + sched=new(ELeave) CActiveScheduler;
1.38 + CActiveScheduler::Install(sched);
1.39 + CMMFAudioServer* server = NULL;
1.40 + TRAPD(err,server = CMMFAudioServer::NewL());
1.41 + RProcess::Rendezvous(err);
1.42 + if(!err)
1.43 + {
1.44 + // Sync with the client and enter the active scheduler
1.45 + sched->Start();
1.46 + }
1.47 + delete server;
1.48 + delete sched;
1.49 +
1.50 + }
1.51 +
1.52 +
1.53 +
1.54 +GLDEF_C TInt E32Main()
1.55 +/**
1.56 + * @return - Standard Epoc error code on exit
1.57 + */
1.58 + {
1.59 + CTrapCleanup* cleanup = CTrapCleanup::New();
1.60 + if(cleanup == NULL)
1.61 + {
1.62 + return KErrNoMemory;
1.63 + }
1.64 + TRAP_IGNORE(MainL());
1.65 + delete cleanup;
1.66 + return KErrNone;
1.67 + }