installationservices/swtransactionservices/test/tintegrityservices/source/e32main.cpp
branchRCL_3
changeset 26 8b7f4e561641
parent 25 7333d7932ef7
child 27 e8965914fac7
equal deleted inserted replaced
25:7333d7932ef7 26:8b7f4e561641
     1 /*
       
     2 * Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 * E32MAIN
       
    16 * Entry point for Test TIntegrityServices Server
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 #include <e32std.h>
       
    22 #include <e32base.h>
       
    23 #include "tintegrityservicesserver.h"
       
    24 
       
    25 // Perform server initialisation, in particular creation of the scheduler and 
       
    26 // server and then run the scheduler
       
    27 static void RunServerL()
       
    28 	{
       
    29 	// Naming the server thread after the server helps to debug panics
       
    30 	User::LeaveIfError(RThread().RenameMe(KIntegrityServicesServer));
       
    31 	// Create and install the active scheduler we need
       
    32 	CActiveScheduler* s= new(ELeave) CActiveScheduler;
       
    33 	CleanupStack::PushL(s);
       
    34 	CActiveScheduler::Install(s);
       
    35 	// Create the server and leave it on the cleanup stack
       
    36 	Usif::CIntegrityServicesServer::NewLC();
       
    37 	// Init complete, signal the client
       
    38 	RProcess::Rendezvous(KErrNone);
       
    39 	// Ready to run
       
    40 	CActiveScheduler::Start();
       
    41 	// Cleanup server and scheduler
       
    42 	CleanupStack::PopAndDestroy(2);
       
    43 	}
       
    44 
       
    45 //
       
    46 // Server process entry point
       
    47 //
       
    48 
       
    49 TInt E32Main()
       
    50 	{
       
    51 	__UHEAP_MARK;
       
    52 	CTrapCleanup* cleanup=CTrapCleanup::New();
       
    53 	TInt err=KErrNoMemory;
       
    54 	if (cleanup)
       
    55 		{
       
    56 		TRAP(err, RunServerL());
       
    57 		delete cleanup;
       
    58 		}
       
    59 	__UHEAP_MARKEND;
       
    60 	return err;
       
    61 	}