Author: fireball Date: Sat Jun 9 14:03:33 2007 New Revision: 27083
URL: http://svn.reactos.org/svn/reactos?rev=27083&view=rev Log: - Don't load a module with the same name more than once.
Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/loader.c
Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/loader.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/i... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/i386/loader.c (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/i386/loader.c Sat Jun 9 14:03:33 2007 @@ -596,6 +596,14 @@ ULONG ImageSize; NTSTATUS Status = STATUS_SUCCESS;
+ /* Try to see, maybe it's loaded already */ + if (LdrGetModuleObject(Name) != NULL) + { + /* It's loaded, return NULL. It would be wise to return + correct LoadBase, but it seems to be ignored almost everywhere */ + return NULL; + } + /* Set the virtual (image) and physical (load) addresses */ LoadBase = (PVOID)NextModuleBase; ImageBase = RVA(LoadBase , -KERNEL_BASE_PHYS + KSEG0_BASE);