Add \SystemRoot\system32 to the search path for implicitly linked

kernel mode DLLs

svn path=/trunk/; revision=4457
This commit is contained in:
Gé van Geldorp 2003-03-31 09:30:00 +00:00
parent fc3c449b62
commit 14952fd4f9

View file

@ -1,4 +1,4 @@
/* $Id: loader.c,v 1.127 2003/02/27 20:29:55 ekohl Exp $ /* $Id: loader.c,v 1.128 2003/03/31 09:30:00 gvg Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -1068,17 +1068,24 @@ LdrPEProcessModule(PVOID ModuleLoadBase,
LibraryModuleObject = LdrGetModuleObject(&ModuleName); LibraryModuleObject = LdrGetModuleObject(&ModuleName);
if (LibraryModuleObject == NULL) if (LibraryModuleObject == NULL)
{ {
CPRINT("Module '%wZ' not loaded yet\n", &ModuleName); DPRINT("Module '%wZ' not loaded yet\n", &ModuleName);
wcscpy(NameBuffer, L"\\SystemRoot\\system32\\drivers\\"); wcscpy(NameBuffer, L"\\SystemRoot\\system32\\drivers\\");
wcscat(NameBuffer, ModuleName.Buffer); wcscat(NameBuffer, ModuleName.Buffer);
RtlInitUnicodeString(&NameString, NameBuffer); RtlInitUnicodeString(&NameString, NameBuffer);
Status = LdrLoadModule(&NameString, &LibraryModuleObject); Status = LdrLoadModule(&NameString, &LibraryModuleObject);
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {
CPRINT("Unknown import module: %wZ (Status %lx)\n", &ModuleName, Status); wcscpy(NameBuffer, L"\\SystemRoot\\system32\\");
wcscat(NameBuffer, ModuleName.Buffer);
RtlInitUnicodeString(&NameString, NameBuffer);
Status = LdrLoadModule(&NameString, &LibraryModuleObject);
if (!NT_SUCCESS(Status))
{
DPRINT1("Unknown import module: %wZ (Status %lx)\n", &ModuleName, Status);
return(Status); return(Status);
} }
} }
}
/* Get the import address list */ /* Get the import address list */
ImportAddressList = (PVOID *) ((DWORD)DriverBase + ImportAddressList = (PVOID *) ((DWORD)DriverBase +
ImportModuleDirectory->dwRVAFunctionAddressList); ImportModuleDirectory->dwRVAFunctionAddressList);