|
1 /* |
|
2 * Copyright (c) 2008 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 "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: This is the implementation of application class |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include "genericserver.h" |
|
20 |
|
21 // ---------------------------------------------------------------------- |
|
22 #include "genericserversecuritypolicy.h" |
|
23 CGenericServer::CGenericServer(TInt aPriority) : /*CServer2(aPriority),*/ |
|
24 CPolicyServer(/*EPriorityStandard*/aPriority, KGenericServerPolicy, |
|
25 ESharableSessions) |
|
26 { |
|
27 } |
|
28 |
|
29 TInt CGenericServer::GetStartupFromCommandLine(TStartupRequest& startup) |
|
30 { |
|
31 |
|
32 // Check the command line is the expected length |
|
33 if (User::CommandLineLength() == KStartupTextLength) |
|
34 { |
|
35 // Copy the data to the supplied structure |
|
36 TPtr ptr(reinterpret_cast<TText*> (&startup), KStartupTextLength); |
|
37 User::CommandLine(ptr); |
|
38 return KErrNone; |
|
39 } |
|
40 |
|
41 return KErrGeneral; |
|
42 } |
|
43 |
|
44 void CGenericServer::SignalStartup(TStartupRequest* startup, TInt aReason) |
|
45 { |
|
46 RThread client; |
|
47 |
|
48 // Open a handle to the client's thread |
|
49 if (startup && KErrNone == client.Open(startup->iId)) |
|
50 { |
|
51 // Signal the client |
|
52 client.RequestComplete(startup->iStatus, aReason); |
|
53 client.Close(); |
|
54 } |
|
55 } |