os/kernelhwsrv/kerneltest/e32test/rm_debug/t_rmdebug_security.cpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/kernelhwsrv/kerneltest/e32test/rm_debug/t_rmdebug_security.cpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,100 @@
     1.4 +// Copyright (c) 2006-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 the License "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 +// Target application to be debugged by t_rmdebug.exe when testing
    1.18 +// security restrictions. This application is built with various
    1.19 +// capabilities by the t_rmdebug_securityX.mmp files. This allows
    1.20 +// the t_rmdebug2 program to ensure that security restrictions are
    1.21 +// properly enforced by the DSS/DDD subsystem.
    1.22 +// 
    1.23 +//
    1.24 +
    1.25 +#include <e32base.h>
    1.26 +#include <e32base_private.h>
    1.27 +#include <e32cons.h>
    1.28 +#include <e32test.h>
    1.29 +#include <e32ldr.h>
    1.30 +#include <e32cmn.h>
    1.31 +#include <e32cmn_private.h>
    1.32 +#include "t_rmdebug_security.h"
    1.33 +
    1.34 +CRunModeApp* CRunModeApp::NewL()
    1.35 +//
    1.36 +// CRunModeApp::NewL
    1.37 +//
    1.38 +	{
    1.39 +	CRunModeApp* self = new(ELeave) CRunModeApp();
    1.40 +
    1.41 +  	self->ConstructL();
    1.42 +   
    1.43 +	return self;
    1.44 +	}
    1.45 +
    1.46 +CRunModeApp::CRunModeApp()
    1.47 +//
    1.48 +// CRunModeApp constructor
    1.49 +//
    1.50 +	{
    1.51 +	}
    1.52 +
    1.53 +CRunModeApp::~CRunModeApp()
    1.54 +//
    1.55 +// CRunModeApp destructor
    1.56 +//
    1.57 +	{
    1.58 +	}
    1.59 +
    1.60 +void CRunModeApp::ConstructL()
    1.61 +//
    1.62 +// CRunModeApp::ConstructL
    1.63 +//
    1.64 +	{
    1.65 +	}
    1.66 +
    1.67 +void CRunModeApp::TestWaitDebug()
    1.68 +//
    1.69 +// CRunModeApp::TestWaitDebug
    1.70 +//
    1.71 +	{
    1.72 +	RProcess::Rendezvous(KErrNone);
    1.73 +
    1.74 +	// Wait a 3secs then quit (long enough to test, but not hang around forever)
    1.75 +	User::After(3000000);
    1.76 +	}
    1.77 +
    1.78 +GLDEF_C TInt E32Main()
    1.79 +//
    1.80 +// Entry point for run mode debug app test program
    1.81 +//
    1.82 +	{
    1.83 +   TInt ret = KErrNone;
    1.84 +   
    1.85 +	// client
    1.86 +	CTrapCleanup* trap = CTrapCleanup::New();
    1.87 +	if (!trap)
    1.88 +		return KErrNoMemory;
    1.89 +
    1.90 +   CRunModeApp* myApp = CRunModeApp::NewL();
    1.91 +   if (myApp != NULL)
    1.92 +       {
    1.93 +        __UHEAP_MARK;
    1.94 +	    TRAP(ret,myApp->TestWaitDebug());
    1.95 +	    __UHEAP_MARKEND;
    1.96 +
    1.97 +	    delete myApp;
    1.98 +       }
    1.99 +       
   1.100 +	delete trap;
   1.101 +
   1.102 +	return ret;
   1.103 +	}