__declspec (noinline) int__tmaincrtstartup (void) {int initret; int mainret=0; int managedapp; #ifdef _winmain_ _tuchar *lpszcommandline; Startupinfow Startupinfo; Getstartupinfow (&startupinfo), #endif/* _winmain_ */#ifdef _m_ix86 * * * Enable app termination when Heap corruption is detected on * Windows Vista and above. This was a no-op on Down-level OS ' s * and enabled by default for 64-bit processes. */if (!_noheapenableterminationoncorruption) {heapsetinformation (NULL, Heapenableterminationonc Orruption, NULL, 0); } #endif/* _m_ix86 */* * Determine if this is a managed application */Managedapp = check _managed_app (); if (!_heap_init ())/* Initialize heap */fast_error_exit (_rt_heapinit); /* Write Message and die */if (!_mtinit ())/* Initialize Multi-thread*/Fast_error_exit (_rt_thread); /* Write Message and die */* Enable buffer count checking if linking against static Lib */_crtsetcheckcou NT (TRUE); /* * Initialize the Runtime Checks stuff */#ifdef _RTC _rtc_initialize (); #endif/* _RTC */ /* Guard The remainder of the initialization code and the call * to user's main, or WinMain, function in A __try/__except * statement. */__try {if (_ioinit () < 0)/* Initialize LOWIO */_amsg_exit (_rt_lowio INIT); /* Get wide cmd line info */_tcmdln = (_tschar *) getcommandlinet (); /* Get wide environ info */_tenvptr = (_tschar *) getenvironmentstringst (); if (_TSETARGV () < 0) _amsg_exit (_rt_spacearg); if (_TSETENVP () < 0) _amsg_exit (_rt_spaceenv); Initret = _cinit (TRUE); /* Do C Data Initialize */if (Initret! = 0) _amsg_exit (initret); #ifdef _winmain_ L pszCommandLine = _twincmdln (); Mainret = _tWinMain ((hinstance) &__imagebase, WinMain function NULL, Lpszcommandline, Startupinfo.dwflags & Startf_useshowwindow ? StartupInfo.wShowWindow:SW_SHOWDEFAULT); #else/* _ Winmain_ */_tinitenv = _tenviron; Mainret = _tmain (__ARGC, _TARGV, _tenviron); Here is the real main function #endif/* _winmain_ */if (!managedapp) exit (Mainret); Call the Exit Function _cexit () after execution is complete; Do the Aftercare} __except (_xcptfilter (GetExceptionCode (), GetExceptionInformation ())) {/* * Should NevER reach here */Mainret = GetExceptionCode (); if (!managedapp) _exit (Mainret); _c_exit (); }/* End of Try-except */return Mainret;}
C + + Startup function startup