1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/mm/mmlibs/mmfw/SecureDRM/src/Server/MmfDrmPluginServerStart.cpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,64 @@
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 <e32std.h>
1.20 +#include <ecom/ecom.h>
1.21 +#include "MmfDrmPluginServerStart.h"
1.22 +#include "MmfDrmPluginServer.h"
1.23 +
1.24 +
1.25 +// 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 + RProcess().DataCaging(RProcess::EDataCagingOn);
1.33 + RProcess().SecureApi(RProcess::ESecureApiOn);
1.34 +
1.35 + CActiveScheduler* sched=NULL;
1.36 + sched=new(ELeave) CActiveScheduler;
1.37 + CActiveScheduler::Install(sched);
1.38 + CMMFDRMPluginServer* server = NULL;
1.39 + TRAPD(err,server = CMMFDRMPluginServer::NewL());
1.40 + if(!err)
1.41 + {
1.42 + // Sync with the client and enter the active scheduler
1.43 + RProcess::Rendezvous(KErrNone);
1.44 + sched->Start();
1.45 + }
1.46 + delete server;
1.47 + delete sched;
1.48 + }
1.49 +
1.50 +
1.51 +GLDEF_C TInt E32Main()
1.52 +/**
1.53 + * @return - Standard Epoc error code on exit
1.54 + */
1.55 + {
1.56 + __UHEAP_MARK;
1.57 + CTrapCleanup* cleanup = CTrapCleanup::New();
1.58 + if(cleanup == NULL)
1.59 + {
1.60 + return KErrNoMemory;
1.61 + }
1.62 + TRAPD(err, MainL());
1.63 + delete cleanup;
1.64 + REComSession::FinalClose();
1.65 + __UHEAP_MARKEND;
1.66 + return err;
1.67 + }