TInt CallThrdProcEntry(TInt (*aFn)(void*), void* aPtr, TInt aNotFirst) { TCppRTExceptionsGlobals aExceptionGlobals; if (!aNotFirst) { // Init statics for implicitly linked DLLs User::InitProcess(); // Init statics for EXE //pick up export table if we're an exexp __DLL_Export_Table__(); __cpp_initialize__aeabi_(); } #ifdef __LEAVE_EQUALS_THROW__ TInt r = KErrNone; try { r = aNotFirst ? (*aFn)(aPtr) : E32Main(); } catch (XLeaveException&) { User::Panic(KLitUser, EUserLeaveWithoutTrap); } return r; #else return aNotFirst ? (*aFn)(aPtr) : E32Main(); #endif }
void __fastcall RunThread(TBool aNotFirst, SThreadCreateInfo& aInfo) { SStdEpocThreadCreateInfo& cinfo = (SStdEpocThreadCreateInfo&)aInfo; #ifdef USE_INSTRUMENTED_HEAP cinfo.iFlags |= ETraceHeapAllocs; #elif defined(ENABLE_HEAP_MONITORING) cinfo.iFlags |= ETraceHeapAllocs|EMonitorHeapMemory; #endif TInt r = UserHeap::SetupThreadHeap(aNotFirst, cinfo); if (r==KErrNone) r = UserSvr::DllSetTls(KGlobalDestructorTlsKey, KDllUid_Special, (TAny*)globalDestructorFunc); if (r==KErrNone) { if (aNotFirst) r = (*cinfo.iFunction)(cinfo.iPtr); else { // Init statics for implicitly linked DLLs User::InitProcess(); // Init statics for EXE constructStatics(); r = E32Main(); } } User::Exit(r); }
EXPORT_C TInt WinsMain() { #if defined(__WINS__) E32Main(); #endif return KErrNone; }
static TInt ThreadFunction(TAny* /*aPtr*/) // // WINS thread entry-point function. // { return E32Main(); }
void RunThread(TBool aNotFirst, SThreadCreateInfo& aInfo) { SStdEpocThreadCreateInfo& cinfo = (SStdEpocThreadCreateInfo&)aInfo; TInt r = UserHeap::SetupThreadHeap(aNotFirst, cinfo); if (r==KErrNone) { if (aNotFirst) r = (*cinfo.iFunction)(cinfo.iPtr); else { // Init statics for implicitly linked DLLs User::InitProcess(); // Init statics for EXE TUint i=1; while (__CTOR_LIST__[i]) (*__CTOR_LIST__[i++])(); r = E32Main(); } } User::Exit(r); }
EXPORT_C TInt WinsMain( void ) { E32Main(); return( KErrNone ); }