common/tools/ats/smoketest/localisation/apparchitecture/apsexe/APSMAIN.CPP
changeset 793 0c32c669a39d
child 872 17498133d9ad
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/ats/smoketest/localisation/apparchitecture/apsexe/APSMAIN.CPP	Fri Nov 27 12:22:12 2009 +0000
@@ -0,0 +1,63 @@
+// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Symbian Foundation License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// The main startup of the AppArc server
+// 
+//
+
+#include "APASVST.H"
+
+
+#ifdef APA_SERVER_IN_THREAD
+// The server binary is an "EPOCEXE" target type
+// Thus the server parameter passing and startup code for WINS and EPOC are
+// significantly different.
+//
+// In EKA1 WINS, the EPOCEXE target is a DLL with an entry point called WinsMain,
+// taking no parameters and returning TInt. This is not really valid as a thread
+// function which takes a TAny* parameter which we need.
+//
+// So the DLL entry-point WinsMain() is used to return a TInt representing the
+// real thread function within the DLL. This is good as long as
+// sizeof(TInt)>=sizeof(ApaServThreadStart).
+//
+
+IMPORT_C TInt WinsMain();
+EXPORT_C TInt WinsMain()
+//
+// WINS DLL entry-point. Just return the real thread function 
+// cast to TInt
+//
+	{
+	return reinterpret_cast<TInt>(&ApaServThreadStart);
+	}
+
+GLDEF_C TInt E32Dll(TDllReason /*aReason*/)
+//
+//	DLL entry point
+//
+	{
+	return(KErrNone);
+	}
+
+#else
+
+TInt E32Main()
+//
+//	EXE entry point
+//
+	{
+	return ApaServThreadStart(NULL);
+	}
+	
+#endif