securitydialogs/SecUi/Src/SecUiObsStartter.cpp
changeset 0 164170e6151a
equal deleted inserted replaced
-1:000000000000 0:164170e6151a
       
     1 /*
       
     2 * Copyright (c) 2002 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 "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:  Implementation of TObsStarter, which provides api
       
    15 *               for starting SecurityObserver.exe
       
    16 *
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 // INCLUDES
       
    22 #include <eikdll.h>
       
    23 #include <data_caging_path_literals.hrh> 
       
    24 
       
    25 #include "SecUiObsStartter.h"
       
    26 
       
    27 
       
    28 //  LOCAL CONSTANTS AND MACROS  
       
    29 _LIT(ObserverName,"SecurityObserver.exe");
       
    30 
       
    31 // ================= MEMBER FUNCTIONS =======================
       
    32 //
       
    33 // ----------------------------------------------------------
       
    34 // CObsStartter::StartObserverL()
       
    35 // Launches SecurityObserver.exe. StartObserverL() is called from startup.
       
    36 // ----------------------------------------------------------
       
    37 //
       
    38 EXPORT_C void TObsStarter::StartObserverL()
       
    39 	{
       
    40 	RProcess process; 
       
    41     HBufC* observerPath = HBufC::NewLC(KMaxPath);
       
    42     TPtr ObserverEXE(observerPath->Des());
       
    43     ObserverEXE.Append(_L("Z:"));
       
    44     ObserverEXE.Append(KDC_PROGRAMS_DIR);
       
    45     ObserverEXE.Append(ObserverName);
       
    46 
       
    47 		TInt err = process.Create( ObserverEXE, KNullDesC );
       
    48 		process.Resume();
       
    49 		if (err)
       
    50 			{
       
    51 			// Panic here in order to enter SW
       
    52 			// reset mechanism.
       
    53 			User::Panic(ObserverEXE,err);
       
    54 			}
       
    55     CleanupStack::PopAndDestroy(observerPath);
       
    56 	}
       
    57 // End of file