diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index 14cc105b64d..cfec779dd59 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -2675,6 +2675,7 @@ static NTSTATUS find_builtin_without_file( const WCHAR *name, UNICODE_STRING *ne if (!get_env_var( L"WINEBUILDDIR", 20 + 2 * wcslen(name), new_name )) { + len = new_name->Length; RtlAppendUnicodeToString( new_name, L"\\dlls\\" ); RtlAppendUnicodeToString( new_name, name ); if ((ext = wcsrchr( name, '.' )) && !wcscmp( ext, L".dll" )) new_name->Length -= 4 * sizeof(WCHAR); @@ -2685,6 +2686,17 @@ static NTSTATUS find_builtin_without_file( const WCHAR *name, UNICODE_STRING *ne RtlAppendUnicodeToString( new_name, L".fake" ); status = open_dll_file( new_name, pwm, mapping, image_info, id ); if (status != STATUS_DLL_NOT_FOUND) goto done; + + new_name->Length = len; + RtlAppendUnicodeToString( new_name, L"\\programs\\" ); + RtlAppendUnicodeToString( new_name, name ); + RtlAppendUnicodeToString( new_name, L"\\" ); + RtlAppendUnicodeToString( new_name, name ); + status = open_dll_file( new_name, pwm, mapping, image_info, id ); + if (status != STATUS_DLL_NOT_FOUND) goto done; + RtlAppendUnicodeToString( new_name, L".fake" ); + status = open_dll_file( new_name, pwm, mapping, image_info, id ); + if (status != STATUS_DLL_NOT_FOUND) goto done; RtlFreeUnicodeString( new_name ); }