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
	}
Ejemplo n.º 2
0
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);
	}
Ejemplo n.º 3
0
EXPORT_C TInt WinsMain()
    {
#if defined(__WINS__)
    E32Main();
#endif
    return KErrNone;
    }
Ejemplo n.º 4
0
static TInt ThreadFunction(TAny* /*aPtr*/)
//
// WINS thread entry-point function.
//
{
    return E32Main();
}
Ejemplo n.º 5
0
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);
	}
Ejemplo n.º 6
0
EXPORT_C TInt WinsMain( void )
	{
	E32Main();

	return( KErrNone );
	}