author | John Imhofe <john.imhofe@nokia.com> |
Mon, 21 Dec 2009 16:14:42 +0000 | |
changeset 2 | 4122176ea935 |
parent 0 | a41df078684a |
permissions | -rw-r--r-- |
0 | 1 |
/* |
2
4122176ea935
Revision: 200948 + Removing redundant base integration tests and fixing build errors
John Imhofe <john.imhofe@nokia.com>
parents:
0
diff
changeset
|
2 |
* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
0 | 3 |
* All rights reserved. |
4 |
* This component and the accompanying materials are made available |
|
2
4122176ea935
Revision: 200948 + Removing redundant base integration tests and fixing build errors
John Imhofe <john.imhofe@nokia.com>
parents:
0
diff
changeset
|
5 |
* under the terms of "Eclipse Public License v1.0" |
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 |
* |
|
2
4122176ea935
Revision: 200948 + Removing redundant base integration tests and fixing build errors
John Imhofe <john.imhofe@nokia.com>
parents:
0
diff
changeset
|
14 |
* Description: |
0 | 15 |
* |
16 |
*/ |
|
17 |
||
2
4122176ea935
Revision: 200948 + Removing redundant base integration tests and fixing build errors
John Imhofe <john.imhofe@nokia.com>
parents:
0
diff
changeset
|
18 |
|
0 | 19 |
#include "T_SfSrvServer.h" |
20 |
||
21 |
CT_SfSrvServer* CT_SfSrvServer::NewL() |
|
22 |
/** |
|
23 |
* @return - Instance of the test server |
|
24 |
* Same code for Secure and non-secure variants |
|
25 |
* Called inside the MainL() function to create and start the |
|
26 |
* CTestServer derived server. |
|
27 |
*/ |
|
28 |
{ |
|
29 |
CT_SfSrvServer* server = new (ELeave) CT_SfSrvServer(); |
|
30 |
CleanupStack::PushL(server); |
|
31 |
server->ConstructL(); |
|
32 |
CleanupStack::Pop(server); |
|
33 |
return server; |
|
34 |
} |
|
35 |
||
36 |
LOCAL_C void MainL() |
|
37 |
/** |
|
38 |
* Secure variant |
|
39 |
* Much simpler, uses the new Rendezvous() call to sync with the client |
|
40 |
*/ |
|
41 |
{ |
|
42 |
#if (defined __DATA_CAGING__) |
|
43 |
RProcess().DataCaging(RProcess::EDataCagingOn); |
|
44 |
RProcess().SecureApi(RProcess::ESecureApiOn); |
|
45 |
#endif |
|
46 |
CActiveScheduler* sched=NULL; |
|
47 |
sched=new(ELeave) CActiveScheduler; |
|
48 |
CActiveScheduler::Install(sched); |
|
49 |
CT_SfSrvServer* server = NULL; |
|
50 |
TRAPD(err, server = CT_SfSrvServer::NewL()); |
|
51 |
if(!err) |
|
52 |
{ |
|
53 |
RProcess::Rendezvous(KErrNone); |
|
54 |
sched->Start(); |
|
55 |
} |
|
56 |
delete server; |
|
57 |
delete sched; |
|
58 |
} |
|
59 |
||
60 |
GLDEF_C TInt E32Main() |
|
61 |
/** |
|
62 |
* @return - Standard Epoc error code on process exit |
|
63 |
* Secure variant only |
|
64 |
* Process entry point. Called by client using RProcess API |
|
65 |
*/ |
|
66 |
{ |
|
67 |
CTrapCleanup* cleanup = CTrapCleanup::New(); |
|
68 |
if(cleanup == NULL) |
|
69 |
{ |
|
70 |
return KErrNoMemory; |
|
71 |
} |
|
72 |
#if (defined TRAP_IGNORE) |
|
73 |
TRAP_IGNORE(MainL()); |
|
74 |
#else |
|
75 |
TRAPD(err,MainL()); |
|
76 |
#endif |
|
77 |
delete cleanup; |
|
78 |
return KErrNone; |
|
79 |
} |