From c6895f22d4ed85b55cd1173e76fbd905ff1cda96 Mon Sep 17 00:00:00 2001 From: Aleksey Bragin Date: Sat, 10 Oct 2009 09:16:34 +0000 Subject: [PATCH] Alexander Yastrebov - SetDllDirectory should add a directory to the search path used to locate DLLs for the application. See issue #4820 for more details. svn path=/trunk/; revision=43357 --- reactos/dll/win32/kernel32/misc/ldr.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/reactos/dll/win32/kernel32/misc/ldr.c b/reactos/dll/win32/kernel32/misc/ldr.c index 58c6bc096ae..6f4a2dd8197 100644 --- a/reactos/dll/win32/kernel32/misc/ldr.c +++ b/reactos/dll/win32/kernel32/misc/ldr.c @@ -63,6 +63,7 @@ GetDllLoadPath(LPCWSTR lpModule) } Length += GetCurrentDirectoryW(0, NULL); + Length += GetDllDirectoryW(0, NULL); Length += GetSystemDirectoryW(NULL, 0); Length += GetWindowsDirectoryW(NULL, 0); Length += GetEnvironmentVariableW(L"PATH", NULL, 0); @@ -84,6 +85,8 @@ GetDllLoadPath(LPCWSTR lpModule) Pos += GetCurrentDirectoryW(Length, EnvironmentBufferW + Pos); EnvironmentBufferW[Pos++] = L';'; + Pos += GetDllDirectoryW(Length - Pos, EnvironmentBufferW + Pos); + EnvironmentBufferW[Pos++] = L';'; Pos += GetSystemDirectoryW(EnvironmentBufferW + Pos, Length - Pos); EnvironmentBufferW[Pos++] = L';'; Pos += GetWindowsDirectoryW(EnvironmentBufferW + Pos, Length - Pos);