|
1 /* |
|
2 * Copyright (c) 2005-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 * server implementation |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 /** |
|
21 @file |
|
22 */ |
|
23 |
|
24 #include "tauthpluginsserver.h" |
|
25 #include "tauthpluginsstep.h" |
|
26 |
|
27 _LIT(KServerName,"tauthplugins"); |
|
28 |
|
29 /** |
|
30 * Called inside the MainL() function to create and start the CTestServer |
|
31 * derived server. |
|
32 * @return Instance of the test server |
|
33 */ |
|
34 CTAuthPluginsServer* CTAuthPluginsServer::NewL() |
|
35 { |
|
36 CTAuthPluginsServer * server = new (ELeave) CTAuthPluginsServer(); |
|
37 CleanupStack::PushL(server); |
|
38 |
|
39 // Either use a StartL or ConstructL, the latter will permit Server Logging. |
|
40 |
|
41 server->ConstructL(KServerName); |
|
42 CleanupStack::Pop(server); |
|
43 return server; |
|
44 } |
|
45 |
|
46 LOCAL_C void MainL() |
|
47 { |
|
48 // Leave the hooks in for platform security |
|
49 #if (defined __DATA_CAGING__) |
|
50 RProcess().DataCaging(RProcess::EDataCagingOn); |
|
51 RProcess().SecureApi(RProcess::ESecureApiOn); |
|
52 #endif |
|
53 CActiveScheduler* sched=NULL; |
|
54 sched=new(ELeave) CActiveScheduler; |
|
55 CleanupStack::PushL(sched); |
|
56 CActiveScheduler::Install(sched); |
|
57 CTAuthPluginsServer* server = NULL; |
|
58 // Create the CTestServer derived server |
|
59 TRAPD(err,server = CTAuthPluginsServer::NewL()); |
|
60 if(!err) |
|
61 { |
|
62 RProcess::Rendezvous(KErrNone); |
|
63 sched->Start(); |
|
64 } |
|
65 CleanupStack::Pop(sched); |
|
66 delete server; |
|
67 delete sched; |
|
68 } |
|
69 |
|
70 GLDEF_C TInt E32Main() |
|
71 { |
|
72 CTrapCleanup* cleanup = CTrapCleanup::New(); |
|
73 if(cleanup == NULL) |
|
74 { |
|
75 return KErrNoMemory; |
|
76 } |
|
77 TRAP_IGNORE(MainL()); |
|
78 delete cleanup; |
|
79 return KErrNone; |
|
80 } |
|
81 |
|
82 CTestStep* CTAuthPluginsServer::CreateTestStep(const TDesC& aStepName) |
|
83 { |
|
84 CTestStep* testStep = NULL; |
|
85 |
|
86 if(aStepName == KTStepInterface) |
|
87 { |
|
88 testStep = new CTStepInterface(); |
|
89 } |
|
90 |
|
91 return testStep; |
|
92 } |