Author: jgardou
Date: Sun Jul 24 16:45:41 2011
New Revision: 52840
URL:
http://svn.reactos.org/svn/reactos?rev=52840&view=rev
Log:
[CRT]
- get back atexit handling as it was before.
(reverts 52838, 52829, 52828)
Thanks to Kai and Timo for the explanation
Modified:
trunk/reactos/dll/win32/msvcrt/msvcrt.spec
trunk/reactos/dll/win32/msvcrt20/msvcrt20.spec
trunk/reactos/dll/win32/msvcrt40/msvcrt40.spec
trunk/reactos/lib/3rdparty/mingw/crtexe.c
trunk/reactos/lib/3rdparty/mingw/mingw.rbuild
trunk/reactos/lib/sdk/crt/msvcrtex.cmake
trunk/reactos/lib/sdk/crt/startup/crtdll.c
trunk/reactos/lib/sdk/crt/startup/crtexe.c
Modified: trunk/reactos/dll/win32/msvcrt/msvcrt.spec
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msvcrt/msvcrt.sp…
==============================================================================
--- trunk/reactos/dll/win32/msvcrt/msvcrt.spec [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msvcrt/msvcrt.spec [iso-8859-1] Sun Jul 24 16:45:41 2011
@@ -1156,7 +1156,7 @@
@ cdecl asin(double)
@ cdecl atan(double)
@ cdecl atan2(double double)
-@ cdecl atexit(ptr)
+@ extern atexit # <-- keep this as an extern, thank you
@ cdecl atof(str)
@ cdecl atoi(str)
@ cdecl atol(str)
Modified: trunk/reactos/dll/win32/msvcrt20/msvcrt20.spec
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msvcrt20/msvcrt2…
==============================================================================
--- trunk/reactos/dll/win32/msvcrt20/msvcrt20.spec [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msvcrt20/msvcrt20.spec [iso-8859-1] Sun Jul 24 16:45:41 2011
@@ -937,7 +937,7 @@
@ cdecl asin(double)
@ cdecl atan(double)
@ cdecl atan2(double double)
-@ cdecl atexit(ptr)
+@ extern atexit # <-- do not touch this!
@ cdecl atof(str)
@ cdecl atoi(str)
@ cdecl atol(str)
Modified: trunk/reactos/dll/win32/msvcrt40/msvcrt40.spec
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msvcrt40/msvcrt4…
==============================================================================
--- trunk/reactos/dll/win32/msvcrt40/msvcrt40.spec [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msvcrt40/msvcrt40.spec [iso-8859-1] Sun Jul 24 16:45:41 2011
@@ -975,7 +975,7 @@
@ cdecl asin(double)
@ cdecl atan(double)
@ cdecl atan2(double double)
-@ cdecl atexit(ptr)
+@ extern atexit # <-- changing this will kill your cat, understand?
@ cdecl atof(str)
@ cdecl atoi(str)
@ cdecl atol(str)
Modified: trunk/reactos/lib/3rdparty/mingw/crtexe.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/3rdparty/mingw/crtexe.…
==============================================================================
--- trunk/reactos/lib/3rdparty/mingw/crtexe.c [iso-8859-1] (original)
+++ trunk/reactos/lib/3rdparty/mingw/crtexe.c [iso-8859-1] Sun Jul 24 16:45:41 2011
@@ -71,8 +71,8 @@
/* TLS initialization hook. */
extern const PIMAGE_TLS_CALLBACK __dyn_tls_init_callback;
-//extern _PVFV *__onexitbegin;
-//extern _PVFV *__onexitend;
+extern _PVFV *__onexitbegin;
+extern _PVFV *__onexitend;
extern int mingw_app_type;
@@ -119,7 +119,7 @@
__set_app_type(_GUI_APP);
else
__set_app_type (_CONSOLE_APP);
-// __onexitbegin = __onexitend = (_PVFV *) _encode_pointer ((_PVFV *)(-1));
+ __onexitbegin = __onexitend = (_PVFV *) _encode_pointer ((_PVFV *)(-1));
* __MINGW_IMP_SYMBOL(_fmode) = _fmode;
* __MINGW_IMP_SYMBOL(_commode) = _commode;
Modified: trunk/reactos/lib/3rdparty/mingw/mingw.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/3rdparty/mingw/mingw.r…
==============================================================================
--- trunk/reactos/lib/3rdparty/mingw/mingw.rbuild [iso-8859-1] (original)
+++ trunk/reactos/lib/3rdparty/mingw/mingw.rbuild [iso-8859-1] Sun Jul 24 16:45:41 2011
@@ -12,7 +12,7 @@
<include base="ReactOS">include/reactos/mingw-w64</include>
<library>kernel32</library>
<file>_newmode.c</file>
- <!--file>atonexit.c</file-->
+ <file>atonexit.c</file>
<file>binmode.c</file>
<file>charmax.c</file>
<file>cinitexe.c</file>
Modified: trunk/reactos/lib/sdk/crt/msvcrtex.cmake
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/msvcrtex.cmake…
==============================================================================
--- trunk/reactos/lib/sdk/crt/msvcrtex.cmake [iso-8859-1] (original)
+++ trunk/reactos/lib/sdk/crt/msvcrtex.cmake [iso-8859-1] Sun Jul 24 16:45:41 2011
@@ -17,7 +17,7 @@
startup/natstart.c
startup/charmax.c
startup/merr.c
-# startup/atonexit.c
+ startup/atonexit.c
startup/txtmode.c
startup/pesect.c
startup/tlsmcrt.c
Modified: trunk/reactos/lib/sdk/crt/startup/crtdll.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/startup/crtdll…
==============================================================================
--- trunk/reactos/lib/sdk/crt/startup/crtdll.c [iso-8859-1] (original)
+++ trunk/reactos/lib/sdk/crt/startup/crtdll.c [iso-8859-1] Sun Jul 24 16:45:41 2011
@@ -49,8 +49,8 @@
static int __proc_attached = 0;
-//extern _PVFV *__onexitbegin;
-//extern _PVFV *__onexitend;
+extern _PVFV *__onexitbegin;
+extern _PVFV *__onexitend;
extern int mingw_app_type;
@@ -65,7 +65,7 @@
static int
pre_c_init (void)
{
-/* _PVFV *onexitbegin;
+ _PVFV *onexitbegin;
onexitbegin = (_PVFV *) malloc (32 * sizeof (_PVFV));
__onexitend = __onexitbegin = (_PVFV *) _encode_pointer (onexitbegin);
@@ -73,8 +73,7 @@
if (onexitbegin == NULL)
return 1;
*onexitbegin = (_PVFV) NULL;
- return 0;*/
- return 1;
+ return 0;
}
WINBOOL WINAPI _CRT_INIT (HANDLE hDllHandle, DWORD dwReason, LPVOID lpreserved)
@@ -136,7 +135,7 @@
_amsg_exit (31);
}
else
- {/*
+ {
_PVFV * onexitbegin = (_PVFV *) _decode_pointer (__onexitbegin);
if (onexitbegin)
{
@@ -146,7 +145,7 @@
(**onexitend) ();
free (onexitbegin);
__onexitbegin = __onexitend = (_PVFV *) NULL;
- }*/
+ }
__native_startup_state = __uninitialized;
(void) InterlockedExchangePointer ((volatile PVOID *) &__native_startup_lock, 0);
}
Modified: trunk/reactos/lib/sdk/crt/startup/crtexe.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/startup/crtexe…
==============================================================================
--- trunk/reactos/lib/sdk/crt/startup/crtexe.c [iso-8859-1] (original)
+++ trunk/reactos/lib/sdk/crt/startup/crtexe.c [iso-8859-1] Sun Jul 24 16:45:41 2011
@@ -75,8 +75,8 @@
/* TLS initialization hook. */
extern const PIMAGE_TLS_CALLBACK __dyn_tls_init_callback;
-//extern _PVFV *__onexitbegin;
-//extern _PVFV *__onexitend;
+extern _PVFV *__onexitbegin;
+extern _PVFV *__onexitend;
extern int mingw_app_type;
@@ -128,7 +128,7 @@
__set_app_type(_GUI_APP);
else
__set_app_type (_CONSOLE_APP);
-// __onexitbegin = __onexitend = (_PVFV *) _encode_pointer ((_PVFV *)(-1));
+ __onexitbegin = __onexitend = (_PVFV *) _encode_pointer ((_PVFV *)(-1));
* __MINGW_IMP_SYMBOL(_fmode) = _fmode;
* __MINGW_IMP_SYMBOL(_commode) = _commode;