diff -r 000000000000 -r 40261b775718 mmlibs/mmfw/SecureDRM/src/Server/MmfDrmPluginServerStart.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmlibs/mmfw/SecureDRM/src/Server/MmfDrmPluginServerStart.cpp Tue Feb 02 01:56:55 2010 +0200 @@ -0,0 +1,64 @@ +// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + +#include +#include +#include "MmfDrmPluginServerStart.h" +#include "MmfDrmPluginServer.h" + + +// E32Main and a MainL() +LOCAL_C void MainL() +/** + * Much simpler, uses the new Rendezvous() call to sync with the client + */ + { + // Leave the hooks in for platform security + RProcess().DataCaging(RProcess::EDataCagingOn); + RProcess().SecureApi(RProcess::ESecureApiOn); + + CActiveScheduler* sched=NULL; + sched=new(ELeave) CActiveScheduler; + CActiveScheduler::Install(sched); + CMMFDRMPluginServer* server = NULL; + TRAPD(err,server = CMMFDRMPluginServer::NewL()); + if(!err) + { + // Sync with the client and enter the active scheduler + RProcess::Rendezvous(KErrNone); + sched->Start(); + } + delete server; + delete sched; + } + + +GLDEF_C TInt E32Main() +/** + * @return - Standard Epoc error code on exit + */ + { + __UHEAP_MARK; + CTrapCleanup* cleanup = CTrapCleanup::New(); + if(cleanup == NULL) + { + return KErrNoMemory; + } + TRAPD(err, MainL()); + delete cleanup; + REComSession::FinalClose(); + __UHEAP_MARKEND; + return err; + }