sl@0: // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: #include sl@0: #include sl@0: sl@0: /** sl@0: * This function will Start Task Scheduler directly calling Schexe.exe sl@0: * It is used for test performance of Task Scheduler sl@0: */ sl@0: static void LaunchTaskSchedulerL() sl@0: { sl@0: sl@0: TRequestStatus stat; sl@0: RProcess server; sl@0: _LIT(KScheduleServerExe, "Schexe"); sl@0: sl@0: RDebug::Print(_L("Launching Task Scheduler via System Startup\n")); sl@0: sl@0: User::LeaveIfError(server.Create(KScheduleServerExe, _L("sysstartschexe"))); sl@0: server.Rendezvous(stat); sl@0: if (stat!=KRequestPending) sl@0: server.Kill(0); // abort startup sl@0: else sl@0: server.Resume(); // logon OK - start the server sl@0: User::WaitForRequest(stat); // wait for start or death sl@0: } sl@0: sl@0: sl@0: GLDEF_C TInt E32Main() sl@0: { sl@0: TInt err = KErrNoMemory; sl@0: CTrapCleanup* cleanup=CTrapCleanup::New(); //can fail sl@0: if (cleanup) sl@0: { sl@0: err = KErrNone; sl@0: TRAP(err, LaunchTaskSchedulerL()) sl@0: delete cleanup; sl@0: } sl@0: return err; sl@0: }