From dbe1886186f8dc78c53c4042d6835cd5a2f0d970 Mon Sep 17 00:00:00 2001 From: Rafal Harabien Date: Fri, 8 Jul 2011 19:42:53 +0000 Subject: [PATCH] [NTDLL/LDR] - Use \\KnownDlls\\KnownDllPath instead of \\KnownDlls\\KnownDlls to check known dlls patch (spotted by Thomas Faber) - Assume known dlls are in system32 if \\KnownDlls exists but KnownDllPath not svn path=/trunk/; revision=52574 --- reactos/dll/ntdll/ldr/ldrinit.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/reactos/dll/ntdll/ldr/ldrinit.c b/reactos/dll/ntdll/ldr/ldrinit.c index fd0aa391f11..40724db1942 100644 --- a/reactos/dll/ntdll/ldr/ldrinit.c +++ b/reactos/dll/ntdll/ldr/ldrinit.c @@ -1624,16 +1624,10 @@ LdrpInitializeProcess(IN PCONTEXT Context, &ObjectAttributes); /* Check if it exists */ - if (!NT_SUCCESS(Status)) - { - /* It doesn't, so assume System32 */ - LdrpKnownDllObjectDirectory = NULL; - RtlInitUnicodeString(&LdrpKnownDllPath, StringBuffer); - LdrpKnownDllPath.Length -= sizeof(WCHAR); - } - else + if (NT_SUCCESS(Status)) { /* Open the Known DLLs Path */ + RtlInitUnicodeString(&KnownDllString, L"KnownDllPath"); InitializeObjectAttributes(&ObjectAttributes, &KnownDllString, OBJ_CASE_INSENSITIVE, @@ -1658,6 +1652,15 @@ LdrpInitializeProcess(IN PCONTEXT Context, } } + /* Check if we failed */ + if (!NT_SUCCESS(Status)) + { + /* Aassume System32 */ + LdrpKnownDllObjectDirectory = NULL; + RtlInitUnicodeString(&LdrpKnownDllPath, StringBuffer); + LdrpKnownDllPath.Length -= sizeof(WCHAR); + } + /* If we have process parameters, get the default path and current path */ if (ProcessParameters) { -- 2.17.1