Signed-off-by: Paul Gofman pgofman@codeweavers.com --- dlls/ntdll/loader.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index dae4ce13b44..9397c927c3e 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -1907,6 +1907,7 @@ NTSTATUS WINAPI LdrEnumerateLoadedModules( void *unknown, LDRENUMPROC callback, return STATUS_INVALID_PARAMETER;
lock_loader_exclusive(); + lock_loader_downgrade_exclusive(); RtlEnterCriticalSection( &loader_section ); mark = &NtCurrentTeb()->Peb->LdrData->InMemoryOrderModuleList; for (entry = mark->Flink; entry != mark; entry = entry->Flink) @@ -1916,6 +1917,7 @@ NTSTATUS WINAPI LdrEnumerateLoadedModules( void *unknown, LDRENUMPROC callback, if (stop) break; } RtlLeaveCriticalSection( &loader_section ); + lock_loader_restore_exclusive(); unlock_loader(); return STATUS_SUCCESS; }