ntdll: Fix LdrGetDllPath with LOAD_WITH_ALTERED_SEARCH_PATH without a path.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=26350 Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51821 Signed-off-by: Nick Fox <nick@foxsec.net> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
85723b9208
commit
ef26f7bd5c
|
@ -2659,7 +2659,6 @@ static void test_LdrGetDllPath(void)
|
||||||
ret = pLdrGetDllPath( fooW, LOAD_WITH_ALTERED_SEARCH_PATH, &path, &unknown_ptr );
|
ret = pLdrGetDllPath( fooW, LOAD_WITH_ALTERED_SEARCH_PATH, &path, &unknown_ptr );
|
||||||
ok( !ret, "LdrGetDllPath failed %x\n", ret );
|
ok( !ret, "LdrGetDllPath failed %x\n", ret );
|
||||||
ok( !unknown_ptr, "unknown ptr %p\n", unknown_ptr );
|
ok( !unknown_ptr, "unknown ptr %p\n", unknown_ptr );
|
||||||
todo_wine
|
|
||||||
build_search_path( buffer, ARRAY_SIZE(buffer), NULL, NULL, TRUE );
|
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));
|
ok( path_equal( path, buffer ), "got %s expected %s\n", wine_dbgstr_w(path), wine_dbgstr_w(buffer));
|
||||||
pRtlReleasePath( path );
|
pRtlReleasePath( path );
|
||||||
|
@ -2667,7 +2666,6 @@ static void test_LdrGetDllPath(void)
|
||||||
ret = pLdrGetDllPath( L"temp/foo", LOAD_WITH_ALTERED_SEARCH_PATH, &path, &unknown_ptr );
|
ret = pLdrGetDllPath( L"temp/foo", LOAD_WITH_ALTERED_SEARCH_PATH, &path, &unknown_ptr );
|
||||||
ok( !ret, "LdrGetDllPath failed %x\n", ret );
|
ok( !ret, "LdrGetDllPath failed %x\n", ret );
|
||||||
ok( !unknown_ptr, "unknown ptr %p\n", unknown_ptr );
|
ok( !unknown_ptr, "unknown ptr %p\n", unknown_ptr );
|
||||||
todo_wine
|
|
||||||
build_search_path( buffer, ARRAY_SIZE(buffer), NULL, NULL, TRUE );
|
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));
|
ok( path_equal( path, buffer ), "got %s expected %s\n", wine_dbgstr_w(path), wine_dbgstr_w(buffer));
|
||||||
pRtlReleasePath( path );
|
pRtlReleasePath( path );
|
||||||
|
|
|
@ -4329,7 +4329,7 @@ NTSTATUS WINAPI LdrGetDllPath( PCWSTR module, ULONG flags, PWSTR *path, PWSTR *u
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const WCHAR *dlldir = dll_directory.Length ? dll_directory.Buffer : NULL;
|
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;
|
module = NtCurrentTeb()->Peb->ProcessParameters->ImagePathName.Buffer;
|
||||||
status = get_dll_load_path( module, dlldir, dll_safe_mode, path );
|
status = get_dll_load_path( module, dlldir, dll_safe_mode, path );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue