From 14b3db99c1b552c3a0d5dc8e2003122677575a81 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Fri, 28 May 2010 20:33:27 +0200 Subject: [PATCH] msvcrt: Make sure msvcrt doesn't get unloaded. We can't initialize file handles properly a second time. --- dlls/msvcrt/main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dlls/msvcrt/main.c b/dlls/msvcrt/main.c index a5b096179e8..323f8b770cb 100644 --- a/dlls/msvcrt/main.c +++ b/dlls/msvcrt/main.c @@ -18,6 +18,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ #include "msvcrt.h" +#include "winternl.h" #include "wine/debug.h" @@ -100,6 +101,8 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) msvcrt_init_args(); msvcrt_init_signals(); _setmbcp(_MB_CP_LOCALE); + /* don't allow unloading msvcrt, we can't setup file handles twice */ + LdrAddRefDll( 0, hinstDLL ); TRACE("finished process init\n"); break; case DLL_THREAD_ATTACH: