From b77afe76b19010141410b19bc243b28f0388d770 Mon Sep 17 00:00:00 2001 From: Dmitry Timoshkov Date: Wed, 21 Mar 2001 03:38:03 +0000 Subject: [PATCH] Allow loading of built-in dlls with LOAD_LIBRARY_AS_DATAFILE flag set. --- loader/module.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/loader/module.c b/loader/module.c index 83430edf27f..9d905e6217d 100644 --- a/loader/module.c +++ b/loader/module.c @@ -1258,8 +1258,12 @@ HMODULE WINAPI LoadLibraryExA(LPCSTR libname, HANDLE hfile, DWORD flags) HANDLE hFile; HMODULE hmod = 0; + /* This method allows searching for the 'native' libraries only */ if (!SearchPathA( NULL, libname, ".dll", sizeof(filename), filename, NULL )) - return 0; + { + flags |= DONT_RESOLVE_DLL_REFERENCES; /* Just in case */ + goto try_builtin; /* Fallback to normal behaviour */ + } /* FIXME: maybe we should use the hfile parameter instead */ hFile = CreateFileA( filename, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0 ); @@ -1270,7 +1274,7 @@ HMODULE WINAPI LoadLibraryExA(LPCSTR libname, HANDLE hfile, DWORD flags) } return hmod; } - + try_builtin: RtlAcquirePebLock(); wm = MODULE_LoadLibraryExA( libname, hfile, flags );