Commit ef26f7bd authored by Nick Fox's avatar Nick Fox Committed by Alexandre Julliard

ntdll: Fix LdrGetDllPath with LOAD_WITH_ALTERED_SEARCH_PATH without a path.

parent 85723b92
......@@ -2659,7 +2659,6 @@ static void test_LdrGetDllPath(void)
ret = pLdrGetDllPath( fooW, LOAD_WITH_ALTERED_SEARCH_PATH, &path, &unknown_ptr );
ok( !ret, "LdrGetDllPath failed %x\n", ret );
ok( !unknown_ptr, "unknown ptr %p\n", unknown_ptr );
todo_wine
build_search_path( buffer, ARRAY_SIZE(buffer), NULL, NULL, TRUE );
ok( path_equal( path, buffer ), "got %s expected %s\n", wine_dbgstr_w(path), wine_dbgstr_w(buffer));
pRtlReleasePath( path );
......@@ -2667,7 +2666,6 @@ static void test_LdrGetDllPath(void)
ret = pLdrGetDllPath( L"temp/foo", LOAD_WITH_ALTERED_SEARCH_PATH, &path, &unknown_ptr );
ok( !ret, "LdrGetDllPath failed %x\n", ret );
ok( !unknown_ptr, "unknown ptr %p\n", unknown_ptr );
todo_wine
build_search_path( buffer, ARRAY_SIZE(buffer), NULL, NULL, TRUE );
ok( path_equal( path, buffer ), "got %s expected %s\n", wine_dbgstr_w(path), wine_dbgstr_w(buffer));
pRtlReleasePath( path );
......
......@@ -4329,7 +4329,7 @@ NTSTATUS WINAPI LdrGetDllPath( PCWSTR module, ULONG flags, PWSTR *path, PWSTR *u
else
{
const WCHAR *dlldir = dll_directory.Length ? dll_directory.Buffer : NULL;
if (!(flags & LOAD_WITH_ALTERED_SEARCH_PATH))
if (!(flags & LOAD_WITH_ALTERED_SEARCH_PATH) || !wcschr( module, L'\\' ))
module = NtCurrentTeb()->Peb->ProcessParameters->ImagePathName.Buffer;
status = get_dll_load_path( module, dlldir, dll_safe_mode, path );
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment