diff --git a/ntoskrnl/mm/ARM3/sysldr.c b/ntoskrnl/mm/ARM3/sysldr.c index c66f06c4fe8..92a31896205 100644 --- a/ntoskrnl/mm/ARM3/sysldr.c +++ b/ntoskrnl/mm/ARM3/sysldr.c @@ -1466,8 +1466,13 @@ MiFindInitializationCode(OUT PVOID *StartVa, /* Assume failure */ *StartVa = NULL; - /* Enter a critical region while we loop the list */ + /* Acquire the necessary lock while we loop the list */ KeEnterCriticalRegion(); + KeWaitForSingleObject(&MmSystemLoadLock, + WrVirtualMemory, + KernelMode, + FALSE, + NULL); /* Loop all loaded modules */ NextEntry = PsLoadedModuleList.Flink; @@ -1615,7 +1620,8 @@ MiFindInitializationCode(OUT PVOID *StartVa, NextEntry = NextEntry->Flink; } - /* Leave the critical region and return */ + /* Release the lock and return */ + KeReleaseMutant(&MmSystemLoadLock, 1, FALSE, FALSE); KeLeaveCriticalRegion(); }