From: Sebastian Lackner Subject: [4/4] ntdll: Wait until builtin dlls are unloaded before releasing the virtual view. Message-Id: <542F5167.9020806@fds-team.de> Date: Sat, 04 Oct 2014 03:46:15 +0200 From: Michael Müller When the page protection of a builtin module has been modified by the user, then even wine_dll_unload can trigger for example a write watch. We have to keep the virtual view until the builtin dll is unloaded. --- dlls/ntdll/loader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) From bcf2dbbc2b5a3551ab2db7ed6d49b1d34c8067d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Sat, 4 Oct 2014 02:51:51 +0200 Subject: ntdll: Wait until builtin dlls are unloaded before releasing the virtual view. --- dlls/ntdll/loader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index 18ae29c..f0fb1f2 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -2641,8 +2641,8 @@ static void free_modref( WINE_MODREF *wm ) free_tls_slot( &wm->ldr ); RtlReleaseActivationContext( wm->ldr.ActivationContext ); - NtUnmapViewOfSection( NtCurrentProcess(), wm->ldr.BaseAddress ); if (wm->ldr.Flags & LDR_WINE_INTERNAL) wine_dll_unload( wm->ldr.SectionHandle ); + NtUnmapViewOfSection( NtCurrentProcess(), wm->ldr.BaseAddress ); if (cached_modref == wm) cached_modref = NULL; RtlFreeUnicodeString( &wm->ldr.FullDllName ); RtlFreeHeap( GetProcessHeap(), 0, wm->deps ); -- 2.1.1