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 */ }