|
1 // Copyright (c) 1997-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 "Symbian Foundation License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // The main startup of the AppArc server |
|
15 // |
|
16 // |
|
17 |
|
18 #include "APASVST.H" |
|
19 |
|
20 |
|
21 #ifdef APA_SERVER_IN_THREAD |
|
22 // The server binary is an "EPOCEXE" target type |
|
23 // Thus the server parameter passing and startup code for WINS and EPOC are |
|
24 // significantly different. |
|
25 // |
|
26 // In EKA1 WINS, the EPOCEXE target is a DLL with an entry point called WinsMain, |
|
27 // taking no parameters and returning TInt. This is not really valid as a thread |
|
28 // function which takes a TAny* parameter which we need. |
|
29 // |
|
30 // So the DLL entry-point WinsMain() is used to return a TInt representing the |
|
31 // real thread function within the DLL. This is good as long as |
|
32 // sizeof(TInt)>=sizeof(ApaServThreadStart). |
|
33 // |
|
34 |
|
35 IMPORT_C TInt WinsMain(); |
|
36 EXPORT_C TInt WinsMain() |
|
37 // |
|
38 // WINS DLL entry-point. Just return the real thread function |
|
39 // cast to TInt |
|
40 // |
|
41 { |
|
42 return reinterpret_cast<TInt>(&ApaServThreadStart); |
|
43 } |
|
44 |
|
45 GLDEF_C TInt E32Dll(TDllReason /*aReason*/) |
|
46 // |
|
47 // DLL entry point |
|
48 // |
|
49 { |
|
50 return(KErrNone); |
|
51 } |
|
52 |
|
53 #else |
|
54 |
|
55 TInt E32Main() |
|
56 // |
|
57 // EXE entry point |
|
58 // |
|
59 { |
|
60 return ApaServThreadStart(NULL); |
|
61 } |
|
62 |
|
63 #endif |