1 // Copyright (c) 2006-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". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // Entry point to debug security server, sets up server/session |
|
15 // |
|
16 // |
|
17 |
|
18 /** |
|
19 @file |
|
20 @internalTechnology |
|
21 @released |
|
22 */ |
|
23 |
|
24 #include <e32base.h> |
|
25 #include <e32base_private.h> |
|
26 #include <rm_debug_api.h> |
|
27 |
|
28 #include "c_security_svr_server.h" |
|
29 #include "c_security_svr_session.h" |
|
30 #include "rm_debug_logging.h" |
|
31 |
|
32 using namespace Debug; |
|
33 |
|
34 /** |
|
35 Perform all server initialisation, in particular creation of the |
|
36 scheduler and server and then run the scheduler |
|
37 */ |
|
38 void RunServerL() |
|
39 { |
|
40 LOG_MSG( "rm_debug_svr.cpp::RunServerL() : -> new(ELeave) CActiveScheduler\n" ); |
|
41 CActiveScheduler* s=new(ELeave) CActiveScheduler; |
|
42 |
|
43 LOG_MSG( "rm_debug_svr.cpp::RunServerL() : -> CleanupStack::PushL(s)\n" ); |
|
44 CleanupStack::PushL(s); |
|
45 |
|
46 LOG_MSG( "rm_debug_svr.cpp::RunServerL() : -> CActiveScheduler::Install()\n" ); |
|
47 CActiveScheduler::Install(s); |
|
48 |
|
49 LOG_MSG( "rm_debug_svr.cpp::RunServerL() : -> CSecuritySvrServer::NewLC()\n" ); |
|
50 CSecuritySvrServer::NewLC(); |
|
51 |
|
52 LOG_MSG( "rm_debug_svr.cpp::RunServerL() : -> Rendezvous(KErrNone)\n" ); |
|
53 // Signal whoever has started us that we have done so. |
|
54 RProcess::Rendezvous(KErrNone); |
|
55 LOG_MSG( "rm_debug_svr.cpp::RunServerL() : <- Rendezvous()\n" ); |
|
56 |
|
57 LOG_MSG( "rm_debug_svr.cpp::RunServerL() : -> CActiveScheduler::Start()\n" ); |
|
58 CActiveScheduler::Start(); |
|
59 LOG_MSG( "rm_debug_svr.cpp::RunServerL() <- CActiveScheduler::Start()\n" ); |
|
60 |
|
61 LOG_MSG( "rm_debug_svr.cpp::RunServerL() : -> CleanupStack::PopAndDestroy()\n" ); |
|
62 CleanupStack::PopAndDestroy(2, s); |
|
63 LOG_MSG( "rm_debug_svr.cpp::RunServerL() : <- CleanupStack::PopAndDestroy()\n" ); |
|
64 } |
|
65 |
|
66 /** |
|
67 Entry point for debug security server |
|
68 */ |
|
69 GLDEF_C TInt E32Main() |
|
70 { |
|
71 __UHEAP_MARK; |
|
72 CTrapCleanup* cleanup=CTrapCleanup::New(); |
|
73 TInt r = KErrNoMemory; |
|
74 if (cleanup) |
|
75 { |
|
76 TRAP(r,RunServerL()); |
|
77 delete cleanup; |
|
78 } |
|
79 __UHEAP_MARKEND; |
|
80 return r; |
|
81 } |
|