First public contribution.
1 // Copyright (c) 1998-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 "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
15 // EPOC32 version of crt0.c for pure C programs, adapted to cause the full Eikon
16 // environment to come into being and hence only used with WINS.
27 extern "C" int wmain (int argc, wchar_t *argv[], wchar_t *envp[]);
30 IMPORT_C void RegisterWsExe(const TDesC &aName);
33 GLDEF_C TInt E32Main()
37 RWin32Stream::StartServer(); // arrange for access to Win32 stdin/stdout/stderr
38 SpawnPosixServerThread(); // arrange for multi-threaded operation
45 __crt0(argc,wargv,wenvp); // get args & environment from somewhere
48 // Cause the graphical Window Server to come into existence
50 sem.CreateGlobal(_L("WsExeSem"),0);
51 RegisterWsExe(sem.FullName());
54 int ret=wmain(argc, wargv, wenvp); // go
56 // no need to explicitly delete the cleanup stack here as all memory used by
57 // the process will be released by RProcess::Terminate(), called from inside exit().
59 exit(ret); // to get atexit processing, eventually terminates this process