Update contrib.
2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
20 #if defined (__WINS__)
21 #define PDD_NAME _L("ECDRV")
23 #define PDD_NAME _L("EUART1")
24 #define PDD2_NAME _L("EUART2")
25 #define PDD3_NAME _L("EUART3")
26 #define PDD4_NAME _L("EUART4")
29 #define LDD_NAME _L("ECOMM")
34 * Pipe test server implementation
36 #include "tcryptserver.h"
39 _LIT(KServerName, "tcrypt");
41 CTestCryptServer* CTestCryptServer::NewL()
43 CTestCryptServer *server = new(ELeave) CTestCryptServer();
44 CleanupStack::PushL(server);
45 server->ConstructL(KServerName);
46 CleanupStack::Pop(server);
50 static void InitCommsL()
52 TInt ret = User::LoadPhysicalDevice(PDD_NAME);
53 User::LeaveIfError(ret == KErrAlreadyExists?KErrNone:ret);
56 ret = User::LoadPhysicalDevice(PDD2_NAME);
57 ret = User::LoadPhysicalDevice(PDD3_NAME);
58 ret = User::LoadPhysicalDevice(PDD4_NAME);
61 ret = User::LoadLogicalDevice(LDD_NAME);
62 User::LeaveIfError(ret == KErrAlreadyExists?KErrNone:ret);
64 User::LeaveIfError(ret == KErrAlreadyExists?KErrNone:ret);
68 // Leave the hooks in for platform security
69 #if (defined __DATA_CAGING__)
70 RProcess().DataCaging(RProcess::EDataCagingOn);
71 RProcess().SecureApi(RProcess::ESecureApiOn);
74 CActiveScheduler* sched=NULL;
75 sched=new(ELeave) CActiveScheduler;
76 CActiveScheduler::Install(sched);
77 CTestCryptServer* server = NULL;
78 // Create the CTestServer derived server
79 TRAPD(err, server = CTestCryptServer::NewL());
82 // Sync with the client and enter the active scheduler
83 RProcess::Rendezvous(KErrNone);
92 * @return Standard Epoc error code on exit
100 CTestStep* CTestCryptServer::CreateTestStep(const TDesC& aStepName)
102 CTestStep* testStep = NULL;
104 // This server creates just one step but create as many as you want
105 // They are created "just in time" when the worker thread is created
107 if (aStepName == KEncrypt)
108 testStep = new CTestCrypt(aStepName);
109 else if (aStepName == KCrypt)
110 testStep = new CTestCrypt(aStepName);