From 45a4e5439b648b1b0620acd11f0a7926d9eaad61 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Wed, 4 Jan 2006 14:55:33 +0100 Subject: [PATCH] Set refcount to -1 on implicitly loaded dlls to avoid unloading them (suggested by Michael Ost). --- dlls/ntdll/loader.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index 58da86fdddb..47cc1da4627 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -934,6 +934,7 @@ static void attach_implicitly_loaded_dlls( LPVOID reserved ) if (mod->Flags & (LDR_LOAD_IN_PROGRESS | LDR_PROCESS_ATTACHED)) continue; TRACE( "found implicitly loaded %s, attaching to it\n", debugstr_w(mod->BaseDllName.Buffer)); + mod->LoadCount = -1; /* we can't unload it anyway */ process_attach( CONTAINING_RECORD(mod, WINE_MODREF, ldr), reserved ); break; /* restart the search from the start */ }