Commit aee405e2 authored by Paul Gofman's avatar Paul Gofman Committed by Alexandre Julliard

ntdll: Always try searching apiset DLLs in the default directories.

This is a temporary workaround until we have a correct apisets implementation. Signed-off-by: 's avatarPaul Gofman <pgofman@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 2d56b0a9
...@@ -466,6 +466,7 @@ static void testLoadLibraryEx(void) ...@@ -466,6 +466,7 @@ static void testLoadLibraryEx(void)
static void test_LoadLibraryEx_search_flags(void) static void test_LoadLibraryEx_search_flags(void)
{ {
static const char apiset_dll[] = "api-ms-win-shcore-obsolete-l1-1-0.dll";
static const struct static const struct
{ {
int add_dirs[4]; int add_dirs[4];
...@@ -684,6 +685,28 @@ static void test_LoadLibraryEx_search_flags(void) ...@@ -684,6 +685,28 @@ static void test_LoadLibraryEx_search_flags(void)
for (k = 0; tests[j].add_dirs[k]; k++) pRemoveDllDirectory( cookies[k] ); for (k = 0; tests[j].add_dirs[k]; k++) pRemoveDllDirectory( cookies[k] );
} }
mod = GetModuleHandleA( apiset_dll );
if (mod)
{
win_skip( "%s already referenced, skipping test.\n", apiset_dll );
}
else
{
mod = LoadLibraryA( apiset_dll );
if (mod)
{
FreeLibrary(mod);
mod = LoadLibraryExA( apiset_dll, NULL, LOAD_LIBRARY_SEARCH_APPLICATION_DIR );
ok( !!mod, "Got NULL module, error %u.\n", GetLastError() );
ok( !!GetModuleHandleA( apiset_dll ), "Got NULL handle.\n" );
ret = FreeLibrary( mod );
ok( ret, "FreeLibrary failed, error %u.\n", GetLastError() );
}
else
{
win_skip( "%s not found, skipping test.\n", apiset_dll );
}
}
done: done:
for (i = 1; i <= 6; i++) for (i = 1; i <= 6; i++)
{ {
......
...@@ -2905,6 +2905,16 @@ done: ...@@ -2905,6 +2905,16 @@ done:
return status; return status;
} }
/***********************************************************************
* is_apiset_dll_name
*
*/
static BOOL is_apiset_dll_name( const WCHAR *name )
{
static const WCHAR name_prefix[] = L"api-ms-win-";
return !wcsnicmp( name, name_prefix, ARRAY_SIZE(name_prefix) - 1 );
}
/*********************************************************************** /***********************************************************************
* find_dll_file * find_dll_file
...@@ -2948,6 +2958,8 @@ static NTSTATUS find_dll_file( const WCHAR *load_path, const WCHAR *libname, UNI ...@@ -2948,6 +2958,8 @@ static NTSTATUS find_dll_file( const WCHAR *load_path, const WCHAR *libname, UNI
if (RtlDetermineDosPathNameType_U( libname ) == RELATIVE_PATH) if (RtlDetermineDosPathNameType_U( libname ) == RELATIVE_PATH)
{ {
status = search_dll_file( load_path, libname, nt_name, pwm, mapping, image_info, id ); status = search_dll_file( load_path, libname, nt_name, pwm, mapping, image_info, id );
if (status == STATUS_DLL_NOT_FOUND && load_path && is_apiset_dll_name( libname ))
status = search_dll_file( NULL, libname, nt_name, pwm, mapping, image_info, id );
if (status == STATUS_DLL_NOT_FOUND) if (status == STATUS_DLL_NOT_FOUND)
status = find_builtin_without_file( libname, nt_name, pwm, mapping, image_info, id ); status = find_builtin_without_file( libname, nt_name, pwm, mapping, image_info, id );
} }
......
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