From: Paul Gofman pgofman@codeweavers.com
--- dlls/kernel32/tests/module.c | 2 +- dlls/ntdll/loader.c | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/dlls/kernel32/tests/module.c b/dlls/kernel32/tests/module.c index 88c3afc16c9..df48605c376 100644 --- a/dlls/kernel32/tests/module.c +++ b/dlls/kernel32/tests/module.c @@ -1412,7 +1412,7 @@ static void test_LdrGetDllHandleEx(void) bret = MoveFileA( "d01.dll", "d02.dll" ); ok( bret, "got error %lu.\n", GetLastError() ); status = pLdrGetDllHandleEx( LDR_GET_DLL_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, NULL, NULL, &name, &loaded_mod ); - todo_wine ok( status == STATUS_DLL_NOT_FOUND, "got %#lx.\n", status ); + ok( status == STATUS_DLL_NOT_FOUND, "got %#lx.\n", status ); CreateDirectoryA( "testdir", NULL ); DeleteFileA( "testdir\d02.dll" ); bret = MoveFileA( "d02.dll", "testdir\d02.dll" ); diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index 0ed37ad390c..2982b1e049b 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -3233,7 +3233,7 @@ done: */ static NTSTATUS find_dll_file( const WCHAR *load_path, const WCHAR *libname, UNICODE_STRING *nt_name, WINE_MODREF **pwm, HANDLE *mapping, SECTION_IMAGE_INFORMATION *image_info, - struct file_id *id ) + struct file_id *id, BOOL find_loaded ) { WCHAR *fullname = NULL; NTSTATUS status; @@ -3266,6 +3266,12 @@ static NTSTATUS find_dll_file( const WCHAR *load_path, const WCHAR *libname, UNI status = STATUS_SUCCESS; goto done; } + if (find_loaded) + { + TRACE( "Skipping file search for %s.\n", debugstr_w(libname) ); + status = STATUS_DLL_NOT_FOUND; + goto done; + } } }
@@ -3309,7 +3315,7 @@ static NTSTATUS load_dll( const WCHAR *load_path, const WCHAR *libname, DWORD fl
if (nts) { - nts = find_dll_file( load_path, libname, &nt_name, pwm, &mapping, &image_info, &id ); + nts = find_dll_file( load_path, libname, &nt_name, pwm, &mapping, &image_info, &id, FALSE ); system = FALSE; }
@@ -3499,7 +3505,7 @@ NTSTATUS WINAPI LdrGetDllHandleEx( ULONG flags, LPCWSTR load_path, ULONG *dll_ch RtlEnterCriticalSection( &loader_section );
status = find_dll_file( load_path, dllname ? dllname : name->Buffer, - &nt_name, &wm, &mapping, &image_info, &id ); + &nt_name, &wm, &mapping, &image_info, &id, TRUE );
if (wm) *base = wm->ldr.DllBase; else