From a3690ead558d52fa602a18d1a8f11f817e148064 Mon Sep 17 00:00:00 2001 From: Aleksey Bragin Date: Fri, 8 Apr 2011 09:21:41 +0000 Subject: [PATCH] [KERNEL32] - Zero-initialize base address in BasepLoadLibraryAsDatafile. Should fix 2nd stage problems. - Add a trace debugprint, silented by default. See issue #6092 for more details. svn path=/trunk/; revision=51277 --- reactos/dll/win32/kernel32/misc/ldr.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/reactos/dll/win32/kernel32/misc/ldr.c b/reactos/dll/win32/kernel32/misc/ldr.c index 62e02fb696a..03c3ed1053d 100644 --- a/reactos/dll/win32/kernel32/misc/ldr.c +++ b/reactos/dll/win32/kernel32/misc/ldr.c @@ -274,7 +274,7 @@ BasepLoadLibraryAsDatafile(PWSTR Path, LPCWSTR Name, HMODULE *hModule) HANDLE hFile = INVALID_HANDLE_VALUE; HANDLE hMapping; NTSTATUS Status; - PVOID lpBaseAddress; + PVOID lpBaseAddress = NULL; SIZE_T ViewSize; //PUNICODE_STRING OriginalName; //UNICODE_STRING dotDLL = RTL_CONSTANT_STRING(L".DLL"); @@ -282,6 +282,8 @@ BasepLoadLibraryAsDatafile(PWSTR Path, LPCWSTR Name, HMODULE *hModule) /* Zero out handle value */ *hModule = 0; + DPRINT("BasepLoadLibraryAsDatafile(%S %S %p)\n", Path, Name, hModule); + /*Status = RtlDosApplyFileIsolationRedirection_Ustr(TRUE, Name, &dotDLL, @@ -470,7 +472,7 @@ done: if (FreeString) RtlFreeUnicodeString(&DllName); /* Set last error in failure case */ - if ( !NT_SUCCESS(Status)) + if (!NT_SUCCESS(Status)) { BaseSetLastNTError(Status); return NULL;