os/kernelhwsrv/userlibandfileserver/fileserver/shostmassstorage/server/src/entry.cpp
First public contribution.
1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of the License "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
23 #include "cusbhostmsserver.h"
25 static void RunServerL()
27 // Perform all server initialisation, in particular creation of the
28 // scheduler and server and then run the scheduler
31 CUsbHostMsServer* iServer;
33 // naming the server thread after the server helps to debug panics
35 // create and install the active scheduler we need
36 CActiveScheduler* s=new(ELeave) CActiveScheduler;
37 CleanupStack::PushL(s);
38 CActiveScheduler::Install(s);
40 iServer = CUsbHostMsServer::NewLC();
41 CleanupStack::PushL(iServer);
44 // Initialisation complete, now signal the client
45 RProcess::Rendezvous(KErrNone);
48 CActiveScheduler::Start();
50 // Cleanup the server and scheduler
51 CleanupStack::PopAndDestroy(2);
56 // Server process entry-point
61 CTrapCleanup* cleanup=CTrapCleanup::New();