sl@0: // Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of the License "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // e32\euser\epoc\x86\uc_exe.cpp sl@0: // sl@0: // sl@0: sl@0: #include "u32std.h" sl@0: #include sl@0: #include sl@0: sl@0: // include the static data definitions sl@0: #define __FLTUSED sl@0: #include "win32crt.h" sl@0: #include "nwdl.h" sl@0: sl@0: sl@0: GLREF_C TInt E32Main(); sl@0: sl@0: extern "C" { sl@0: sl@0: void globalDestructorFunc() sl@0: { sl@0: destroyStatics(); // this is a macro sl@0: } sl@0: sl@0: void __fastcall RunThread(TBool aNotFirst, SThreadCreateInfo& aInfo) sl@0: { sl@0: SStdEpocThreadCreateInfo& cinfo = (SStdEpocThreadCreateInfo&)aInfo; sl@0: sl@0: #ifdef USE_INSTRUMENTED_HEAP sl@0: cinfo.iFlags |= ETraceHeapAllocs; sl@0: #elif defined(ENABLE_HEAP_MONITORING) sl@0: cinfo.iFlags |= ETraceHeapAllocs|EMonitorHeapMemory; sl@0: #endif sl@0: TInt r = UserHeap::SetupThreadHeap(aNotFirst, cinfo); sl@0: sl@0: if (r==KErrNone) sl@0: r = UserSvr::DllSetTls(KGlobalDestructorTlsKey, KDllUid_Special, (TAny*)globalDestructorFunc); sl@0: sl@0: if (r==KErrNone) sl@0: { sl@0: if (aNotFirst) sl@0: r = (*cinfo.iFunction)(cinfo.iPtr); sl@0: else sl@0: { sl@0: // Init statics for implicitly linked DLLs sl@0: User::InitProcess(); sl@0: sl@0: // Init statics for EXE sl@0: constructStatics(); sl@0: r = E32Main(); sl@0: } sl@0: } sl@0: User::Exit(r); sl@0: } sl@0: sl@0: void _fltused() {} sl@0: }